diff --git a/.eslintignore b/.eslintignore index fba46e43283..303356d0450 100644 --- a/.eslintignore +++ b/.eslintignore @@ -26,3 +26,5 @@ scripts/skipPrepareScript.js .eslintignore .prettierignore *.json +Dockerfile* +*.properties \ No newline at end of file diff --git a/.github/workflows/allure-test-reporter.yml b/.github/workflows/allure-test-reporter.yml new file mode 100644 index 00000000000..959127a2a65 --- /dev/null +++ b/.github/workflows/allure-test-reporter.yml @@ -0,0 +1,114 @@ +name: Allure Test Reporter + +on: + pull_request: + types: + - opened + - reopened + - synchronize + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + +permissions: + id-token: write + contents: write # Required for gh-pages deployment + +jobs: + test_and_publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4.2.1 + + - name: Setup Node + uses: actions/setup-node@v4.0.4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + + - name: Install Dependencies + run: npm ci + + - name: Run Tests and Generate Report + run: | + npm run test:ts:silent + + - name: Install Allure + run: npm install -g allure-commandline + + - name: Generate Allure Report + run: | + REPO_NAME=$(basename ${{ github.repository }}) + PR_NUMBER=${{ github.event.pull_request.number }} + REPORT_FOLDER="${REPO_NAME}/${PR_NUMBER}" + allure generate allure-results --clean -o "${REPORT_FOLDER}" + echo "REPORT_FOLDER=${REPORT_FOLDER}" >> $GITHUB_ENV # Persist this variable + + - name: Checkout Reports Repository + uses: actions/checkout@v4 + with: + repository: rudderlabs/test-reports + token: ${{ secrets.PAT }} + path: test-reports + + - name: Copy Allure Report to Reports Repository + run: | + mkdir -p "test-reports/$REPORT_FOLDER" + cp -r $REPORT_FOLDER/* test-reports/$REPORT_FOLDER/ + + - name: Cleanup Old Reports (Keep Only Last 50) + run: | + REPO_NAME=$(basename ${{ github.repository }}) + cd test-reports/${REPO_NAME} + ls -t | tail -n +51 | xargs rm -rf || echo "No old reports to delete" + + - name: Commit and Push Report + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + run: | + cd test-reports + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + + # Stash any unstaged changes before pulling + git add . + git stash || echo "No changes to stash" + + # Pull latest changes safely + git pull --rebase origin main + + # Apply the stashed changes back + git stash pop || echo "No stash to apply" + + # Commit new report if there are changes + git add . + git commit -m "chore: add allure report for $REPORT_FOLDER" || echo "No changes to commit" + + # Push changes with retry logic + for i in {1..5}; do + git push origin main && break || sleep 5 + git pull --rebase origin main + done + + - name: Add Test Report Link as Comment on PR + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.PAT }} + script: | + const { owner, repo } = context.repo; + const prNumber = context.payload.pull_request.number; + + const reportFolder = process.env.REPORT_FOLDER; // Read from environment variable + const commentBody = `Allure Test reports for this run are available at: + - Allure Report: [View Report](https://rudderlabs.github.io/test-reports/${reportFolder}/index.html)`; + + // Comment on the pull request + await github.rest.issues.createComment({ + owner, + repo, + issue_number: prNumber, + body: commentBody + }); diff --git a/.github/workflows/build-push-docker-image.yml b/.github/workflows/build-push-docker-image.yml index 1b2c454e438..f19badfd319 100644 --- a/.github/workflows/build-push-docker-image.yml +++ b/.github/workflows/build-push-docker-image.yml @@ -33,7 +33,7 @@ on: workflow_url: type: string secrets: - DOCKERHUB_PROD_TOKEN: + DOCKERHUB_TOKEN: required: true DOCKERHUB_USERNAME: required: true @@ -101,7 +101,7 @@ jobs: with: ref: ${{ needs.get_sha.outputs.sha }} fetch-depth: 1 - + - name: Login to DockerHub uses: docker/login-action@v3.3.0 with: @@ -154,12 +154,12 @@ jobs: with: ref: ${{ needs.get_sha.outputs.sha }} fetch-depth: 1 - + - name: Login to DockerHub uses: docker/login-action@v3.3.0 with: username: ${{ env.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3.7.1 @@ -207,7 +207,7 @@ jobs: uses: docker/login-action@v3.3.0 with: username: ${{ env.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.7.1 diff --git a/.github/workflows/component-test-report.yml b/.github/workflows/component-test-report.yml deleted file mode 100644 index 8d739c5aee6..00000000000 --- a/.github/workflows/component-test-report.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Component Test Reporter - -on: - pull_request: - types: - - opened - - 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 - -jobs: - test_and_upload: - runs-on: ubuntu-latest - - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ secrets.AWS_DEV_ACCOUNT_ID }}:role/${{ secrets.AWS_DEV_S3_SYNC_ROLE }} - aws-region: us-east-1 - - - name: Checkout - uses: actions/checkout@v4.2.1 - with: - fetch-depth: 1 - - - name: Setup Node - uses: actions/setup-node@v4.0.4 - with: - node-version-file: '.nvmrc' - cache: 'npm' - - - name: Install Dependencies - run: npm ci - - - name: Run Tests and Generate Report - run: | - npm run test:ts -- component - - - name: Uplaod Report to S3 - run: | - aws s3 cp ./test_reports/ s3://test-integrations-dev/integrations-test-reports/rudder-transformer/${{ github.event.number }}/ --recursive - - - name: Add Test Report Link as Comment on PR - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.PAT }} - script: | - const { owner, repo } = context.repo; - // Get the pull request number - const prNumber = context.payload.pull_request.number; - const commentBody = `Test report for this run is available at: https://test-integrations-dev.s3.amazonaws.com/integrations-test-reports/rudder-transformer/${prNumber}/test-report.html`; - - // find all the comments of the PR - const issueComments = await github.paginate(github.rest.issues.listComments, { - owner, - repo, - issue_number: prNumber, - }); - - for (const comment of issueComments) { - if (comment.body === commentBody) { - console.log('Comment already exists'); - return; - } - } - - // Comment on the pull request - await github.rest.issues.createComment({ - owner, - repo, - issue_number: prNumber, - body: commentBody - }); diff --git a/.github/workflows/create-hotfix-branch.yml b/.github/workflows/create-hotfix-branch.yml index 994283a9f43..3cdc27609ee 100644 --- a/.github/workflows/create-hotfix-branch.yml +++ b/.github/workflows/create-hotfix-branch.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest # Only allow these users to create new hotfix branch from 'main' - if: github.ref == 'refs/heads/main' && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'koladilip' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'utsabc') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'koladilip' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'sanpj2292' || github.triggering_actor == 'utsabc') + if: github.ref == 'refs/heads/main' && (github.actor == 'vinayteki95' || github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'koladilip' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'utsabc') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'koladilip' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'sanpj2292' || github.triggering_actor == 'utsabc' || github.triggering_actor == 'vinayteki95') steps: - name: Create Branch uses: peterjgrainger/action-create-branch@v2.4.0 diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 602ded980fd..726b28cc96c 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest # Only allow release stakeholders to initiate releases - if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'koladilip' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'yashasvibajpai' || github.actor == 'sanpj2292' || github.actor == 'utsabc') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'koladilip' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'yashasvibajpai' || github.triggering_actor == 'sanpj2292' || github.triggering_actor == 'utsabc') + if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'sandeepdsvs' || github.actor == 'koladilip' || github.actor == 'yashasvibajpai' || github.actor == 'sanpj2292' || github.actor == 'utsabc' || github.actor == 'vinayteki95') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'koladilip' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'yashasvibajpai' || github.triggering_actor == 'sanpj2292' || github.triggering_actor == 'utsabc') steps: - name: Checkout uses: actions/checkout@v4.2.1 @@ -79,10 +79,11 @@ jobs: git push - name: Create Pull Request - uses: repo-sync/pull-request@v2.12.1 - with: - source_branch: ${{ steps.create-release.outputs.branch_name }} - destination_branch: 'main' - github_token: ${{ secrets.PAT }} - pr_title: 'chore(release): pull ${{ steps.create-release.outputs.branch_name }} into main' - pr_body: ':crown: *An automated PR*' + run: | + gh pr create \ + --base main \ + --head "${{ steps.create-release.outputs.branch_name }}" \ + --title "chore(release): pull ${{ steps.create-release.outputs.branch_name }} into main" \ + --body ":crown: *An automated PR*" + env: + GH_TOKEN: ${{ secrets.PAT }} diff --git a/.github/workflows/prepare-for-dev-deploy.yml b/.github/workflows/prepare-for-dev-deploy.yml index a824dbb540b..a43cb95d330 100644 --- a/.github/workflows/prepare-for-dev-deploy.yml +++ b/.github/workflows/prepare-for-dev-deploy.yml @@ -77,4 +77,4 @@ jobs: secrets: DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/prepare-for-prod-dt-deploy.yml b/.github/workflows/prepare-for-prod-dt-deploy.yml index dd7138136ad..44c3813a8a7 100644 --- a/.github/workflows/prepare-for-prod-dt-deploy.yml +++ b/.github/workflows/prepare-for-prod-dt-deploy.yml @@ -161,7 +161,7 @@ jobs: cd customer-objects - declare -a enabled_ut_customers=() + declare -a enabled_dt_customers=() declare -a sub_directories=('enterprise-us' 'enterprise-eu') # identify the customers enabled in sub-directories @@ -169,21 +169,21 @@ jobs: for f in "./$directory"/*; do [[ -f $f ]] || continue - enabled="$(yq e '.spec.user_transformer.enabled' $f)" + enabled="$(yq e '.spec.transformer.enabled' $f)" if [ $enabled == "true" ]; then - enabled_ut_customers+=( $f ) + enabled_dt_customers+=( $f ) fi done done # bump up the customers version and repository information - for customer in "${enabled_ut_customers[@]}"; do - yq eval -i ".spec.user_transformer.image.version=\"$TAG_NAME\"" $customer - yq eval -i ".spec.user_transformer.image.repository=\"$TF_IMAGE_REPOSITORY\"" $customer + for customer in "${enabled_dt_customers[@]}"; do + yq eval -i ".spec.transformer.image.version=\"$TAG_NAME\"" $customer + yq eval -i ".spec.transformer.image.repository=\"$TF_IMAGE_REPOSITORY\"" $customer git add $customer done - git commit -m "chore: upgrade dedicated transformers to $TAG_NAME" + git commit -m "chore: upgrade dedicated dt transformers to $TAG_NAME" git push -u origin dedicated-transformer-$TAG_NAME gh pr create --fill diff --git a/.github/workflows/prepare-for-prod-ut-deploy.yml b/.github/workflows/prepare-for-prod-ut-deploy.yml index 698e2a48a18..3a20a506b53 100644 --- a/.github/workflows/prepare-for-prod-ut-deploy.yml +++ b/.github/workflows/prepare-for-prod-ut-deploy.yml @@ -29,6 +29,7 @@ jobs: if: ((startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/') || startsWith(github.event.pull_request.head.ref, 'master')) && github.event.pull_request.merged == true) outputs: tag_name_ut: ${{ steps.gen_tag_names.outputs.tag_name_ut }} + tag_name: ${{ steps.gen_tag_names.outputs.tag_name }} steps: - name: Checkout uses: actions/checkout@v4.2.1 @@ -73,6 +74,7 @@ jobs: needs: [generate-tag-names, build-user-transformer-image] env: UT_TAG_NAME: ${{ needs.generate-tag-names.outputs.tag_name_ut }} + TAG_NAME: ${{ needs.generate-tag-names.outputs.tag_name }} TF_IMAGE_REPOSITORY: rudderstack/rudder-transformer steps: - name: Checkout @@ -136,3 +138,39 @@ jobs: git push -u origin hosted-user-transformer-$UT_TAG_NAME gh pr create --fill + + - name: Update helm charts and raise pull request for enterprise customers on dedicated transformers + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + run: | + cd rudder-devops + git checkout -b dedicated-user-transformer-$TAG_NAME + + cd customer-objects + + declare -a enabled_ut_customers=() + declare -a sub_directories=('enterprise-us' 'enterprise-eu') + + # identify the customers enabled in sub-directories + for directory in "${sub_directories[@]}"; do + for f in "./$directory"/*; do + [[ -f $f ]] || continue + + enabled="$(yq e '.spec.user_transformer.enabled' $f)" + if [ $enabled == "true" ]; then + enabled_ut_customers+=( $f ) + fi + done + done + + # bump up the customers version and repository information + for customer in "${enabled_ut_customers[@]}"; do + yq eval -i ".spec.user_transformer.image.version=\"$TAG_NAME\"" $customer + yq eval -i ".spec.user_transformer.image.repository=\"$TF_IMAGE_REPOSITORY\"" $customer + git add $customer + done + + git commit -m "chore: upgrade dedicated user transformers to $TAG_NAME" + git push -u origin dedicated-user-transformer-$TAG_NAME + + gh pr create --fill diff --git a/.github/workflows/publish-new-release.yml b/.github/workflows/publish-new-release.yml index a91a1e2b22b..5953f94c93e 100644 --- a/.github/workflows/publish-new-release.yml +++ b/.github/workflows/publish-new-release.yml @@ -63,13 +63,14 @@ jobs: echo "DATE=$(date)" >> $GITHUB_ENV - name: Pull Changes Into develop Branch - uses: repo-sync/pull-request@v2.12.1 - with: - source_branch: 'main' - destination_branch: 'develop' - github_token: ${{ secrets.PAT }} - pr_title: 'chore(release): pull main into develop post release v${{ steps.extract-version.outputs.release_version }}' - pr_body: ':crown: *An automated PR*' + run: | + gh pr create \ + --base develop \ + --head main \ + --title "chore(release): pull main into develop post release v${{ steps.extract-version.outputs.release_version }}" \ + --body ":crown: *An automated PR*" + env: + GH_TOKEN: ${{ secrets.PAT }} - name: Delete Release Branch uses: koj-co/delete-merged-action@master @@ -99,7 +100,7 @@ jobs: channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }} payload: | { - "text": "*<${{env.RELEASES_URL}}v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\nCC: <@U03KG4BK1L1> <@U024YF8CR53> <@U01LVJ30QEB>", + "text": "*<${{env.RELEASES_URL}}v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\nCC: <@S02AEQL26CT> <@S03SEKBFX0D> <@U021E50QAGY>", "blocks": [ { "type": "header", diff --git a/.gitignore b/.gitignore index 84421f49d9b..5526573051e 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ bower_components # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release +build/ # Dependency directories node_modules/ @@ -91,6 +92,7 @@ out # Nuxt.js build / generate output .nuxt dist +dist-test # Gatsby files .cache/ @@ -139,4 +141,11 @@ dist # component test report test_reports/ -temp/ \ No newline at end of file +temp/ + +# Allure +allure-results/ +allure-report/ + +# local scripts +*/scripts/local/ \ No newline at end of file diff --git a/.nvmrc b/.nvmrc index 99c98cdd6a8..87bc4c77fe1 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.20.1 +20.18.3 diff --git a/.vscode/launch.json b/.vscode/launch.json index d6feaf356ee..4834a273d9b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,38 +1,19 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { - "name": "transformer", - "type": "node", - "request": "launch", - "program": "${workspaceRoot}/index.js", - "runtimeArgs": ["--nolazy"], - "sourceMaps": true, - "runtimeExecutable": "/usr/local/bin/node" - }, { "type": "node", "request": "launch", - "name": "Launch TS", - "program": "${workspaceFolder}/dist/src/index.js", + "name": "transformer", + "program": "${workspaceFolder}/src/index.ts", "outFiles": ["${workspaceFolder}/dist/src/**/*.js"], - "runtimeExecutable": "/usr/local/bin/node" - }, - { - "name": "benchmark", - "type": "node", - "request": "launch", - "program": "${workspaceRoot}/benchmark", - "args": ["--destinations=${input:destinations}", "--feature=${input:feature}"], - "runtimeArgs": ["--nolazy"], - "sourceMaps": true, - "runtimeExecutable": "/usr/local/bin/node" + "runtimeArgs": ["--require", "${workspaceFolder}/node_modules/ts-node/register"], + "resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"], + "env": { + "NODE_ENV": "development" + } }, { - "runtimeExecutable": "/usr/local/bin/node", "type": "node", "request": "launch", "name": "Jest Current File", @@ -40,24 +21,34 @@ "args": ["${fileBasenameNoExtension}", "--config", "jest.config.js"], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", - "disableOptimisticBPs": true, + "runtimeArgs": ["--require", "${workspaceFolder}/node_modules/ts-node/register"], "windows": { "program": "${workspaceFolder}/node_modules/jest/bin/jest" + }, + "env": { + "NODE_ENV": "test" } - } - ], - "inputs": [ - { - "id": "destinations", - "type": "promptString", - "description": "Enter destinations", - "default": "algolia" }, { - "id": "feature", - "type": "promptString", - "description": "Enter Feature", - "default": "proc" + "type": "node", + "request": "launch", + "name": "Test Single Component", + "program": "${workspaceFolder}/node_modules/.bin/jest", + "args": [ + "-c", + "jest.config.typescript.js", + "component", + "--destination=monday", + "--feature=processor" + ], + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "runtimeArgs": ["--require", "${workspaceFolder}/node_modules/ts-node/register"], + "env": { + "NODE_ENV": "test", + "NODE_OPTIONS": "--no-node-snapshot", + "LOG_LEVEL": "silent" + } } ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index e742ea1f553..32fd6be4654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,206 @@ 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.94.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.93.0...v1.94.0) (2025-03-18) + + +### Features + +* onboarding new destination accoil analytics ([#4156](https://github.com/rudderlabs/rudder-transformer/issues/4156)) ([8aad46f](https://github.com/rudderlabs/rudder-transformer/commit/8aad46fd8bde0d839a33751ef16e9e68c168c125)) + + +### Bug Fixes + +* add 2655 error handling to fb error handler at proxy ([#4152](https://github.com/rudderlabs/rudder-transformer/issues/4152)) ([5d3b226](https://github.com/rudderlabs/rudder-transformer/commit/5d3b2263754b94193c302c2f88cac2a055a22b53)) + +## [1.93.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.92.1...v1.93.0) (2025-03-10) + + +### Features + +* **destination:** pass object data in event for moengage ([#4111](https://github.com/rudderlabs/rudder-transformer/issues/4111)) ([5edfbb8](https://github.com/rudderlabs/rudder-transformer/commit/5edfbb834bfde0d39f6f177406ebf70a1138ddad)) +* onboarding new source facebook lead ads ([#4132](https://github.com/rudderlabs/rudder-transformer/issues/4132)) ([7e54fa2](https://github.com/rudderlabs/rudder-transformer/commit/7e54fa22e416aa998e6d2d009b36cff814df94a1)) + + +### Bug Fixes + +* **destination:** use coql api to delete record for zoho ([#4134](https://github.com/rudderlabs/rudder-transformer/issues/4134)) ([2c67c9a](https://github.com/rudderlabs/rudder-transformer/commit/2c67c9abe6ca50320bea195d22bc00f70ee65ddf)) +* marketo get auth token cache issue ([#4140](https://github.com/rudderlabs/rudder-transformer/issues/4140)) ([29175ac](https://github.com/rudderlabs/rudder-transformer/commit/29175ac13e1918a67e9a8367423fd9c1327aacc5)) + +### [1.92.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.92.0...v1.92.1) (2025-03-07) + + +### Bug Fixes + +* wrong method during update call when dont batch true ([#4146](https://github.com/rudderlabs/rudder-transformer/issues/4146)) ([3aae1cb](https://github.com/rudderlabs/rudder-transformer/commit/3aae1cbba494c29824154d98beff5ae5ec67b506)) + +## [1.92.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.5...v1.92.0) (2025-03-03) + + +### Features + +* added event validation in braze source ([#4104](https://github.com/rudderlabs/rudder-transformer/issues/4104)) ([bcb98e1](https://github.com/rudderlabs/rudder-transformer/commit/bcb98e13509b734d68d20fbc42277cc94398eeba)) +* id stitching improvement in shopify pixel transformations ([#4060](https://github.com/rudderlabs/rudder-transformer/issues/4060)) ([558eab6](https://github.com/rudderlabs/rudder-transformer/commit/558eab64652da9f75ca9bc4a5484460e3a95b8e9)), closes [#4074](https://github.com/rudderlabs/rudder-transformer/issues/4074) [#4092](https://github.com/rudderlabs/rudder-transformer/issues/4092) +* remove consent from db-config and add store sales to integrations object ([#4091](https://github.com/rudderlabs/rudder-transformer/issues/4091)) ([2943b3d](https://github.com/rudderlabs/rudder-transformer/commit/2943b3d77f177d6b93fb5231eead81f9f05accb9)) +* zoho vdmv2 ([#4096](https://github.com/rudderlabs/rudder-transformer/issues/4096)) ([2d129a7](https://github.com/rudderlabs/rudder-transformer/commit/2d129a79ce8e8599e4bd5d5718afb25100a689ff)) + + +### Bug Fixes + +* add module in the search url path for zoho ([#4126](https://github.com/rudderlabs/rudder-transformer/issues/4126)) ([f7ed9a4](https://github.com/rudderlabs/rudder-transformer/commit/f7ed9a434299b750095642b0030323bc72f1341c)) +* added missing email check during primary email id filtering in zendesk destination ([#4124](https://github.com/rudderlabs/rudder-transformer/issues/4124)) ([b991017](https://github.com/rudderlabs/rudder-transformer/commit/b991017faffed3479d805a276d53f58469f16699)) +* mixpanel ios property mapping ios_app_release and ios_app_version ([#4072](https://github.com/rudderlabs/rudder-transformer/issues/4072)) ([d9eb0c5](https://github.com/rudderlabs/rudder-transformer/commit/d9eb0c5da16eccedac8d1b9bf524ef8bd6569fa4)) +* vs code debugger config ([#4130](https://github.com/rudderlabs/rudder-transformer/issues/4130)) ([bbb969b](https://github.com/rudderlabs/rudder-transformer/commit/bbb969b90c3e82f73d2bbd99f5ec62bb8dd67a8c)) + +### [1.91.5](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.4...v1.91.5) (2025-02-28) + + +### Bug Fixes + +* mailjet handling of v2 spec ([94611c9](https://github.com/rudderlabs/rudder-transformer/commit/94611c942afca4b17f4dd60024172ce4bc599563)) + +### [1.91.4](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.3...v1.91.4) (2025-02-27) + +### [1.91.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.2...v1.91.3) (2025-02-25) + +### [1.91.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.1...v1.91.2) (2025-02-24) + +### [1.91.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.0...v1.91.1) (2025-02-19) + + +### Bug Fixes + +* snapchat util function for normalizing phone number ([#4093](https://github.com/rudderlabs/rudder-transformer/issues/4093)) ([17ff7f9](https://github.com/rudderlabs/rudder-transformer/commit/17ff7f96a2a911485592afb379dd2886ee8b9982)) + +## [1.91.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.90.2...v1.91.0) (2025-02-17) + + +### Features + +* add support for hashed cart token as anonymousid ([#4048](https://github.com/rudderlabs/rudder-transformer/issues/4048)) ([2b350fe](https://github.com/rudderlabs/rudder-transformer/commit/2b350fe22919d99b803cb17629b30f0c83dc5f8a)) +* added drop traits in track call feature for mixpanel ([#4034](https://github.com/rudderlabs/rudder-transformer/issues/4034)) ([bdd735d](https://github.com/rudderlabs/rudder-transformer/commit/bdd735df38d92b6658250e500d13f3e4b4c7ffad)) +* **http:** add support for isDefaultMapping ([#4073](https://github.com/rudderlabs/rudder-transformer/issues/4073)) ([05553eb](https://github.com/rudderlabs/rudder-transformer/commit/05553eb5cbf3aa0afd752dca9af74e32722876ed)) + + +### Bug Fixes + +* airship array handling ([#4011](https://github.com/rudderlabs/rudder-transformer/issues/4011)) ([ce86cec](https://github.com/rudderlabs/rudder-transformer/commit/ce86cecbc0a2edbdff8878541771a2ebcf3f6dd9)) +* content_price should be a number with decimal point in twitter ads ([#4075](https://github.com/rudderlabs/rudder-transformer/issues/4075)) ([711e18b](https://github.com/rudderlabs/rudder-transformer/commit/711e18bfcec1518830076bbe7e49ba7b2f2e3757)) +* fixing wrong identifiers in payload for twitter ads destination ([#3988](https://github.com/rudderlabs/rudder-transformer/issues/3988)) ([3fdc92b](https://github.com/rudderlabs/rudder-transformer/commit/3fdc92b93869e875c50c482f890283c97611dc4f)) + +### [1.90.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.90.1...v1.90.2) (2025-02-11) + + +### Bug Fixes + +* better error handling in webhook v2 ([9f224ec](https://github.com/rudderlabs/rudder-transformer/commit/9f224ec03b91f1a4d85b117dbf6972bb1ef40c6d)) +* improve error handling for webhook v2 ([f44d5a5](https://github.com/rudderlabs/rudder-transformer/commit/f44d5a56fd6ee183aea73eaba7e73c121f8bc470)) +* improve error handling for webhook v2 ([#4061](https://github.com/rudderlabs/rudder-transformer/issues/4061)) ([5d1e1bd](https://github.com/rudderlabs/rudder-transformer/commit/5d1e1bdb26bacddb3838bd16752b333d7814c294)) +* improve error handling for webhook v2 ([#4062](https://github.com/rudderlabs/rudder-transformer/issues/4062)) ([d795830](https://github.com/rudderlabs/rudder-transformer/commit/d79583087e98d713afb9b38d3a25d4e580a36c76)) + +### [1.90.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.90.0...v1.90.1) (2025-02-06) + + +### Bug Fixes + +* update google ads api version for gaoc ([#4047](https://github.com/rudderlabs/rudder-transformer/issues/4047)) ([62705c0](https://github.com/rudderlabs/rudder-transformer/commit/62705c0613f3c38b8f3e6baf047467ce97878625)) + +## [1.90.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.89.1...v1.90.0) (2025-02-03) + + +### Features + +* **http:** enclose constants with quotes in mappings ([#4037](https://github.com/rudderlabs/rudder-transformer/issues/4037)) ([d62ba40](https://github.com/rudderlabs/rudder-transformer/commit/d62ba40ff26d1f4fc27b54f1546094f384ee7266)) +* **http:** minor bug fixes and enhancements related to XML and FORM formats ([#4022](https://github.com/rudderlabs/rudder-transformer/issues/4022)) ([241250d](https://github.com/rudderlabs/rudder-transformer/commit/241250d10e1d8cb904ec188312e1ec5532379e93)) +* onboarding customerio segment destination ([#4028](https://github.com/rudderlabs/rudder-transformer/issues/4028)) ([16b927a](https://github.com/rudderlabs/rudder-transformer/commit/16b927a97b64d3033e33a047429d0bbd15c7e1fd)) + + +### Bug Fixes + +* add phone e164 format validation for klaviyo ([#4025](https://github.com/rudderlabs/rudder-transformer/issues/4025)) ([ea46afe](https://github.com/rudderlabs/rudder-transformer/commit/ea46afef39bc85727a5258737987e4da1104ac3d)) + +### [1.89.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.89.0...v1.89.1) (2025-01-29) + + +### Bug Fixes + +* extend statuscode check to 502 to retry the request ([#4029](https://github.com/rudderlabs/rudder-transformer/issues/4029)) ([d003676](https://github.com/rudderlabs/rudder-transformer/commit/d00367691400402011d624c5b993d0f152191edd)) + +## [1.89.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.3...v1.89.0) (2025-01-27) + + +### Features + +* add DATA WAREHOUSE to integrations object in shopify pixel source ([#3980](https://github.com/rudderlabs/rudder-transformer/issues/3980)) ([3c20393](https://github.com/rudderlabs/rudder-transformer/commit/3c20393a0e4e3ec98d316820d187310bfec1faea)), closes [#3973](https://github.com/rudderlabs/rudder-transformer/issues/3973) [#3957](https://github.com/rudderlabs/rudder-transformer/issues/3957) [#3957](https://github.com/rudderlabs/rudder-transformer/issues/3957) +* add redis support in shopify pixel for id stitching ([#4001](https://github.com/rudderlabs/rudder-transformer/issues/4001)) ([23ad10a](https://github.com/rudderlabs/rudder-transformer/commit/23ad10a4bd470f09a75e9230d8c860b703a5a1f9)), closes [#3957](https://github.com/rudderlabs/rudder-transformer/issues/3957) +* add support for form format ([#4000](https://github.com/rudderlabs/rudder-transformer/issues/4000)) ([1fc15bf](https://github.com/rudderlabs/rudder-transformer/commit/1fc15bfd4b88e0b252c780a278376cea4c594057)) +* **http:** resolves bug fixes raised during testing ([#3991](https://github.com/rudderlabs/rudder-transformer/issues/3991)) ([a86f009](https://github.com/rudderlabs/rudder-transformer/commit/a86f0094cbef9428e7aeda4965b580f29c89f706)) + + +### Bug Fixes + +* add mappings to mp event ([#3997](https://github.com/rudderlabs/rudder-transformer/issues/3997)) ([2eab465](https://github.com/rudderlabs/rudder-transformer/commit/2eab46557743702a834597d0d0267a17e561516d)) +* sonar issues in adobe analytics ([#3999](https://github.com/rudderlabs/rudder-transformer/issues/3999)) ([d74c4ab](https://github.com/rudderlabs/rudder-transformer/commit/d74c4ab7ef582eb83d67c4b295aa5d3845c15166)) +* sonar issues in user transformations static lookup ([#3998](https://github.com/rudderlabs/rudder-transformer/issues/3998)) ([a7d6b8f](https://github.com/rudderlabs/rudder-transformer/commit/a7d6b8fca8681d2eb3bf1751bf7855a7cc220d3b)) +* sonar issues in various components ([#4006](https://github.com/rudderlabs/rudder-transformer/issues/4006)) ([454451d](https://github.com/rudderlabs/rudder-transformer/commit/454451dba3260a3664088e2bb009fd8a11cbf957)) + +### [1.88.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.2...v1.88.3) (2025-01-24) + + +### Bug Fixes + +* iterable device token registration api issues ([#4013](https://github.com/rudderlabs/rudder-transformer/issues/4013)) ([a986138](https://github.com/rudderlabs/rudder-transformer/commit/a986138d43d2cabcaa597b70fa7871b383cb1427)) + +### [1.88.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.1...v1.88.2) (2025-01-22) + + +### Bug Fixes + +* revert feat added drop traits in track call feature for mixpanel ([#4003](https://github.com/rudderlabs/rudder-transformer/issues/4003)) ([ba2accd](https://github.com/rudderlabs/rudder-transformer/commit/ba2accd14a9d99f2c55a9eab34f65e6e4d989e4a)) + +### [1.88.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.0...v1.88.1) (2025-01-21) + +## [1.88.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.87.1...v1.88.0) (2025-01-20) + + +### Features + +* add redis support in shopify pixel for id stitching ([#3957](https://github.com/rudderlabs/rudder-transformer/issues/3957)) ([165e06d](https://github.com/rudderlabs/rudder-transformer/commit/165e06de1ac22cda5c4db0b0b23e6e9972d5fa94)) +* added drop traits in track call feature for mixpanel ([#3986](https://github.com/rudderlabs/rudder-transformer/issues/3986)) ([6ec3d55](https://github.com/rudderlabs/rudder-transformer/commit/6ec3d552b845535965bc6c7b9990161a168b9a4e)) + + +### Bug Fixes + +* add email validation in HS ([#3972](https://github.com/rudderlabs/rudder-transformer/issues/3972)) ([1c45db8](https://github.com/rudderlabs/rudder-transformer/commit/1c45db8e6ec6b9436ef08eaa9dfcc99c8953397b)) +* fixing mismatch of schedule field value in clicksend destination ([#3975](https://github.com/rudderlabs/rudder-transformer/issues/3975)) ([12e8a52](https://github.com/rudderlabs/rudder-transformer/commit/12e8a528148454e2113c9c68b575d25695c1d55a)) +* refactor code and add validation for values ([#3971](https://github.com/rudderlabs/rudder-transformer/issues/3971)) ([fc09080](https://github.com/rudderlabs/rudder-transformer/commit/fc090806235f2599703098c9f3fc83c4bdf7d599)) +* removing device token from if condition in mixpanel destination ([#3982](https://github.com/rudderlabs/rudder-transformer/issues/3982)) ([b0e0b15](https://github.com/rudderlabs/rudder-transformer/commit/b0e0b15ee3cb7aeab0162c91fdcf98fca1e16722)) +* sonar issues in regex expressions ([#3979](https://github.com/rudderlabs/rudder-transformer/issues/3979)) ([0e0944d](https://github.com/rudderlabs/rudder-transformer/commit/0e0944d2372fa53b1a6db56fd382fc42c57e5068)) + +### [1.87.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.87.0...v1.87.1) (2025-01-06) + + +### Bug Fixes + +* added missing eu url in delete flow for amplitude destination ([#3952](https://github.com/rudderlabs/rudder-transformer/issues/3952)) ([ac673fc](https://github.com/rudderlabs/rudder-transformer/commit/ac673fc22094d5567691ceaf13adca15442ea896)) +* adding transformer proxy for iterable ([#3878](https://github.com/rudderlabs/rudder-transformer/issues/3878)) ([c47488d](https://github.com/rudderlabs/rudder-transformer/commit/c47488decf8e79b9a2e0277bd85a8e895ffecc56)), closes [#3918](https://github.com/rudderlabs/rudder-transformer/issues/3918) +* **airship:** resolved minor bugsnag error ([#3942](https://github.com/rudderlabs/rudder-transformer/issues/3942)) ([1d8532e](https://github.com/rudderlabs/rudder-transformer/commit/1d8532e743aad1e27efbe2975551ed174cf6ae6c)) +* property and event name mappings in shopify v2 ([#3941](https://github.com/rudderlabs/rudder-transformer/issues/3941)) ([0dedaa2](https://github.com/rudderlabs/rudder-transformer/commit/0dedaa2983b25ab529a5bc5b34ab70ebbf94fb3e)) +* use correct endpoint for custom events ([#3954](https://github.com/rudderlabs/rudder-transformer/issues/3954)) ([49eb591](https://github.com/rudderlabs/rudder-transformer/commit/49eb59180581b34252b601101ce2450e639c0850)) +* user order ([#3944](https://github.com/rudderlabs/rudder-transformer/issues/3944)) ([43abf9c](https://github.com/rudderlabs/rudder-transformer/commit/43abf9ca193a9d16a9eddc28cc6117beadd76b41)), closes [#3914](https://github.com/rudderlabs/rudder-transformer/issues/3914) + +## [1.87.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.86.0...v1.87.0) (2024-12-13) + + +### Features + +* onboard topsort destination ([#3913](https://github.com/rudderlabs/rudder-transformer/issues/3913)) ([227419f](https://github.com/rudderlabs/rudder-transformer/commit/227419f1ff618f96aafa849862828e2315e4ac55)) + + +### Bug Fixes + +* handling partial error in a batch for reddit destination ([#3935](https://github.com/rudderlabs/rudder-transformer/issues/3935)) ([d40db6c](https://github.com/rudderlabs/rudder-transformer/commit/d40db6c1e7f71c5ab5fc3a3659d1fc51b6d527fa)) + ## [1.86.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.85.1...v1.86.0) (2024-12-09) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f735f4f04b4..6a810cd0df5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ See the project's [README](README.md) for further information about working in t 1. Submit an [issue][issue] describing your proposed change. 2. We will try to respond to your issue promptly. 3. Fork this repo, develop and test your code changes. See the project's [README](README.md) for further information about working in this repository. -4. Submit a pull request against this repo's `main` branch. +4. Submit a pull request against this repo's `develop` branch. - Include instructions on how to test your changes. 5. Your branch may be merged once all configured checks pass, including: - A review from appropriate maintainers @@ -31,11 +31,37 @@ See the project's [README](README.md) for further information about working in t ### Are you developing a new Integration with us? 1. Fork this repo, develop and test your code changes. See the project's [README](README.md) for further information about working in this repository. -2. Submit a pull request against this repo's `main` branch. +2. Submit a pull request against this repo's `develop` branch. - Include instructions on how to test your changes. 3. Your branch may be merged once all configured checks pass, including: - A review from appropriate maintainers +### Test-Driven Development (Recommended) + +1. **Write Component Test Cases First:** + Before developing a new integration (whether for a source or destination), start by writing [component test cases](./test/integrations/). This approach ensures clarity on expected behavior and outcomes. + +2. **Use Skipped Tests for Context:** + Write your test cases with the `skip` option to prevent them from running initially. This allows reviewers to understand the business context and requirements before the actual integration is developed. Once the test cases are approved, proceed with the implementation. + +3. **Skipping Entire Test Files:** + To skip an entire test file, use the following syntax. See this [example](./test/integrations/destinations/examples/processor/data.ts): + ```ts + export const skip = true; + export const data = [...] + ``` + +4. **Skipping Individual Test Cases:** + To skip specific test cases within a file, use this syntax. See this [example](./test/integrations/destinations/examples/router/data.ts): + ```ts + export const data = [ + { + skip: true, + ... + } + ] + ``` + ## Committing We prefer squash or rebase commits so that all changes from a branch are diff --git a/Dockerfile b/Dockerfile index 9fe3c1cdb2c..21bc095bc5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1.4 -FROM node:18.20.1-alpine3.18 AS base +FROM node:20.18.3-alpine3.21 AS base ENV HUSKY 0 RUN apk update @@ -33,7 +33,7 @@ RUN npm run setup:swagger ENTRYPOINT ["/sbin/tini", "--"] HEALTHCHECK --interval=1s --timeout=30s --retries=30 \ -CMD wget --no-verbose --tries=5 --spider http://localhost:9090/health || exit 1 + CMD wget --no-verbose --tries=5 --spider http://localhost:9090/health || exit 1 CMD [ "npm", "start" ] @@ -72,7 +72,7 @@ COPY --chown=node:node --from=development /home/node/app/dist/ ./dist ENTRYPOINT ["/sbin/tini", "--"] HEALTHCHECK --interval=1s --timeout=30s --retries=30 \ -CMD wget --no-verbose --tries=5 --spider http://localhost:9090/health || exit 1 + CMD wget --no-verbose --tries=5 --spider http://localhost:9090/health || exit 1 CMD [ "npm", "start" ] diff --git a/Dockerfile-ut-func b/Dockerfile-ut-func index e6bd28857bb..a331a0c3a64 100644 --- a/Dockerfile-ut-func +++ b/Dockerfile-ut-func @@ -5,7 +5,7 @@ ENV HUSKY 0 RUN apt-get update \ && apt-get install -y curl make g++ \ && apt-get install -y cpio \ - && curl -sL https://deb.nodesource.com/setup_18.x | bash \ + && curl -sL https://deb.nodesource.com/setup_20.x | bash \ && apt-get install -y nodejs \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists.d/* \ diff --git a/benchmark/index.js b/benchmark/index.js deleted file mode 100644 index 919fa3c6de0..00000000000 --- a/benchmark/index.js +++ /dev/null @@ -1,193 +0,0 @@ -/* eslint-disable import/no-extraneous-dependencies */ -/* eslint-disable func-names */ -/* eslint-disable no-restricted-syntax */ -/* eslint-disable guard-for-in */ -/* eslint-disable no-await-in-loop */ -/* eslint-disable no-use-before-define */ -/* eslint-disable import/no-dynamic-require */ -/* eslint-disable global-require */ -const Benchmark = require('benchmark-suite'); -const fs = require('fs'); -const path = require('path'); -const Commander = require('commander'); -const logger = require('./metaLogger'); -const versionedRouter = require('../src/versionedRouter'); -const cdkV2Handler = require('../src/cdk/v2/handler'); - -const supportedDestinations = ['algolia', 'pinterest_tag']; - -logger.info(); - -const command = new Commander.Command(); -command - .allowUnknownOption() - .option( - '-d, --destinations ', - 'Enter destination names separated by comma', - supportedDestinations.toString(), - ) - .option( - '-bt, --benchmarktype ', - 'Enter the benchmark type (Operations or Memory)', - 'Operations', - ) - .option('-f, --feature ', 'Enter feature name (proc or rt)', 'proc') - .parse(); - -const getTestFileName = (intg, testSufix) => { - const featureSufix = cmdOpts.feature === 'rt' ? '_router' : ''; - return `${intg}${featureSufix}${testSufix}.json`; -}; - -const testDataDir = path.join(__dirname, '../test/__tests__/data'); -const getTestData = (intgList, fileNameSuffixes) => { - const intgTestData = {}; - intgList.forEach((intg) => { - // Use the last valid test data file - fileNameSuffixes.forEach((fileNameSuffix) => { - try { - intgTestData[intg] = JSON.parse( - fs.readFileSync(path.join(testDataDir, getTestFileName(intg, fileNameSuffix)), { - encoding: 'utf-8', - }), - ); - } catch (err) { - // logger.error( - // `Unable to load the data for: "${intg}" suffix: "${fileNameSuffix}"` - // ); - // logger.error(`Raw error: "${err}"`); - } - }); - }); - return intgTestData; -}; - -const cmdOpts = command.opts(); - -// Initialize data for destinations -const destinationsList = cmdOpts.destinations - .split(',') - .map((x) => x.trim()) - .filter((x) => x !== ''); -logger.info('Destinations:', destinationsList, 'feature:', cmdOpts.feature); -logger.info(); -const destDataset = getTestData(destinationsList, ['_input', '']); - -const nativeDestHandlers = {}; -const destCdKWorkflowEngines = {}; - -const benchmarkType = cmdOpts.benchmarktype.trim(); - -const getNativeHandleName = () => { - let handleName = 'process'; - if (cmdOpts.feature === 'rt') { - handleName = 'processRouterDest'; - } - return handleName; -}; - -async function initializeHandlers() { - for (const idx in destinationsList) { - const dest = destinationsList[idx]; - - // Native destination handler - nativeDestHandlers[dest] = versionedRouter.getDestHandler('v0', dest)[getNativeHandleName()]; - - // Get the CDK 2.0 workflow engine instance - destCdKWorkflowEngines[dest] = await cdkV2Handler.getWorkflowEngine(dest, cmdOpts.feature); - } -} - -async function runDataset(suitDesc, input, intg, params) { - logger.info('=========================================='); - logger.info(suitDesc); - logger.info('=========================================='); - - const results = {}; - const suite = new Benchmark(suitDesc, benchmarkType); - - Object.keys(params).forEach((opName) => { - const handler = params[opName].handlerResolver(intg); - const args = params[opName].argsResolver(intg, input); - suite.add(opName, async () => { - try { - await handler(...args); - } catch (err) { - // logger.info(err); - // Do nothing - } - }); - }); - - suite - .on('cycle', (result) => { - results[result.end.name] = { stats: result.end.stats }; - }) - .on('complete', (result) => { - logger.info( - benchmarkType === 'Operations' ? 'Fastest: ' : 'Memory intensive: ', - `"${result.end.name}"`, - ); - logger.info(); - Object.keys(results).forEach((impl) => { - logger.info(`"${impl}" - `, suite.formatStats(results[impl].stats)); - - if (result.end.name !== impl) { - if (benchmarkType === 'Operations') { - logger.info( - `-> "${result.end.name}" is faster by ${( - results[impl].stats.mean / result.end.stats.mean - ).toFixed(1)} times to "${impl}"`, - ); - } else { - logger.info( - `-> "${result.end.name}" consumed ${( - result.end.stats.mean / results[impl].stats.mean - ).toFixed(1)} times memory compared to "${impl}"`, - ); - } - } - - logger.info(); - }); - }); - - await suite.run({ time: 1000 }); -} - -async function runIntgDataset(dataset, type, params) { - for (const intg in dataset) { - for (const tc in dataset[intg]) { - const curTcData = dataset[intg][tc]; - let tcInput = curTcData; - let tcDesc = `${type} - ${intg} - ${cmdOpts.feature} - ${tc}`; - // New test data file structure - if ('description' in curTcData && 'input' in curTcData && 'output' in curTcData) { - tcInput = curTcData.input; - tcDesc += ` - "${curTcData.description}"`; - } - - await runDataset(tcDesc, tcInput, intg, params); - } - } -} - -async function run() { - // Initialize CDK and native handlers - await initializeHandlers(); - - // Destinations - await runIntgDataset(destDataset, 'Destination', { - native: { - handlerResolver: (intg) => nativeDestHandlers[intg], - argsResolver: (_intg, input) => [input], - }, - 'CDK 2.0': { - handlerResolver: () => cdkV2Handler.process, - argsResolver: (intg, input) => [destCdKWorkflowEngines[intg], input], - }, - }); -} - -// Start suites -run(); diff --git a/benchmark/metaLogger.js b/benchmark/metaLogger.js deleted file mode 100644 index b89ad71066d..00000000000 --- a/benchmark/metaLogger.js +++ /dev/null @@ -1,36 +0,0 @@ -/* istanbul ignore file */ - -const logger = require('../src/logger'); - -logger.setLogLevel('random'); - -const debug = (...args) => { - logger.setLogLevel('debug'); - logger.debug(...args); - logger.setLogLevel('random'); -}; - -const info = (...args) => { - logger.setLogLevel('info'); - logger.info(...args); - logger.setLogLevel('random'); -}; - -const warn = (...args) => { - logger.setLogLevel('warn'); - logger.warn(...args); - logger.setLogLevel('random'); -}; - -const error = (...args) => { - logger.setLogLevel('error'); - logger.error(...args); - logger.setLogLevel('random'); -}; - -module.exports = { - debug, - info, - warn, - error, -}; diff --git a/jest.config.js b/jest.config.js index f126aee9ca9..07ba4bfaa53 100644 --- a/jest.config.js +++ b/jest.config.js @@ -79,7 +79,11 @@ module.exports = { // moduleNameMapper: {}, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader - modulePathIgnorePatterns: ['/test/__mocks__/axios.js'], + modulePathIgnorePatterns: [ + '/test/__mocks__/axios.js', + '/dist/', + '/dist-test/', + ], // Activates notifications for test results notify: true, diff --git a/jest.config.typescript.js b/jest.config.typescript.js index 7350f1e19d1..64e07de0da6 100644 --- a/jest.config.typescript.js +++ b/jest.config.typescript.js @@ -78,7 +78,11 @@ module.exports = { // moduleNameMapper: {}, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader - modulePathIgnorePatterns: ['/test/__mocks__/axios.js'], + modulePathIgnorePatterns: [ + '/test/__mocks__/axios.js', + '/dist/', + '/dist-test/', + ], // Activates notifications for test results notify: true, @@ -128,7 +132,7 @@ module.exports = { // snapshotSerializers: [], // The test environment that will be used for testing - testEnvironment: 'node', + testEnvironment: 'allure-jest/node', // Options that will be passed to the testEnvironment // testEnvironmentOptions: {}, diff --git a/jest.default.config.js b/jest.default.config.js index d1b5390b9e7..8661387a772 100644 --- a/jest.default.config.js +++ b/jest.default.config.js @@ -79,7 +79,7 @@ module.exports = { // moduleNameMapper: {}, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader - // modulePathIgnorePatterns: [], + modulePathIgnorePatterns: ['/dist/', '/dist-test/'], // Activates notifications for test results notify: true, diff --git a/package-lock.json b/package-lock.json index 90f35d6d560..b1685935655 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.86.0", + "version": "1.94.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.86.0", + "version": "1.94.0", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", @@ -15,23 +15,24 @@ "@aws-sdk/credential-providers": "^3.391.0", "@aws-sdk/lib-storage": "^3.637.0", "@bugsnag/js": "^7.20.2", - "@datadog/pprof": "^3.1.0", + "@datadog/pprof": "^5.5.1", "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.13", - "@rudderstack/json-template-engine": "^0.18.0", + "@rudderstack/integrations-lib": "^0.2.25", + "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", - "ajv": "^8.12.0", + "ajv": "^8.17.1", "ajv-draft-04": "^1.0.0", "ajv-formats": "^2.1.1", "amazon-dsp-formatter": "^1.0.2", - "axios": "^1.7.3", + "axios": "^1.7.9", "btoa": "^1.2.1", "component-each": "^0.2.6", "crypto-js": "^4.2.0", "dotenv": "^16.0.3", + "fast-xml-parser": "^4.5.1", "flat": "^5.0.2", "form-data": "^4.0.0", "get-value": "^3.0.1", @@ -41,22 +42,21 @@ "ioredis": "^5.3.2", "is": "^3.3.0", "is-ip": "^3.1.0", - "isolated-vm": "4.5.0", + "isolated-vm": "5.0.3", "js-sha1": "^0.6.0", "json-diff": "^1.0.3", "json-size": "^1.0.0", "jsontoxml": "^1.0.1", - "jstoxml": "^5.0.2", - "koa": "^2.15.3", + "koa": "^2.15.4", "koa-bodyparser": "^4.4.0", "koa2-swagger-ui": "^5.7.0", - "libphonenumber-js": "^1.11.12", + "libphonenumber-js": "^1.11.18", "lodash": "^4.17.21", "match-json": "^1.3.5", "md5": "^2.3.0", "modclean": "^3.0.0-beta.1", "moment": "^2.29.4", - "moment-timezone": "^0.5.43", + "moment-timezone": "^0.5.47", "node-cache": "^5.1.2", "node-fetch": "^2.6.12", "oauth-1.0a": "^2.2.6", @@ -69,12 +69,12 @@ "sha256": "^0.2.0", "sqlstring": "^2.3.3", "stacktrace-parser": "^0.1.10", - "statsd-client": "^0.4.7", "truncate-utf8-bytes": "^1.0.2", "ua-parser-js": "^1.0.37", "unset-value": "^2.0.1", "uuid": "^9.0.1", "valid-url": "^1.0.9", + "validator": "^13.12.0", "zod": "^3.22.4" }, "devDependencies": { @@ -90,6 +90,7 @@ "@types/supertest": "^6.0.2", "@typescript-eslint/eslint-plugin": "^5.61.0", "@typescript-eslint/parser": "^5.59.2", + "allure-jest": "^3.0.7", "axios-mock-adapter": "^1.22.0", "benchmark-suite": "^0.1.8", "commander": "^10.0.1", @@ -109,6 +110,8 @@ "http-terminator": "^3.2.0", "husky": "^9.1.6", "jest": "^29.5.0", + "jest-diff": "^29.7.0", + "jest-environment-node": "^29.7.0", "jest-sonar": "^0.2.16", "jest-when": "^3.5.2", "lint-staged": "^13.2.2", @@ -124,64 +127,51 @@ "typescript": "^5.0.4" } }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@amplitude/ua-parser-js": { "version": "0.7.24", + "resolved": "https://registry.npmjs.org/@amplitude/ua-parser-js/-/ua-parser-js-0.7.24.tgz", + "integrity": "sha512-VbQuJymJ20WEw0HtI2np7EdC3NJGUWi8+Xdbc7uk8WfMIF308T0howpzkQ3JFMN7ejnrcSM/OyNGveeE3TP3TA==", "license": "MIT", "engines": { "node": "*" } }, "node_modules/@ampproject/remapping": { - "version": "2.2.1", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@apidevtools/json-schema-ref-parser": { - "version": "9.0.6", + "version": "11.7.2", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.7.2.tgz", + "integrity": "sha512-4gY54eEGEstClvEkGnwVkTkrx0sqwemEFG5OSRRn3tD91XH0+Q8XIkYIfo7IwEWPpJZwILb9GUXeShtplRc/eA==", "dev": true, "license": "MIT", "dependencies": { "@jsdevtools/ono": "^7.1.3", - "call-me-maybe": "^1.0.1", - "js-yaml": "^3.13.1" - } - }, - "node_modules/@apidevtools/json-schema-ref-parser/node_modules/argparse": { - "version": "1.0.10", - "dev": true, - "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml": { - "version": "3.14.1", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "@types/json-schema": "^7.0.15", + "js-yaml": "^4.1.0" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/philsturgeon" } }, "node_modules/@apidevtools/openapi-schemas": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", + "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==", "dev": true, "license": "MIT", "engines": { @@ -190,6 +180,9 @@ }, "node_modules/@apidevtools/swagger-cli": { "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-cli/-/swagger-cli-4.0.4.tgz", + "integrity": "sha512-hdDT3B6GLVovCsRZYDi3+wMcB1HfetTU20l2DC8zD3iFRNMC6QNAZG5fo/6PYeHWBEv7ri4MvnlKodhNB0nt7g==", + "deprecated": "This package has been abandoned. Please switch to using the actively maintained @redocly/cli", "dev": true, "license": "MIT", "dependencies": { @@ -207,6 +200,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -221,6 +216,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/argparse": { "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "license": "MIT", "dependencies": { @@ -229,6 +226,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/camelcase": { "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "license": "MIT", "engines": { @@ -237,6 +236,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -252,6 +253,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/cliui": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, "license": "ISC", "dependencies": { @@ -262,6 +265,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -273,11 +278,15 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/@apidevtools/swagger-cli/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -290,6 +299,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -298,6 +309,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/js-yaml": { "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "license": "MIT", "dependencies": { @@ -310,6 +323,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -321,6 +336,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -335,6 +352,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -346,6 +365,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -357,6 +378,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/wrap-ansi": { "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "license": "MIT", "dependencies": { @@ -370,11 +393,15 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/y18n": { "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "dev": true, "license": "ISC" }, "node_modules/@apidevtools/swagger-cli/node_modules/yargs": { "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, "license": "MIT", "dependencies": { @@ -396,6 +423,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/yargs-parser": { "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "license": "ISC", "dependencies": { @@ -408,21 +437,25 @@ }, "node_modules/@apidevtools/swagger-methods": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz", + "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==", "dev": true, "license": "MIT" }, "node_modules/@apidevtools/swagger-parser": { - "version": "10.1.0", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.1.1.tgz", + "integrity": "sha512-u/kozRnsPO/x8QtKYJOqoGtC4kH6yg1lfYkB9Au0WhYB0FNLpyFusttQtvhlwjtG3rOwiRz4D8DnnXa8iEpIKA==", "dev": true, "license": "MIT", "dependencies": { - "@apidevtools/json-schema-ref-parser": "9.0.6", + "@apidevtools/json-schema-ref-parser": "11.7.2", "@apidevtools/openapi-schemas": "^2.1.0", "@apidevtools/swagger-methods": "^3.0.2", "@jsdevtools/ono": "^7.1.3", - "ajv": "^8.6.3", + "ajv": "^8.17.1", "ajv-draft-04": "^1.0.0", - "call-me-maybe": "^1.0.1" + "call-me-maybe": "^1.0.2" }, "peerDependencies": { "openapi-types": ">=7" @@ -430,20 +463,22 @@ }, "node_modules/@aws-crypto/crc32": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-5.2.0.tgz", + "integrity": "sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", - "tslib": "^1.11.1" + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" } }, - "node_modules/@aws-crypto/crc32/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, "node_modules/@aws-crypto/crc32c": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32c/-/crc32c-5.2.0.tgz", + "integrity": "sha512-+iWb8qaHLYKrNvGRbiYRHSdKRWhto5XlZUEBwDjYNf+ly5SVYG6zEoYIdxvf5R3zyeP16w4PLBn3rH1xc74Rag==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/util": "^5.2.0", @@ -453,6 +488,8 @@ }, "node_modules/@aws-crypto/sha1-browser": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha1-browser/-/sha1-browser-5.2.0.tgz", + "integrity": "sha512-OH6lveCFfcDjX4dbAvCFSYUjJZjDr/3XJ3xHtjn3Oj5b9RjojQo8npoLeA/bNwkOkrSQ0wgrHzXk4tDRxGKJeg==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/supports-web-crypto": "^5.2.0", @@ -463,4569 +500,1682 @@ "tslib": "^2.6.2" } }, - "node_modules/@aws-crypto/sha256-browser": { - "version": "5.2.0", + "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-js": "^5.2.0", - "@aws-crypto/supports-web-crypto": "^5.2.0", - "@aws-crypto/util": "^5.2.0", - "@aws-sdk/types": "^3.222.0", - "@aws-sdk/util-locate-window": "^3.0.0", - "@smithy/util-utf8": "^2.0.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@aws-crypto/sha256-js": { - "version": "5.2.0", + "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/util": "^5.2.0", - "@aws-sdk/types": "^3.222.0", + "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-crypto/supports-web-crypto": { - "version": "5.2.0", + "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", "license": "Apache-2.0", "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@aws-crypto/util": { + "node_modules/@aws-crypto/sha256-browser": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-5.2.0.tgz", + "integrity": "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==", "license": "Apache-2.0", "dependencies": { + "@aws-crypto/sha256-js": "^5.2.0", + "@aws-crypto/supports-web-crypto": "^5.2.0", + "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.6.2" } }, - "node_modules/@aws-sdk/client-cognito-identity": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.650.0.tgz", - "integrity": "sha512-ng9Ta7emTgIAnUW52wi2KcNbAudGQPiXuPKJwtw67WQei3gHMpxvgCCRXP7AiB+LyB/fBURxraDkO5N+sPZp0w==", + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.650.0", - "@aws-sdk/client-sts": "3.650.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.650.0.tgz", - "integrity": "sha512-6J7IS0f8ovhvbIAZaynOYP+jPX8344UlTjwHxjaXHgFvI8axu3+NslKtEEV5oHLhgzDvrKbinsu5lgE2n4Sqng==", + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", + "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.650.0" + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/client-sts": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.650.0.tgz", - "integrity": "sha512-ISK0ZQYA7O5/WYgslpWy956lUBudGC9d7eL0FFbiL0j50N80Gx3RUv22ezvZgxJWE0W3DqNr4CE19sPYn4Lw8g==", + "node_modules/@aws-crypto/sha256-js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-5.2.0.tgz", + "integrity": "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.650.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.649.0.tgz", - "integrity": "sha512-IY43r256LhKAvdEVQO/FPdUyVpcZS5EVxh/WHVdNzuN1bNLoUK2rIzuZqVA0EGguvCxoXVmQv9m50GvG7cGktg==", + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-5.2.0.tgz", + "integrity": "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "bowser": "^2.11.0", "tslib": "^2.6.2" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.649.0.tgz", - "integrity": "sha512-x5DiLpZDG/AJmCIBnE3Xhpwy35QIo3WqNiOpw6ExVs1NydbM/e90zFPSfhME0FM66D/WorigvluBxxwjxDm/GA==", + "node_modules/@aws-crypto/util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", + "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", + "node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", "license": "Apache-2.0", "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", + "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", + "node_modules/@aws-sdk/client-cognito-identity": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.758.0.tgz", + "integrity": "sha512-8bOXVYtf/0OUN0jXTIHLv3V0TAS6kvvCRAy7nmiL/fDde0O+ChW1WZU7CVPAOtFEpFCdKskDcxFspM7m1k6qyg==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-node": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@aws-sdk/client-personalize": { - "version": "3.642.0", + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-personalize/-/client-personalize-3.758.0.tgz", + "integrity": "sha512-DHySS2YZD3NK6dd1lA6L0y/3Ktkygls3Lk6htCI0MvjZo3BsNmL8iS2lfj5kn1CP53QkN+6658hqvTsjSbywSg==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.637.0", - "@aws-sdk/client-sts": "3.637.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/credential-provider-node": "3.637.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-node": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/client-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.637.0.tgz", - "integrity": "sha512-+KjLvgX5yJYROWo3TQuwBJlHCY0zz9PsLuEolmXQn0BVK1L/m9GteZHtd+rEdAoDGBpE0Xqjy1oz5+SmtsaRUw==", + "node_modules/@aws-sdk/client-s3": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.758.0.tgz", + "integrity": "sha512-f8SlhU9/93OC/WEI6xVJf/x/GoQFj9a/xXK6QCtr5fvCjfSLgMVFmKTiIl/tgtDRzxUDc8YS6EGtbHjJ3Y/atg==", + "license": "Apache-2.0", "dependencies": { + "@aws-crypto/sha1-browser": "5.2.0", "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-node": "3.758.0", + "@aws-sdk/middleware-bucket-endpoint": "3.734.0", + "@aws-sdk/middleware-expect-continue": "3.734.0", + "@aws-sdk/middleware-flexible-checksums": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-location-constraint": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-sdk-s3": "3.758.0", + "@aws-sdk/middleware-ssec": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/signature-v4-multi-region": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@aws-sdk/xml-builder": "3.734.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/eventstream-serde-browser": "^4.0.1", + "@smithy/eventstream-serde-config-resolver": "^4.0.1", + "@smithy/eventstream-serde-node": "^4.0.1", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-blob-browser": "^4.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/hash-stream-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/md5-js": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", + "@smithy/util-waiter": "^4.0.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/core": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.635.0.tgz", - "integrity": "sha512-i1x/E/sgA+liUE1XJ7rj1dhyXpAKO1UKFUcTTHXok2ARjWTvszHnSXMOsB77aPbmn0fUp1JTx2kHUAZ1LVt5Bg==", + "node_modules/@aws-sdk/client-sso": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.758.0.tgz", + "integrity": "sha512-BoGO6IIWrLyLxQG6txJw6RT2urmbtlwfggapNCrNPyYjlXpzTSJhBYjndg7TpDATFd0SXL0zm8y/tXsUXNkdYQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-middleware": "^3.0.3", - "fast-xml-parser": "4.4.1", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.620.1.tgz", - "integrity": "sha512-ExuILJ2qLW5ZO+rgkNRj0xiAipKT16Rk77buvPP8csR7kkCflT/gXTyzRe/uzIiETTxM7tr8xuO9MP/DQXqkfg==", + "node_modules/@aws-sdk/core": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.758.0.tgz", + "integrity": "sha512-0RswbdR9jt/XKemaLNuxi2gGr4xGlHyGxkTdhSQzCyUe9A9OPCoLl3rIESRguQEech+oJnbHk/wuiwHqTuP9sg==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.635.0.tgz", - "integrity": "sha512-iJyRgEjOCQlBMXqtwPLIKYc7Bsc6nqjrZybdMDenPDa+kmLg7xh8LxHsu9088e+2/wtLicE34FsJJIfzu3L82g==", + "node_modules/@aws-sdk/core/node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "license": "MIT", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-stream": "^3.1.3", - "tslib": "^2.6.2" + "strnum": "^1.0.5" }, - "engines": { - "node": ">=16.0.0" + "bin": { + "fxparser": "src/cli/cli.js" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.637.0.tgz", - "integrity": "sha512-h+PFCWfZ0Q3Dx84SppET/TFpcQHmxFW8/oV9ArEvMilw4EBN+IlxgbL0CnHwjHW64szcmrM0mbebjEfHf4FXmw==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.637.0" - } - }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.637.0.tgz", - "integrity": "sha512-yoEhoxJJfs7sPVQ6Is939BDQJZpZCoUgKr/ySse4YKOZ24t4VqgHA6+wV7rYh+7IW24Rd91UTvEzSuHYTlxlNA==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-ini": "3.637.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "node_modules/@aws-sdk/credential-provider-cognito-identity": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.758.0.tgz", + "integrity": "sha512-y/rHZqyChlEkNRr59gn4hv0gjhJwGmdCdW0JI1K9p3P9p7EurWGjr2M6+goTn3ilOlcAwrl5oFKR5jLt27TkOA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-cognito-identity": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.620.1.tgz", - "integrity": "sha512-hWqFMidqLAkaV9G460+1at6qa9vySbjQKKc04p59OT7lZ5cO5VH5S4aI05e+m4j364MBROjjk2ugNvfNf/8ILg==", + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.758.0.tgz", + "integrity": "sha512-N27eFoRrO6MeUNumtNHDW9WOiwfd59LPXPqDrIa3kWL/s+fOKFHb9xIcF++bAwtcZnAxKkgpDCUP+INNZskE+w==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.637.0.tgz", - "integrity": "sha512-Mvz+h+e62/tl+dVikLafhv+qkZJ9RUb8l2YN/LeKMWkxQylPT83CPk9aimVhCV89zth1zpREArl97+3xsfgQvA==", + "node_modules/@aws-sdk/credential-provider-http": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.758.0.tgz", + "integrity": "sha512-Xt9/U8qUCiw1hihztWkNeIR+arg6P+yda10OuCHX6kFVx3auTlU7+hCqs3UxqniGU4dguHuftf3mRpi5/GJ33Q==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-sso": "3.637.0", - "@aws-sdk/token-providers": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.621.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.621.0.tgz", - "integrity": "sha512-w7ASSyfNvcx7+bYGep3VBgC3K6vEdLmlpjT7nSIHxxQf+WSdvy+HynwJosrpZax0sK5q0D1Jpn/5q+r5lwwW6w==", + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.758.0.tgz", + "integrity": "sha512-cymSKMcP5d+OsgetoIZ5QCe1wnp2Q/tq+uIxVdh9MbfdBBEnl9Ecq6dH6VlYS89sp4QKuxHxkWXVnbXU3Q19Aw==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-env": "3.758.0", + "@aws-sdk/credential-provider-http": "3.758.0", + "@aws-sdk/credential-provider-process": "3.758.0", + "@aws-sdk/credential-provider-sso": "3.758.0", + "@aws-sdk/credential-provider-web-identity": "3.758.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.621.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.620.0.tgz", - "integrity": "sha512-VMtPEZwqYrII/oUkffYsNWY9PZ9xpNJpMgmyU0rlDQ25O1c0Hk3fJmZRe6pEkAJ0omD7kLrqGl1DUjQVxpd/Rg==", + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.758.0.tgz", + "integrity": "sha512-+DaMv63wiq7pJrhIQzZYMn4hSarKiizDoJRvyR7WGhnn0oQ/getX9Z0VNCV3i7lIFoLNTb7WMmQ9k7+z/uD5EQ==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", + "@aws-sdk/credential-provider-env": "3.758.0", + "@aws-sdk/credential-provider-http": "3.758.0", + "@aws-sdk/credential-provider-ini": "3.758.0", + "@aws-sdk/credential-provider-process": "3.758.0", + "@aws-sdk/credential-provider-sso": "3.758.0", + "@aws-sdk/credential-provider-web-identity": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/middleware-logger": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.609.0.tgz", - "integrity": "sha512-S62U2dy4jMDhDFDK5gZ4VxFdWzCtLzwbYyFZx2uvPYTECkepLUfzLic2BHg2Qvtu4QjX+oGE3P/7fwaGIsGNuQ==", + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.758.0.tgz", + "integrity": "sha512-AzcY74QTPqcbXWVgjpPZ3HOmxQZYPROIBz2YINF0OQk0MhezDWV/O7Xec+K1+MPGQO3qS6EDrUUlnPLjsqieHA==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.620.0.tgz", - "integrity": "sha512-nh91S7aGK3e/o1ck64sA/CyoFw+gAYj2BDOnoNa6ouyCrVJED96ZXWbhye/fz9SgmNUZR2g7GdVpiLpMKZoI5w==", + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.758.0.tgz", + "integrity": "sha512-x0FYJqcOLUCv8GLLFDYMXRAQKGjoM+L0BG4BiHYZRDf24yQWFCAZsCQAYKo6XZYh2qznbsW6f//qpyJ5b0QVKQ==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", + "@aws-sdk/client-sso": "3.758.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/token-providers": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.637.0.tgz", - "integrity": "sha512-EYo0NE9/da/OY8STDsK2LvM4kNa79DBsf4YVtaG4P5pZ615IeFsD8xOHZeuJmUrSMlVQ8ywPRX7WMucUybsKug==", + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.758.0.tgz", + "integrity": "sha512-XGguXhBqiCXMXRxcfCAVPlMbm3VyJTou79r/3mxWddHWF0XbhaQiBIbUz6vobVTD25YQRbWSmSch7VA8kI5Lrw==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.614.0.tgz", - "integrity": "sha512-vDCeMXvic/LU0KFIUjpC3RiSTIkkvESsEfbVHiHH0YINfl8HnEqR5rj+L8+phsCeVg2+LmYwYxd5NRz4PHxt5g==", + "node_modules/@aws-sdk/credential-providers": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.758.0.tgz", + "integrity": "sha512-BaGVBdm9ynsErIc/mLuUwJ1OQcL/pkhCuAm24jpsif3evZ5wgyZnEAZB2yRin+mQnQaQT3L+KvTbdKGfjL8+fQ==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/types": "^3.3.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", + "@aws-sdk/client-cognito-identity": "3.758.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-cognito-identity": "3.758.0", + "@aws-sdk/credential-provider-env": "3.758.0", + "@aws-sdk/credential-provider-http": "3.758.0", + "@aws-sdk/credential-provider-ini": "3.758.0", + "@aws-sdk/credential-provider-node": "3.758.0", + "@aws-sdk/credential-provider-process": "3.758.0", + "@aws-sdk/credential-provider-sso": "3.758.0", + "@aws-sdk/credential-provider-web-identity": "3.758.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/token-providers": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.614.0.tgz", - "integrity": "sha512-okItqyY6L9IHdxqs+Z116y5/nda7rHxLvROxtAJdLavWTYDydxrZstImNgGWTeVdmc0xX2gJCI77UYUTQWnhRw==", + "node_modules/@aws-sdk/lib-storage": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/lib-storage/-/lib-storage-3.758.0.tgz", + "integrity": "sha512-g07y7rA505zaTJNPTmvW4zYJA3gThFDE1be7kBUKhTKAdwv8jVSbOiAy2AhClXs2evSUoQiFFtD1xWxLRXPPRQ==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@smithy/abort-controller": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/smithy-client": "^4.1.6", + "buffer": "5.6.0", + "events": "3.3.0", + "stream-browserify": "3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.614.0" + "@aws-sdk/client-s3": "^3.758.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", + "node_modules/@aws-sdk/middleware-bucket-endpoint": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.734.0.tgz", + "integrity": "sha512-etC7G18aF7KdZguW27GE/wpbrNmYLVT755EsFc8kXpZj8D6AFKxc7OuveinJmiy0bYXAMspJUWsF6CrGpOw6CQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.3.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-arn-parser": "3.723.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/util-endpoints": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.637.0.tgz", - "integrity": "sha512-pAqOKUHeVWHEXXDIp/qoMk/6jyxIb6GGjnK1/f8dKHtKIEs4tKsnnL563gceEvdad53OPXIt86uoevCcCzmBnw==", + "node_modules/@aws-sdk/middleware-expect-continue": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.734.0.tgz", + "integrity": "sha512-P38/v1l6HjuB2aFUewt7ueAW5IvKkFcv5dalPtbMGRhLeyivBOHwbCyuRKgVs7z7ClTpu9EaViEGki2jEQqEsQ==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "@smithy/util-endpoints": "^2.0.5", + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", + "node_modules/@aws-sdk/middleware-flexible-checksums": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.758.0.tgz", + "integrity": "sha512-o8Rk71S08YTKLoSobucjnbj97OCGaXgpEDNKXpXaavUM5xLNoHCLSUPRCiEN86Ivqxg1n17Y2nSRhfbsveOXXA==", + "license": "Apache-2.0", "dependencies": { + "@aws-crypto/crc32": "5.2.0", + "@aws-crypto/crc32c": "5.2.0", + "@aws-crypto/util": "5.2.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.734.0.tgz", + "integrity": "sha512-LW7RRgSOHHBzWZnigNsDIzu3AiwtjeI2X66v+Wn1P1u+eXssy1+up4ZY/h+t2sU4LU36UvEf+jrZti9c6vRnFw==", + "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-s3": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.637.0.tgz", - "integrity": "sha512-y6UC94fsMvhKbf0dzfnjVP1HePeGjplfcYfilZU1COIJLyTkMcUv4XcT4I407CGIrvgEafONHkiC09ygqUauNA==", + "node_modules/@aws-sdk/middleware-location-constraint": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.734.0.tgz", + "integrity": "sha512-EJEIXwCQhto/cBfHdm3ZOeLxd2NlJD+X2F+ZTOxzokuhBtY0IONfC/91hOo5tWQweerojwshSMHRCKzRv1tlwg==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha1-browser": "5.2.0", - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.637.0", - "@aws-sdk/client-sts": "3.637.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/credential-provider-node": "3.637.0", - "@aws-sdk/middleware-bucket-endpoint": "3.620.0", - "@aws-sdk/middleware-expect-continue": "3.620.0", - "@aws-sdk/middleware-flexible-checksums": "3.620.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-location-constraint": "3.609.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-sdk-s3": "3.635.0", - "@aws-sdk/middleware-ssec": "3.609.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/signature-v4-multi-region": "3.635.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@aws-sdk/xml-builder": "3.609.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/eventstream-serde-browser": "^3.0.6", - "@smithy/eventstream-serde-config-resolver": "^3.0.3", - "@smithy/eventstream-serde-node": "^3.0.5", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-blob-browser": "^3.1.2", - "@smithy/hash-node": "^3.0.3", - "@smithy/hash-stream-node": "^3.1.2", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/md5-js": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-stream": "^3.1.3", - "@smithy/util-utf8": "^3.0.0", - "@smithy/util-waiter": "^3.1.2", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/client-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.637.0.tgz", - "integrity": "sha512-+KjLvgX5yJYROWo3TQuwBJlHCY0zz9PsLuEolmXQn0BVK1L/m9GteZHtd+rEdAoDGBpE0Xqjy1oz5+SmtsaRUw==", + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.734.0.tgz", + "integrity": "sha512-mUMFITpJUW3LcKvFok176eI5zXAUomVtahb9IQBwLzkqFYOrMJvWAvoV4yuxrJ8TlQBG8gyEnkb9SnhZvjg67w==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.635.0.tgz", - "integrity": "sha512-i1x/E/sgA+liUE1XJ7rj1dhyXpAKO1UKFUcTTHXok2ARjWTvszHnSXMOsB77aPbmn0fUp1JTx2kHUAZ1LVt5Bg==", + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.734.0.tgz", + "integrity": "sha512-CUat2d9ITsFc2XsmeiRQO96iWpxSKYFjxvj27Hc7vo87YUHRnfMfnc8jw1EpxEwMcvBD7LsRa6vDNky6AjcrFA==", "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-middleware": "^3.0.3", - "fast-xml-parser": "4.4.1", + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.620.1.tgz", - "integrity": "sha512-ExuILJ2qLW5ZO+rgkNRj0xiAipKT16Rk77buvPP8csR7kkCflT/gXTyzRe/uzIiETTxM7tr8xuO9MP/DQXqkfg==", + "node_modules/@aws-sdk/middleware-sdk-s3": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.758.0.tgz", + "integrity": "sha512-6mJ2zyyHPYSV6bAcaFpsdoXZJeQlR1QgBnZZ6juY/+dcYiuyWCdyLUbGzSZSE7GTfx6i+9+QWFeoIMlWKgU63A==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-arn-parser": "3.723.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.635.0.tgz", - "integrity": "sha512-iJyRgEjOCQlBMXqtwPLIKYc7Bsc6nqjrZybdMDenPDa+kmLg7xh8LxHsu9088e+2/wtLicE34FsJJIfzu3L82g==", + "node_modules/@aws-sdk/middleware-ssec": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.734.0.tgz", + "integrity": "sha512-d4yd1RrPW/sspEXizq2NSOUivnheac6LPeLSLnaeTbBG9g1KqIqvCzP1TfXEqv2CrWfHEsWtJpX7oyjySSPvDQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-stream": "^3.1.3", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.637.0.tgz", - "integrity": "sha512-h+PFCWfZ0Q3Dx84SppET/TFpcQHmxFW8/oV9ArEvMilw4EBN+IlxgbL0CnHwjHW64szcmrM0mbebjEfHf4FXmw==", + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.758.0.tgz", + "integrity": "sha512-iNyehQXtQlj69JCgfaOssgZD4HeYGOwxcaKeG6F+40cwBjTAi0+Ph1yfDwqk2qiBPIRWJ/9l2LodZbxiBqgrwg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@smithy/core": "^3.1.5", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.637.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.637.0.tgz", - "integrity": "sha512-yoEhoxJJfs7sPVQ6Is939BDQJZpZCoUgKr/ySse4YKOZ24t4VqgHA6+wV7rYh+7IW24Rd91UTvEzSuHYTlxlNA==", + "node_modules/@aws-sdk/nested-clients": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.758.0.tgz", + "integrity": "sha512-YZ5s7PSvyF3Mt2h1EQulCG93uybprNGbBkPmVuy/HMMfbFTt4iL3SbKjxqvOZelm86epFfj7pvK7FliI2WOEcg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-ini": "3.637.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.620.1.tgz", - "integrity": "sha512-hWqFMidqLAkaV9G460+1at6qa9vySbjQKKc04p59OT7lZ5cO5VH5S4aI05e+m4j364MBROjjk2ugNvfNf/8ILg==", + "node_modules/@aws-sdk/region-config-resolver": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.734.0.tgz", + "integrity": "sha512-Lvj1kPRC5IuJBr9DyJ9T9/plkh+EfKLy+12s/mykOy1JaKHDpvj+XGy2YO6YgYVOb8JFtaqloid+5COtje4JTQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.637.0.tgz", - "integrity": "sha512-Mvz+h+e62/tl+dVikLafhv+qkZJ9RUb8l2YN/LeKMWkxQylPT83CPk9aimVhCV89zth1zpREArl97+3xsfgQvA==", + "node_modules/@aws-sdk/signature-v4-multi-region": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.758.0.tgz", + "integrity": "sha512-0RPCo8fYJcrenJ6bRtiUbFOSgQ1CX/GpvwtLU2Fam1tS9h2klKK8d74caeV6A1mIUvBU7bhyQ0wMGlwMtn3EYw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-sso": "3.637.0", - "@aws-sdk/token-providers": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/middleware-sdk-s3": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.621.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.621.0.tgz", - "integrity": "sha512-w7ASSyfNvcx7+bYGep3VBgC3K6vEdLmlpjT7nSIHxxQf+WSdvy+HynwJosrpZax0sK5q0D1Jpn/5q+r5lwwW6w==", + "node_modules/@aws-sdk/token-providers": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.758.0.tgz", + "integrity": "sha512-ckptN1tNrIfQUaGWm/ayW1ddG+imbKN7HHhjFdS4VfItsP0QQOB0+Ov+tpgb4MoNR4JaUghMIVStjIeHN2ks1w==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.621.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.620.0.tgz", - "integrity": "sha512-VMtPEZwqYrII/oUkffYsNWY9PZ9xpNJpMgmyU0rlDQ25O1c0Hk3fJmZRe6pEkAJ0omD7kLrqGl1DUjQVxpd/Rg==", + "node_modules/@aws-sdk/types": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.734.0.tgz", + "integrity": "sha512-o11tSPTT70nAkGV1fN9wm/hAIiLPyWX6SuGf+9JyTp7S/rC2cFWhR26MvA69nplcjNaXVzB0f+QFrLXXjOqCrg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-logger": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.609.0.tgz", - "integrity": "sha512-S62U2dy4jMDhDFDK5gZ4VxFdWzCtLzwbYyFZx2uvPYTECkepLUfzLic2BHg2Qvtu4QjX+oGE3P/7fwaGIsGNuQ==", + "node_modules/@aws-sdk/util-arn-parser": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.723.0.tgz", + "integrity": "sha512-ZhEfvUwNliOQROcAk34WJWVYTlTa4694kSVhDSjW6lE1bMataPnIN8A0ycukEzBXmd8ZSoBcQLn6lKGl7XIJ5w==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.620.0.tgz", - "integrity": "sha512-nh91S7aGK3e/o1ck64sA/CyoFw+gAYj2BDOnoNa6ouyCrVJED96ZXWbhye/fz9SgmNUZR2g7GdVpiLpMKZoI5w==", + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.743.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.743.0.tgz", + "integrity": "sha512-sN1l559zrixeh5x+pttrnd0A3+r34r0tmPkJ/eaaMaAzXqsmKU/xYre9K3FNnsSS1J1k4PEfk/nHDTVUgFYjnw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "@smithy/util-endpoints": "^3.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.637.0.tgz", - "integrity": "sha512-EYo0NE9/da/OY8STDsK2LvM4kNa79DBsf4YVtaG4P5pZ615IeFsD8xOHZeuJmUrSMlVQ8ywPRX7WMucUybsKug==", + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.723.0.tgz", + "integrity": "sha512-Yf2CS10BqK688DRsrKI/EO6B8ff5J86NXe4C+VCysK7UOgN0l1zOTeTukZ3H8Q9tYYX3oaF1961o8vRkFm7Nmw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.614.0.tgz", - "integrity": "sha512-vDCeMXvic/LU0KFIUjpC3RiSTIkkvESsEfbVHiHH0YINfl8HnEqR5rj+L8+phsCeVg2+LmYwYxd5NRz4PHxt5g==", + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.734.0.tgz", + "integrity": "sha512-xQTCus6Q9LwUuALW+S76OL0jcWtMOVu14q+GoLnWPUM7QeUw963oQcLhF7oq0CtaLLKyl4GOUfcwc773Zmwwng==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/types": "^3.3.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "bowser": "^2.11.0", "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/token-providers": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.614.0.tgz", - "integrity": "sha512-okItqyY6L9IHdxqs+Z116y5/nda7rHxLvROxtAJdLavWTYDydxrZstImNgGWTeVdmc0xX2gJCI77UYUTQWnhRw==", + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.758.0.tgz", + "integrity": "sha512-A5EZw85V6WhoKMV2hbuFRvb9NPlxEErb4HPO6/SPXYY4QrjprIzScHxikqcWv1w4J3apB1wto9LPU3IMsYtfrw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.614.0" + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", + "node_modules/@aws-sdk/xml-builder": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.734.0.tgz", + "integrity": "sha512-Zrjxi5qwGEcUsJ0ru7fRtW74WcTS0rbLcehoFB+rN1GRi2hbLcFaYs4PwVA5diLeAJH0gszv3x4Hr/S87MfbKQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-endpoints": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.637.0.tgz", - "integrity": "sha512-pAqOKUHeVWHEXXDIp/qoMk/6jyxIb6GGjnK1/f8dKHtKIEs4tKsnnL563gceEvdad53OPXIt86uoevCcCzmBnw==", - "license": "Apache-2.0", + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "license": "MIT", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "@smithy/util-endpoints": "^2.0.5", - "tslib": "^2.6.2" + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, + "node_modules/@babel/compat-data": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", + "node_modules/@babel/core": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.9.tgz", + "integrity": "sha512-lWBYIrF7qK5+GjY5Uy+/hEgp8OJWOD/rpy74GplYRhEauvbHDeFB8t5hPOZxCZ0Oxf4Cc36tK51/l3ymJysrKw==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.9", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.9", + "@babel/parser": "^7.26.9", + "@babel/template": "^7.26.9", + "@babel/traverse": "^7.26.9", + "@babel/types": "^7.26.9", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/@aws-sdk/client-sso": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.650.0.tgz", - "integrity": "sha512-YKm14gCMChD/jlCisFlsVqB8HJujR41bl4Fup2crHwNJxhD/9LTnzwMiVVlBqlXr41Sfa6fSxczX2AMP8NM14A==", - "license": "Apache-2.0", + "node_modules/@babel/generator": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.9.tgz", + "integrity": "sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg==", + "dev": true, + "license": "MIT", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.637.0", - "license": "Apache-2.0", + "node_modules/@babel/helper-compilation-targets": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "dev": true, + "license": "MIT", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/credential-provider-node": "3.637.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.637.0" + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/client-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.637.0.tgz", - "integrity": "sha512-+KjLvgX5yJYROWo3TQuwBJlHCY0zz9PsLuEolmXQn0BVK1L/m9GteZHtd+rEdAoDGBpE0Xqjy1oz5+SmtsaRUw==", + "node_modules/@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "license": "MIT", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/core": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.635.0.tgz", - "integrity": "sha512-i1x/E/sgA+liUE1XJ7rj1dhyXpAKO1UKFUcTTHXok2ARjWTvszHnSXMOsB77aPbmn0fUp1JTx2kHUAZ1LVt5Bg==", + "node_modules/@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-middleware": "^3.0.3", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.620.1.tgz", - "integrity": "sha512-ExuILJ2qLW5ZO+rgkNRj0xiAipKT16Rk77buvPP8csR7kkCflT/gXTyzRe/uzIiETTxM7tr8xuO9MP/DQXqkfg==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz", + "integrity": "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.635.0.tgz", - "integrity": "sha512-iJyRgEjOCQlBMXqtwPLIKYc7Bsc6nqjrZybdMDenPDa+kmLg7xh8LxHsu9088e+2/wtLicE34FsJJIfzu3L82g==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-stream": "^3.1.3", - "tslib": "^2.6.2" - }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.637.0.tgz", - "integrity": "sha512-h+PFCWfZ0Q3Dx84SppET/TFpcQHmxFW8/oV9ArEvMilw4EBN+IlxgbL0CnHwjHW64szcmrM0mbebjEfHf4FXmw==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "license": "MIT", "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.637.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.637.0.tgz", - "integrity": "sha512-yoEhoxJJfs7sPVQ6Is939BDQJZpZCoUgKr/ySse4YKOZ24t4VqgHA6+wV7rYh+7IW24Rd91UTvEzSuHYTlxlNA==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-ini": "3.637.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.620.1.tgz", - "integrity": "sha512-hWqFMidqLAkaV9G460+1at6qa9vySbjQKKc04p59OT7lZ5cO5VH5S4aI05e+m4j364MBROjjk2ugNvfNf/8ILg==", + "node_modules/@babel/helpers": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.9.tgz", + "integrity": "sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA==", + "dev": true, + "license": "MIT", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.9" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.637.0.tgz", - "integrity": "sha512-Mvz+h+e62/tl+dVikLafhv+qkZJ9RUb8l2YN/LeKMWkxQylPT83CPk9aimVhCV89zth1zpREArl97+3xsfgQvA==", + "node_modules/@babel/parser": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.9.tgz", + "integrity": "sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A==", + "dev": true, + "license": "MIT", "dependencies": { - "@aws-sdk/client-sso": "3.637.0", - "@aws-sdk/token-providers": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" + "@babel/types": "^7.26.9" + }, + "bin": { + "parser": "bin/babel-parser.js" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.0.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.621.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.621.0.tgz", - "integrity": "sha512-w7ASSyfNvcx7+bYGep3VBgC3K6vEdLmlpjT7nSIHxxQf+WSdvy+HynwJosrpZax0sK5q0D1Jpn/5q+r5lwwW6w==", + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "license": "MIT", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { - "@aws-sdk/client-sts": "^3.621.0" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.620.0.tgz", - "integrity": "sha512-VMtPEZwqYrII/oUkffYsNWY9PZ9xpNJpMgmyU0rlDQ25O1c0Hk3fJmZRe6pEkAJ0omD7kLrqGl1DUjQVxpd/Rg==", + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "license": "MIT", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">=16.0.0" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-logger": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.609.0.tgz", - "integrity": "sha512-S62U2dy4jMDhDFDK5gZ4VxFdWzCtLzwbYyFZx2uvPYTECkepLUfzLic2BHg2Qvtu4QjX+oGE3P/7fwaGIsGNuQ==", + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "license": "MIT", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" + "@babel/helper-plugin-utils": "^7.12.13" }, - "engines": { - "node": ">=16.0.0" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.620.0.tgz", - "integrity": "sha512-nh91S7aGK3e/o1ck64sA/CyoFw+gAYj2BDOnoNa6ouyCrVJED96ZXWbhye/fz9SgmNUZR2g7GdVpiLpMKZoI5w==", + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "license": "MIT", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" + "@babel/helper-plugin-utils": "^7.14.5" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.637.0.tgz", - "integrity": "sha512-EYo0NE9/da/OY8STDsK2LvM4kNa79DBsf4YVtaG4P5pZ615IeFsD8xOHZeuJmUrSMlVQ8ywPRX7WMucUybsKug==", + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz", + "integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==", + "dev": true, + "license": "MIT", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.614.0.tgz", - "integrity": "sha512-vDCeMXvic/LU0KFIUjpC3RiSTIkkvESsEfbVHiHH0YINfl8HnEqR5rj+L8+phsCeVg2+LmYwYxd5NRz4PHxt5g==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/types": "^3.3.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/token-providers": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.614.0.tgz", - "integrity": "sha512-okItqyY6L9IHdxqs+Z116y5/nda7rHxLvROxtAJdLavWTYDydxrZstImNgGWTeVdmc0xX2gJCI77UYUTQWnhRw==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.614.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/util-endpoints": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.637.0.tgz", - "integrity": "sha512-pAqOKUHeVWHEXXDIp/qoMk/6jyxIb6GGjnK1/f8dKHtKIEs4tKsnnL563gceEvdad53OPXIt86uoevCcCzmBnw==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "@smithy/util-endpoints": "^2.0.5", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.649.0.tgz", - "integrity": "sha512-IY43r256LhKAvdEVQO/FPdUyVpcZS5EVxh/WHVdNzuN1bNLoUK2rIzuZqVA0EGguvCxoXVmQv9m50GvG7cGktg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.649.0.tgz", - "integrity": "sha512-x5DiLpZDG/AJmCIBnE3Xhpwy35QIo3WqNiOpw6ExVs1NydbM/e90zFPSfhME0FM66D/WorigvluBxxwjxDm/GA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/client-sso/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.637.0.tgz", - "integrity": "sha512-xUi7x4qDubtA8QREtlblPuAcn91GS/09YVEY/RwU7xCY0aqGuFwgszAANlha4OUIqva8oVj2WO4gJuG+iaSnhw==", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.637.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/credential-provider-node": "3.637.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/client-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.637.0.tgz", - "integrity": "sha512-+KjLvgX5yJYROWo3TQuwBJlHCY0zz9PsLuEolmXQn0BVK1L/m9GteZHtd+rEdAoDGBpE0Xqjy1oz5+SmtsaRUw==", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/core": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.635.0.tgz", - "integrity": "sha512-i1x/E/sgA+liUE1XJ7rj1dhyXpAKO1UKFUcTTHXok2ARjWTvszHnSXMOsB77aPbmn0fUp1JTx2kHUAZ1LVt5Bg==", - "dependencies": { - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-middleware": "^3.0.3", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.620.1.tgz", - "integrity": "sha512-ExuILJ2qLW5ZO+rgkNRj0xiAipKT16Rk77buvPP8csR7kkCflT/gXTyzRe/uzIiETTxM7tr8xuO9MP/DQXqkfg==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.635.0.tgz", - "integrity": "sha512-iJyRgEjOCQlBMXqtwPLIKYc7Bsc6nqjrZybdMDenPDa+kmLg7xh8LxHsu9088e+2/wtLicE34FsJJIfzu3L82g==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-stream": "^3.1.3", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.637.0.tgz", - "integrity": "sha512-h+PFCWfZ0Q3Dx84SppET/TFpcQHmxFW8/oV9ArEvMilw4EBN+IlxgbL0CnHwjHW64szcmrM0mbebjEfHf4FXmw==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.637.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.637.0.tgz", - "integrity": "sha512-yoEhoxJJfs7sPVQ6Is939BDQJZpZCoUgKr/ySse4YKOZ24t4VqgHA6+wV7rYh+7IW24Rd91UTvEzSuHYTlxlNA==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-ini": "3.637.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.620.1.tgz", - "integrity": "sha512-hWqFMidqLAkaV9G460+1at6qa9vySbjQKKc04p59OT7lZ5cO5VH5S4aI05e+m4j364MBROjjk2ugNvfNf/8ILg==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.637.0.tgz", - "integrity": "sha512-Mvz+h+e62/tl+dVikLafhv+qkZJ9RUb8l2YN/LeKMWkxQylPT83CPk9aimVhCV89zth1zpREArl97+3xsfgQvA==", - "dependencies": { - "@aws-sdk/client-sso": "3.637.0", - "@aws-sdk/token-providers": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.621.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.621.0.tgz", - "integrity": "sha512-w7ASSyfNvcx7+bYGep3VBgC3K6vEdLmlpjT7nSIHxxQf+WSdvy+HynwJosrpZax0sK5q0D1Jpn/5q+r5lwwW6w==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.621.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.620.0.tgz", - "integrity": "sha512-VMtPEZwqYrII/oUkffYsNWY9PZ9xpNJpMgmyU0rlDQ25O1c0Hk3fJmZRe6pEkAJ0omD7kLrqGl1DUjQVxpd/Rg==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/middleware-logger": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.609.0.tgz", - "integrity": "sha512-S62U2dy4jMDhDFDK5gZ4VxFdWzCtLzwbYyFZx2uvPYTECkepLUfzLic2BHg2Qvtu4QjX+oGE3P/7fwaGIsGNuQ==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.620.0.tgz", - "integrity": "sha512-nh91S7aGK3e/o1ck64sA/CyoFw+gAYj2BDOnoNa6ouyCrVJED96ZXWbhye/fz9SgmNUZR2g7GdVpiLpMKZoI5w==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.637.0.tgz", - "integrity": "sha512-EYo0NE9/da/OY8STDsK2LvM4kNa79DBsf4YVtaG4P5pZ615IeFsD8xOHZeuJmUrSMlVQ8ywPRX7WMucUybsKug==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.614.0.tgz", - "integrity": "sha512-vDCeMXvic/LU0KFIUjpC3RiSTIkkvESsEfbVHiHH0YINfl8HnEqR5rj+L8+phsCeVg2+LmYwYxd5NRz4PHxt5g==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/types": "^3.3.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/token-providers": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.614.0.tgz", - "integrity": "sha512-okItqyY6L9IHdxqs+Z116y5/nda7rHxLvROxtAJdLavWTYDydxrZstImNgGWTeVdmc0xX2gJCI77UYUTQWnhRw==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.614.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/util-endpoints": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.637.0.tgz", - "integrity": "sha512-pAqOKUHeVWHEXXDIp/qoMk/6jyxIb6GGjnK1/f8dKHtKIEs4tKsnnL563gceEvdad53OPXIt86uoevCcCzmBnw==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "@smithy/util-endpoints": "^2.0.5", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/core": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.649.0.tgz", - "integrity": "sha512-dheG/X2y25RHE7K+TlS32kcy7TgDg1OpWV44BQRoE0OBPAWmFR1D1qjjTZ7WWrdqRPKzcnDj1qED8ncyncOX8g==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/core": "^2.4.1", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/property-provider": "^3.1.4", - "@smithy/protocol-http": "^4.1.1", - "@smithy/signature-v4": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/util-middleware": "^3.0.4", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-cognito-identity": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.650.0.tgz", - "integrity": "sha512-QwtRKWKE6vv78Be3Lm5GmFkSl2DGWSOXPZYgkbo8GsD6SP0ParUvJvUE8wsPS5c4tUXC9KuvJAwYAYNFN10Fnw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/client-cognito-identity": "3.650.0", - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-env": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.649.0.tgz", - "integrity": "sha512-tViwzM1dauksA3fdRjsg0T8mcHklDa8EfveyiQKK6pUJopkqV6FQx+X5QNda0t/LrdEVlFZvwHNdXqOEfc83TA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-http": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.649.0.tgz", - "integrity": "sha512-ODAJ+AJJq6ozbns6ejGbicpsQ0dyMOpnGlg0J9J0jITQ05DKQZ581hdB8APDOZ9N8FstShP6dLZflSj8jb5fNA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/util-stream": "^3.1.4", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.650.0.tgz", - "integrity": "sha512-uBra5YjzS/gWSekAogfqJfY6c+oKQkkou7Cjc4d/cpMNvQtF1IBdekJ7NaE1RfsDEz3uH1+Myd07YWZAJo/2Qw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.649.0", - "@aws-sdk/credential-provider-http": "3.649.0", - "@aws-sdk/credential-provider-ini": "3.650.0", - "@aws-sdk/credential-provider-process": "3.649.0", - "@aws-sdk/credential-provider-sso": "3.650.0", - "@aws-sdk/credential-provider-web-identity": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@smithy/credential-provider-imds": "^3.2.1", - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.650.0.tgz", - "integrity": "sha512-6J7IS0f8ovhvbIAZaynOYP+jPX8344UlTjwHxjaXHgFvI8axu3+NslKtEEV5oHLhgzDvrKbinsu5lgE2n4Sqng==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.650.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/client-sts": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.650.0.tgz", - "integrity": "sha512-ISK0ZQYA7O5/WYgslpWy956lUBudGC9d7eL0FFbiL0j50N80Gx3RUv22ezvZgxJWE0W3DqNr4CE19sPYn4Lw8g==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.650.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.650.0.tgz", - "integrity": "sha512-x2M9buZxIsKuUbuDgkGHhAKYBpn0/rYdKlwuFuOhXyyAcnhvPj0lgNF2KE4ld/GF1mKr7FF/uV3G9lM6PFaYmA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.649.0", - "@aws-sdk/credential-provider-http": "3.649.0", - "@aws-sdk/credential-provider-process": "3.649.0", - "@aws-sdk/credential-provider-sso": "3.650.0", - "@aws-sdk/credential-provider-web-identity": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@smithy/credential-provider-imds": "^3.2.1", - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.650.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.649.0.tgz", - "integrity": "sha512-XVk3WsDa0g3kQFPmnCH/LaCtGY/0R2NDv7gscYZSXiBZcG/fixasglTprgWSp8zcA0t7tEIGu9suyjz8ZwhymQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.649.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.649.0.tgz", - "integrity": "sha512-IY43r256LhKAvdEVQO/FPdUyVpcZS5EVxh/WHVdNzuN1bNLoUK2rIzuZqVA0EGguvCxoXVmQv9m50GvG7cGktg==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.649.0.tgz", - "integrity": "sha512-x5DiLpZDG/AJmCIBnE3Xhpwy35QIo3WqNiOpw6ExVs1NydbM/e90zFPSfhME0FM66D/WorigvluBxxwjxDm/GA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-process": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.649.0.tgz", - "integrity": "sha512-6VYPQpEVpU+6DDS/gLoI40ppuNM5RPIEprK30qZZxnhTr5wyrGOeJ7J7wbbwPOZ5dKwta290BiJDU2ipV8Y9BQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.650.0.tgz", - "integrity": "sha512-069nkhcwximbvyGiAC6Fr2G+yrG/p1S3NQ5BZ2cMzB1hgUKo6TvgFK7nriYI4ljMQ+UWxqPwIdTqiUmn2iJmhg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/client-sso": "3.650.0", - "@aws-sdk/token-providers": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.650.0.tgz", - "integrity": "sha512-6J7IS0f8ovhvbIAZaynOYP+jPX8344UlTjwHxjaXHgFvI8axu3+NslKtEEV5oHLhgzDvrKbinsu5lgE2n4Sqng==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.650.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/client-sts": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.650.0.tgz", - "integrity": "sha512-ISK0ZQYA7O5/WYgslpWy956lUBudGC9d7eL0FFbiL0j50N80Gx3RUv22ezvZgxJWE0W3DqNr4CE19sPYn4Lw8g==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.650.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.649.0.tgz", - "integrity": "sha512-ZBqr+JuXI9RiN+4DSZykMx5gxpL8Dr3exIfFhxMiwAP3DQojwl0ub8ONjMuAjq9OvmX6n+jHZL6fBnNgnNFC8w==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.649.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.649.0.tgz", - "integrity": "sha512-IY43r256LhKAvdEVQO/FPdUyVpcZS5EVxh/WHVdNzuN1bNLoUK2rIzuZqVA0EGguvCxoXVmQv9m50GvG7cGktg==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.649.0.tgz", - "integrity": "sha512-x5DiLpZDG/AJmCIBnE3Xhpwy35QIo3WqNiOpw6ExVs1NydbM/e90zFPSfhME0FM66D/WorigvluBxxwjxDm/GA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-providers": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.650.0.tgz", - "integrity": "sha512-e99xHtzfL3fwS5j2gzMXRikoux/vNO3JKlxYSTnz/yfcReYRtRIz4iNrbqOzYFIQFlPS11ToXXXcwl6FOzNM7Q==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/client-cognito-identity": "3.650.0", - "@aws-sdk/client-sso": "3.650.0", - "@aws-sdk/client-sts": "3.650.0", - "@aws-sdk/credential-provider-cognito-identity": "3.650.0", - "@aws-sdk/credential-provider-env": "3.649.0", - "@aws-sdk/credential-provider-http": "3.649.0", - "@aws-sdk/credential-provider-ini": "3.650.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/credential-provider-process": "3.649.0", - "@aws-sdk/credential-provider-sso": "3.650.0", - "@aws-sdk/credential-provider-web-identity": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@smithy/credential-provider-imds": "^3.2.1", - "@smithy/property-provider": "^3.1.4", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.650.0.tgz", - "integrity": "sha512-6J7IS0f8ovhvbIAZaynOYP+jPX8344UlTjwHxjaXHgFvI8axu3+NslKtEEV5oHLhgzDvrKbinsu5lgE2n4Sqng==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.650.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/client-sts": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.650.0.tgz", - "integrity": "sha512-ISK0ZQYA7O5/WYgslpWy956lUBudGC9d7eL0FFbiL0j50N80Gx3RUv22ezvZgxJWE0W3DqNr4CE19sPYn4Lw8g==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.650.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.650.0.tgz", - "integrity": "sha512-x2M9buZxIsKuUbuDgkGHhAKYBpn0/rYdKlwuFuOhXyyAcnhvPj0lgNF2KE4ld/GF1mKr7FF/uV3G9lM6PFaYmA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.649.0", - "@aws-sdk/credential-provider-http": "3.649.0", - "@aws-sdk/credential-provider-process": "3.649.0", - "@aws-sdk/credential-provider-sso": "3.650.0", - "@aws-sdk/credential-provider-web-identity": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@smithy/credential-provider-imds": "^3.2.1", - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.650.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.649.0.tgz", - "integrity": "sha512-XVk3WsDa0g3kQFPmnCH/LaCtGY/0R2NDv7gscYZSXiBZcG/fixasglTprgWSp8zcA0t7tEIGu9suyjz8ZwhymQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.649.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.649.0.tgz", - "integrity": "sha512-IY43r256LhKAvdEVQO/FPdUyVpcZS5EVxh/WHVdNzuN1bNLoUK2rIzuZqVA0EGguvCxoXVmQv9m50GvG7cGktg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.649.0.tgz", - "integrity": "sha512-x5DiLpZDG/AJmCIBnE3Xhpwy35QIo3WqNiOpw6ExVs1NydbM/e90zFPSfhME0FM66D/WorigvluBxxwjxDm/GA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/lib-storage": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/lib-storage/-/lib-storage-3.637.0.tgz", - "integrity": "sha512-HiNGOP4a1QrCWwO1joKw4mCp19nLXoF9K52PislBaYDI35IlHC3DP6MeOg5zmElwtL1GtEHFBy5olfPWPsLyLg==", - "dependencies": { - "@smithy/abort-controller": "^3.1.1", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/smithy-client": "^3.2.0", - "buffer": "5.6.0", - "events": "3.3.0", - "stream-browserify": "3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-s3": "^3.637.0" - } - }, - "node_modules/@aws-sdk/middleware-bucket-endpoint": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.620.0.tgz", - "integrity": "sha512-eGLL0W6L3HDb3OACyetZYOWpHJ+gLo0TehQKeQyy2G8vTYXqNTeqYhuI6up9HVjBzU9eQiULVQETmgQs7TFaRg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-arn-parser": "3.568.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "@smithy/util-config-provider": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-bucket-endpoint/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-expect-continue": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.620.0.tgz", - "integrity": "sha512-QXeRFMLfyQ31nAHLbiTLtk0oHzG9QLMaof5jIfqcUwnOkO8YnQdeqzakrg1Alpy/VQ7aqzIi8qypkBe2KXZz0A==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-expect-continue/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-flexible-checksums": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.620.0.tgz", - "integrity": "sha512-ftz+NW7qka2sVuwnnO1IzBku5ccP+s5qZGeRTPgrKB7OzRW85gthvIo1vQR2w+OwHFk7WJbbhhWwbCbktnP4UA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/crc32": "5.2.0", - "@aws-crypto/crc32c": "5.2.0", - "@aws-sdk/types": "3.609.0", - "@smithy/is-array-buffer": "^3.0.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-host-header": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.649.0.tgz", - "integrity": "sha512-PjAe2FocbicHVgNNwdSZ05upxIO7AgTPFtQLpnIAmoyzMcgv/zNB5fBn3uAnQSAeEPPCD+4SYVEUD1hw1ZBvEg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-location-constraint": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.609.0.tgz", - "integrity": "sha512-xzsdoTkszGVqGVPjUmgoP7TORiByLueMHieI1fhQL888WPdqctwAx3ES6d/bA9Q/i8jnc6hs+Fjhy8UvBTkE9A==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-location-constraint/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-logger": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.649.0.tgz", - "integrity": "sha512-qdqRx6q7lYC6KL/NT9x3ShTL0TBuxdkCczGzHzY3AnOoYUjnCDH7Vlq867O6MAvb4EnGNECFzIgtkZkQ4FhY5w==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.649.0.tgz", - "integrity": "sha512-IPnO4wlmaLRf6IYmJW2i8gJ2+UPXX0hDRv1it7Qf8DpBW+lGyF2rnoN7NrFX0WIxdGOlJF1RcOr/HjXb2QeXfQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.635.0.tgz", - "integrity": "sha512-RLdYJPEV4JL/7NBoFUs7VlP90X++5FlJdxHz0DzCjmiD3qCviKy+Cym3qg1gBgHwucs5XisuClxDrGokhAdTQw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.635.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-arn-parser": "3.568.0", - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-stream": "^3.1.3", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@aws-sdk/core": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.635.0.tgz", - "integrity": "sha512-i1x/E/sgA+liUE1XJ7rj1dhyXpAKO1UKFUcTTHXok2ARjWTvszHnSXMOsB77aPbmn0fUp1JTx2kHUAZ1LVt5Bg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-middleware": "^3.0.3", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-ssec": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.609.0.tgz", - "integrity": "sha512-GZSD1s7+JswWOTamVap79QiDaIV7byJFssBW68GYjyRS5EBjNfwA/8s+6uE6g39R3ojyTbYOmvcANoZEhSULXg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-ssec/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.649.0.tgz", - "integrity": "sha512-q6sO10dnCXoxe9thobMJxekhJumzd1j6dxcE1+qJdYKHJr6yYgWbogJqrLCpWd30w0lEvnuAHK8lN2kWLdJxJw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/region-config-resolver": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.649.0.tgz", - "integrity": "sha512-xURBvdQXvRvca5Du8IlC5FyCj3pkw8Z75+373J3Wb+vyg8GjD14HfKk1Je1HCCQDyIE9VB/scYDcm9ri0ppePw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.4", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/signature-v4-multi-region": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.635.0.tgz", - "integrity": "sha512-J6QY4/invOkpogCHjSaDON1hF03viPpOnsrzVuCvJMmclS/iG62R4EY0wq1alYll0YmSdmKlpJwHMWwGtqK63Q==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/middleware-sdk-s3": "3.635.0", - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/signature-v4-multi-region/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/types": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.649.0.tgz", - "integrity": "sha512-PuPw8RysbhJNlaD2d/PzOTf8sbf4Dsn2b7hwyGh7YVG3S75yTpxSAZxrnhKsz9fStgqFmnw/jUfV/G+uQAeTVw==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/util-arn-parser": { - "version": "3.568.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.568.0.tgz", - "integrity": "sha512-XUKJWWo+KOB7fbnPP0+g/o5Ulku/X53t7i/h+sPHr5xxYTJJ9CYnbToo95mzxe7xWvkLrsNtJ8L+MnNn9INs2w==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/util-endpoints": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.649.0.tgz", - "integrity": "sha512-bZI1Wc3R/KibdDVWFxX/N4AoJFG4VJ92Dp4WYmOrVD6VPkb8jPz7ZeiYc7YwPl8NoDjYyPneBV0lEoK/V8OKAA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "@smithy/util-endpoints": "^2.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/util-locate-window": { - "version": "3.568.0", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.609.0", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/util-user-agent-browser/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.614.0", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/util-user-agent-node/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/xml-builder": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.609.0.tgz", - "integrity": "sha512-l9XxNcA4HX98rwCC2/KoiWcmEiRfZe4G+mYwDbCFT87JIMj6GBhLDkAzr/W8KAaA2IDr8Vc6J8fZPgVulxxfMA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.23.5", - "license": "MIT", - "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.23.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.23.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-compilation-targets": "^7.23.6", - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.7", - "@babel/parser": "^7.23.6", - "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.7", - "@babel/types": "^7.23.6", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/generator": { - "version": "7.23.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.23.6", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/generator/node_modules/jsesc": { - "version": "2.5.2", - "dev": true, - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.23.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/compat-data": "^7.23.5", - "@babel/helper-validator-option": "^7.23.5", - "browserslist": "^4.22.2", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.20", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.23.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.22.15", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.22.15" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.23.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-module-imports": "^7.22.15", - "@babel/helper-simple-access": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/helper-validator-identifier": "^7.22.20" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.22.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-simple-access": { - "version": "7.22.5", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.23.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.23.8", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.7", - "@babel/types": "^7.23.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.23.4", - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.23.6", - "dev": true, - "license": "MIT", - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-bigint": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.23.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.23.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/template": { - "version": "7.22.15", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.23.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.6", - "@babel/types": "^7.23.6", - "debug": "^4.3.1", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse/node_modules/globals": { - "version": "11.12.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/types": { - "version": "7.23.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@bcoe/v8-coverage": { - "version": "0.2.3", - "dev": true, - "license": "MIT" - }, - "node_modules/@bugsnag/browser": { - "version": "7.22.3", - "license": "MIT", - "dependencies": { - "@bugsnag/core": "^7.19.0" - } - }, - "node_modules/@bugsnag/core": { - "version": "7.19.0", - "license": "MIT", - "dependencies": { - "@bugsnag/cuid": "^3.0.0", - "@bugsnag/safe-json-stringify": "^6.0.0", - "error-stack-parser": "^2.0.3", - "iserror": "0.0.2", - "stack-generator": "^2.0.3" - } - }, - "node_modules/@bugsnag/cuid": { - "version": "3.0.2", - "license": "MIT" - }, - "node_modules/@bugsnag/js": { - "version": "7.22.3", - "license": "MIT", - "dependencies": { - "@bugsnag/browser": "^7.22.3", - "@bugsnag/node": "^7.22.3" - } - }, - "node_modules/@bugsnag/node": { - "version": "7.22.3", - "license": "MIT", - "dependencies": { - "@bugsnag/core": "^7.19.0", - "byline": "^5.0.0", - "error-stack-parser": "^2.0.2", - "iserror": "^0.0.2", - "pump": "^3.0.0", - "stack-generator": "^2.0.3" - } - }, - "node_modules/@bugsnag/safe-json-stringify": { - "version": "6.0.0", - "license": "MIT" - }, - "node_modules/@colors/colors": { - "version": "1.6.0", - "license": "MIT", - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/@commitlint/cli": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@commitlint/format": "^17.8.1", - "@commitlint/lint": "^17.8.1", - "@commitlint/load": "^17.8.1", - "@commitlint/read": "^17.8.1", - "@commitlint/types": "^17.8.1", - "execa": "^5.0.0", - "lodash.isfunction": "^3.0.9", - "resolve-from": "5.0.0", - "resolve-global": "1.0.0", - "yargs": "^17.0.0" - }, - "bin": { - "commitlint": "cli.js" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/cli/node_modules/@commitlint/config-validator": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@commitlint/types": "^17.8.1", - "ajv": "^8.11.0" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/cli/node_modules/@commitlint/execute-rule": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/cli/node_modules/@commitlint/load": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@commitlint/config-validator": "^17.8.1", - "@commitlint/execute-rule": "^17.8.1", - "@commitlint/resolve-extends": "^17.8.1", - "@commitlint/types": "^17.8.1", - "@types/node": "20.5.1", - "chalk": "^4.1.0", - "cosmiconfig": "^8.0.0", - "cosmiconfig-typescript-loader": "^4.0.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "lodash.uniq": "^4.5.0", - "resolve-from": "^5.0.0", - "ts-node": "^10.8.1", - "typescript": "^4.6.4 || ^5.2.2" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/cli/node_modules/@commitlint/resolve-extends": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@commitlint/config-validator": "^17.8.1", - "@commitlint/types": "^17.8.1", - "import-fresh": "^3.0.0", - "lodash.mergewith": "^4.6.2", - "resolve-from": "^5.0.0", - "resolve-global": "^1.0.0" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/cli/node_modules/@commitlint/types": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/cli/node_modules/@types/node": { - "version": "20.5.1", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/cli/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@commitlint/cli/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@commitlint/cli/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@commitlint/cli/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/cli/node_modules/cosmiconfig-typescript-loader": { - "version": "4.4.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=v14.21.3" - }, - "peerDependencies": { - "@types/node": "*", - "cosmiconfig": ">=7", - "ts-node": ">=10", - "typescript": ">=4" - } - }, - "node_modules/@commitlint/cli/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@commitlint/cli/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@commitlint/config-conventional": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "conventional-changelog-conventionalcommits": "^6.1.0" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/config-validator": { - "version": "18.4.4", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@commitlint/types": "^18.4.4", - "ajv": "^8.11.0" - }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/ensure": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@commitlint/types": "^17.8.1", - "lodash.camelcase": "^4.3.0", - "lodash.kebabcase": "^4.1.1", - "lodash.snakecase": "^4.1.1", - "lodash.startcase": "^4.4.0", - "lodash.upperfirst": "^4.3.1" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/ensure/node_modules/@commitlint/types": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/ensure/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@commitlint/ensure/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@commitlint/ensure/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@commitlint/ensure/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/ensure/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@commitlint/ensure/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@commitlint/execute-rule": { - "version": "18.4.4", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/format": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@commitlint/types": "^17.8.1", - "chalk": "^4.1.0" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/format/node_modules/@commitlint/types": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/format/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@commitlint/format/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@commitlint/format/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@commitlint/format/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/format/node_modules/has-flag": { - "version": "4.0.0", + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, "license": "MIT", - "engines": { - "node": ">=8" + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/format/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored": { - "version": "17.8.1", + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", + "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", "dev": true, "license": "MIT", "dependencies": { - "@commitlint/types": "^17.8.1", - "semver": "7.5.4" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { - "node": ">=v14" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored/node_modules/@commitlint/types": { - "version": "17.8.1", + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.1.0" + "@babel/helper-plugin-utils": "^7.10.4" }, - "engines": { - "node": ">=v14" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored/node_modules/ansi-styles": { - "version": "4.3.0", + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" + "@babel/helper-plugin-utils": "^7.8.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored/node_modules/chalk": { - "version": "4.1.2", + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" + "@babel/helper-plugin-utils": "^7.10.4" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored/node_modules/color-convert": { - "version": "2.0.1", + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">=7.0.0" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/is-ignored/node_modules/has-flag": { - "version": "4.0.0", + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, "license": "MIT", - "engines": { - "node": ">=8" + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/lint": { - "version": "17.8.1", + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", "dev": true, "license": "MIT", "dependencies": { - "@commitlint/is-ignored": "^17.8.1", - "@commitlint/parse": "^17.8.1", - "@commitlint/rules": "^17.8.1", - "@commitlint/types": "^17.8.1" + "@babel/helper-plugin-utils": "^7.14.5" }, "engines": { - "node": ">=v14" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/lint/node_modules/@commitlint/types": { - "version": "17.8.1", + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.1.0" + "@babel/helper-plugin-utils": "^7.14.5" }, "engines": { - "node": ">=v14" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/lint/node_modules/ansi-styles": { - "version": "4.3.0", + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz", + "integrity": "sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/lint/node_modules/chalk": { - "version": "4.1.2", + "node_modules/@babel/template": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", + "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=6.9.0" } }, - "node_modules/@commitlint/lint/node_modules/color-convert": { - "version": "2.0.1", + "node_modules/@babel/traverse": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.9.tgz", + "integrity": "sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.9", + "@babel/parser": "^7.26.9", + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.9", + "debug": "^4.3.1", + "globals": "^11.1.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=6.9.0" } }, - "node_modules/@commitlint/lint/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/lint/node_modules/has-flag": { - "version": "4.0.0", + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/@commitlint/lint/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/@babel/types": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.9.tgz", + "integrity": "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/@commitlint/load": { - "version": "18.4.4", + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true, + "license": "MIT" + }, + "node_modules/@bugsnag/browser": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.25.0.tgz", + "integrity": "sha512-PzzWy5d9Ly1CU1KkxTB6ZaOw/dO+CYSfVtqxVJccy832e6+7rW/dvSw5Jy7rsNhgcKSKjZq86LtNkPSvritOLA==", "license": "MIT", - "optional": true, "dependencies": { - "@commitlint/config-validator": "^18.4.4", - "@commitlint/execute-rule": "^18.4.4", - "@commitlint/resolve-extends": "^18.4.4", - "@commitlint/types": "^18.4.4", - "chalk": "^4.1.0", - "cosmiconfig": "^8.3.6", - "cosmiconfig-typescript-loader": "^5.0.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "lodash.uniq": "^4.5.0", - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=v18" + "@bugsnag/core": "^7.25.0" } }, - "node_modules/@commitlint/load/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, + "node_modules/@bugsnag/core": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.25.0.tgz", + "integrity": "sha512-JZLak1b5BVzy77CPcklViZrppac/pE07L3uSDmfSvFYSCGReXkik2txOgV05VlF9EDe36dtUAIIV7iAPDfFpQQ==", "license": "MIT", - "optional": true, "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "@bugsnag/cuid": "^3.0.0", + "@bugsnag/safe-json-stringify": "^6.0.0", + "error-stack-parser": "^2.0.3", + "iserror": "0.0.2", + "stack-generator": "^2.0.3" } }, - "node_modules/@commitlint/load/node_modules/chalk": { - "version": "4.1.2", - "dev": true, + "node_modules/@bugsnag/cuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.2.1.tgz", + "integrity": "sha512-zpvN8xQ5rdRWakMd/BcVkdn2F8HKlDSbM3l7duueK590WmI1T0ObTLc1V/1e55r14WNjPd5AJTYX4yPEAFVi+Q==", + "license": "MIT" + }, + "node_modules/@bugsnag/js": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.25.0.tgz", + "integrity": "sha512-d8n8SyKdRUz8jMacRW1j/Sj/ckhKbIEp49+Dacp3CS8afRgfMZ//NXhUFFXITsDP5cXouaejR9fx4XVapYXNgg==", "license": "MIT", - "optional": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "@bugsnag/browser": "^7.25.0", + "@bugsnag/node": "^7.25.0" } }, - "node_modules/@commitlint/load/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, + "node_modules/@bugsnag/node": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.25.0.tgz", + "integrity": "sha512-KlxBaJ8EREEsfKInybAjTO9LmdDXV3cUH5+XNXyqUZrcRVuPOu4j4xvljh+n24ifok/wbFZTKVXUzrN4iKIeIA==", "license": "MIT", - "optional": true, "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "@bugsnag/core": "^7.25.0", + "byline": "^5.0.0", + "error-stack-parser": "^2.0.2", + "iserror": "^0.0.2", + "pump": "^3.0.0", + "stack-generator": "^2.0.3" } }, - "node_modules/@commitlint/load/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT", - "optional": true + "node_modules/@bugsnag/safe-json-stringify": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@bugsnag/safe-json-stringify/-/safe-json-stringify-6.0.0.tgz", + "integrity": "sha512-htzFO1Zc57S8kgdRK9mLcPVTW1BY2ijfH7Dk2CeZmspTWKdKqSo1iwmqrq2WtRjFlo8aRZYgLX0wFrDXF/9DLA==", + "license": "MIT" }, - "node_modules/@commitlint/load/node_modules/has-flag": { - "version": "4.0.0", + "node_modules/@colors/colors": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@commitlint/cli": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-17.8.1.tgz", + "integrity": "sha512-ay+WbzQesE0Rv4EQKfNbSMiJJ12KdKTDzIt0tcK4k11FdsWmtwP0Kp1NWMOUswfIWo6Eb7p7Ln721Nx9FLNBjg==", "dev": true, "license": "MIT", - "optional": true, + "dependencies": { + "@commitlint/format": "^17.8.1", + "@commitlint/lint": "^17.8.1", + "@commitlint/load": "^17.8.1", + "@commitlint/read": "^17.8.1", + "@commitlint/types": "^17.8.1", + "execa": "^5.0.0", + "lodash.isfunction": "^3.0.9", + "resolve-from": "5.0.0", + "resolve-global": "1.0.0", + "yargs": "^17.0.0" + }, + "bin": { + "commitlint": "cli.js" + }, "engines": { - "node": ">=8" + "node": ">=v14" } }, - "node_modules/@commitlint/load/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/@commitlint/config-conventional": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-17.8.1.tgz", + "integrity": "sha512-NxCOHx1kgneig3VLauWJcDWS40DVjg7nKOpBEEK9E5fjJpQqLCilcnKkIIjdBH98kEO1q3NpE5NSrZ2kl/QGJg==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { - "has-flag": "^4.0.0" + "conventional-changelog-conventionalcommits": "^6.1.0" }, "engines": { - "node": ">=8" + "node": ">=v14" } }, - "node_modules/@commitlint/message": { + "node_modules/@commitlint/config-validator": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-17.8.1.tgz", + "integrity": "sha512-UUgUC+sNiiMwkyiuIFR7JG2cfd9t/7MV8VB4TZ+q02ZFkHoduUS4tJGsCBWvBOGD9Btev6IecPMvlWUfJorkEA==", "dev": true, "license": "MIT", + "dependencies": { + "@commitlint/types": "^17.8.1", + "ajv": "^8.11.0" + }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/parse": { + "node_modules/@commitlint/ensure": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-17.8.1.tgz", + "integrity": "sha512-xjafwKxid8s1K23NFpL8JNo6JnY/ysetKo8kegVM7c8vs+kWLP8VrQq+NbhgVlmCojhEDbzQKp4eRXSjVOGsow==", "dev": true, "license": "MIT", "dependencies": { "@commitlint/types": "^17.8.1", - "conventional-changelog-angular": "^6.0.0", - "conventional-commits-parser": "^4.0.0" + "lodash.camelcase": "^4.3.0", + "lodash.kebabcase": "^4.1.1", + "lodash.snakecase": "^4.1.1", + "lodash.startcase": "^4.4.0", + "lodash.upperfirst": "^4.3.1" }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/parse/node_modules/@commitlint/types": { + "node_modules/@commitlint/execute-rule": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-17.8.1.tgz", + "integrity": "sha512-JHVupQeSdNI6xzA9SqMF+p/JjrHTcrJdI02PwesQIDCIGUrv04hicJgCcws5nzaoZbROapPs0s6zeVHoxpMwFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/format": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-17.8.1.tgz", + "integrity": "sha512-f3oMTyZ84M9ht7fb93wbCKmWxO5/kKSbwuYvS867duVomoOsgrgljkGGIztmT/srZnaiGbaK8+Wf8Ik2tSr5eg==", "dev": true, "license": "MIT", "dependencies": { + "@commitlint/types": "^17.8.1", "chalk": "^4.1.0" }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/parse/node_modules/ansi-styles": { + "node_modules/@commitlint/format/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -5038,8 +2188,10 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@commitlint/parse/node_modules/chalk": { + "node_modules/@commitlint/format/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -5053,8 +2205,10 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@commitlint/parse/node_modules/color-convert": { + "node_modules/@commitlint/format/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5064,21 +2218,27 @@ "node": ">=7.0.0" } }, - "node_modules/@commitlint/parse/node_modules/color-name": { + "node_modules/@commitlint/format/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, - "node_modules/@commitlint/parse/node_modules/has-flag": { + "node_modules/@commitlint/format/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/@commitlint/parse/node_modules/supports-color": { + "node_modules/@commitlint/format/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -5088,34 +2248,102 @@ "node": ">=8" } }, - "node_modules/@commitlint/read": { + "node_modules/@commitlint/is-ignored": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-17.8.1.tgz", + "integrity": "sha512-UshMi4Ltb4ZlNn4F7WtSEugFDZmctzFpmbqvpyxD3la510J+PLcnyhf9chs7EryaRFJMdAKwsEKfNK0jL/QM4g==", "dev": true, "license": "MIT", "dependencies": { - "@commitlint/top-level": "^17.8.1", "@commitlint/types": "^17.8.1", - "fs-extra": "^11.0.0", - "git-raw-commits": "^2.0.11", - "minimist": "^1.2.6" + "semver": "7.5.4" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/is-ignored/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@commitlint/is-ignored/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@commitlint/is-ignored/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/@commitlint/lint": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-17.8.1.tgz", + "integrity": "sha512-aQUlwIR1/VMv2D4GXSk7PfL5hIaFSfy6hSHV94O8Y27T5q+DlDEgd/cZ4KmVI+MWKzFfCTiTuWqjfRSfdRllCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/is-ignored": "^17.8.1", + "@commitlint/parse": "^17.8.1", + "@commitlint/rules": "^17.8.1", + "@commitlint/types": "^17.8.1" }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/read/node_modules/@commitlint/types": { + "node_modules/@commitlint/load": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-17.8.1.tgz", + "integrity": "sha512-iF4CL7KDFstP1kpVUkT8K2Wl17h2yx9VaR1ztTc8vzByWWcbO/WaKwxsnCOqow9tVAlzPfo1ywk9m2oJ9ucMqA==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.1.0" + "@commitlint/config-validator": "^17.8.1", + "@commitlint/execute-rule": "^17.8.1", + "@commitlint/resolve-extends": "^17.8.1", + "@commitlint/types": "^17.8.1", + "@types/node": "20.5.1", + "chalk": "^4.1.0", + "cosmiconfig": "^8.0.0", + "cosmiconfig-typescript-loader": "^4.0.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "lodash.uniq": "^4.5.0", + "resolve-from": "^5.0.0", + "ts-node": "^10.8.1", + "typescript": "^4.6.4 || ^5.2.2" }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/read/node_modules/ansi-styles": { + "node_modules/@commitlint/load/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -5128,8 +2356,10 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@commitlint/read/node_modules/chalk": { + "node_modules/@commitlint/load/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -5143,8 +2373,10 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@commitlint/read/node_modules/color-convert": { + "node_modules/@commitlint/load/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5154,34 +2386,27 @@ "node": ">=7.0.0" } }, - "node_modules/@commitlint/read/node_modules/color-name": { + "node_modules/@commitlint/load/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, - "node_modules/@commitlint/read/node_modules/fs-extra": { - "version": "11.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/@commitlint/read/node_modules/has-flag": { + "node_modules/@commitlint/load/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/@commitlint/read/node_modules/supports-color": { + "node_modules/@commitlint/load/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -5191,115 +2416,102 @@ "node": ">=8" } }, - "node_modules/@commitlint/resolve-extends": { - "version": "18.4.4", + "node_modules/@commitlint/message": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-17.8.1.tgz", + "integrity": "sha512-6bYL1GUQsD6bLhTH3QQty8pVFoETfFQlMn2Nzmz3AOLqRVfNNtXBaSY0dhZ0dM6A2MEq4+2d7L/2LP8TjqGRkA==", "dev": true, "license": "MIT", - "optional": true, - "dependencies": { - "@commitlint/config-validator": "^18.4.4", - "@commitlint/types": "^18.4.4", - "import-fresh": "^3.0.0", - "lodash.mergewith": "^4.6.2", - "resolve-from": "^5.0.0", - "resolve-global": "^1.0.0" - }, "engines": { - "node": ">=v18" + "node": ">=v14" } }, - "node_modules/@commitlint/rules": { + "node_modules/@commitlint/parse": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-17.8.1.tgz", + "integrity": "sha512-/wLUickTo0rNpQgWwLPavTm7WbwkZoBy3X8PpkUmlSmQJyWQTj0m6bDjiykMaDt41qcUbfeFfaCvXfiR4EGnfw==", "dev": true, "license": "MIT", "dependencies": { - "@commitlint/ensure": "^17.8.1", - "@commitlint/message": "^17.8.1", - "@commitlint/to-lines": "^17.8.1", "@commitlint/types": "^17.8.1", - "execa": "^5.0.0" + "conventional-changelog-angular": "^6.0.0", + "conventional-commits-parser": "^4.0.0" }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/rules/node_modules/@commitlint/types": { + "node_modules/@commitlint/read": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-17.8.1.tgz", + "integrity": "sha512-Fd55Oaz9irzBESPCdMd8vWWgxsW3OWR99wOntBDHgf9h7Y6OOHjWEdS9Xzen1GFndqgyoaFplQS5y7KZe0kO2w==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.1.0" + "@commitlint/top-level": "^17.8.1", + "@commitlint/types": "^17.8.1", + "fs-extra": "^11.0.0", + "git-raw-commits": "^2.0.11", + "minimist": "^1.2.6" }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/rules/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@commitlint/rules/node_modules/chalk": { - "version": "4.1.2", + "node_modules/@commitlint/read/node_modules/fs-extra": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", + "integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=14.14" } }, - "node_modules/@commitlint/rules/node_modules/color-convert": { - "version": "2.0.1", + "node_modules/@commitlint/resolve-extends": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-17.8.1.tgz", + "integrity": "sha512-W/ryRoQ0TSVXqJrx5SGkaYuAaE/BUontL1j1HsKckvM6e5ZaG0M9126zcwL6peKSuIetJi7E87PRQF8O86EW0Q==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "@commitlint/config-validator": "^17.8.1", + "@commitlint/types": "^17.8.1", + "import-fresh": "^3.0.0", + "lodash.mergewith": "^4.6.2", + "resolve-from": "^5.0.0", + "resolve-global": "^1.0.0" }, "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@commitlint/rules/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/rules/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" + "node": ">=v14" } }, - "node_modules/@commitlint/rules/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/@commitlint/rules": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-17.8.1.tgz", + "integrity": "sha512-2b7OdVbN7MTAt9U0vKOYKCDsOvESVXxQmrvuVUZ0rGFMCrCPJWWP1GJ7f0lAypbDAhaGb8zqtdOr47192LBrIA==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "@commitlint/ensure": "^17.8.1", + "@commitlint/message": "^17.8.1", + "@commitlint/to-lines": "^17.8.1", + "@commitlint/types": "^17.8.1", + "execa": "^5.0.0" }, "engines": { - "node": ">=8" + "node": ">=v14" } }, "node_modules/@commitlint/to-lines": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-17.8.1.tgz", + "integrity": "sha512-LE0jb8CuR/mj6xJyrIk8VLz03OEzXFgLdivBytoooKO5xLt5yalc8Ma5guTWobw998sbR3ogDd+2jed03CFmJA==", "dev": true, "license": "MIT", "engines": { @@ -5308,6 +2520,8 @@ }, "node_modules/@commitlint/top-level": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-17.8.1.tgz", + "integrity": "sha512-l6+Z6rrNf5p333SHfEte6r+WkOxGlWK4bLuZKbtf/2TXRN+qhrvn1XE63VhD8Oe9oIHQ7F7W1nG2k/TJFhx2yA==", "dev": true, "license": "MIT", "dependencies": { @@ -5318,22 +2532,24 @@ } }, "node_modules/@commitlint/types": { - "version": "18.4.4", + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-17.8.1.tgz", + "integrity": "sha512-PXDQXkAmiMEG162Bqdh9ChML/GJZo6vU+7F03ALKDK8zYc6SuAr47LjG7hGYRqUOz+WK0dU7bQ0xzuqFMdxzeQ==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { "chalk": "^4.1.0" }, "engines": { - "node": ">=v18" + "node": ">=v14" } }, "node_modules/@commitlint/types/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -5346,9 +2562,10 @@ }, "node_modules/@commitlint/types/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5362,9 +2579,10 @@ }, "node_modules/@commitlint/types/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { "color-name": "~1.1.4" }, @@ -5374,24 +2592,27 @@ }, "node_modules/@commitlint/types/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/@commitlint/types/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", - "optional": true, "engines": { "node": ">=8" } }, "node_modules/@commitlint/types/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -5401,6 +2622,8 @@ }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, "license": "MIT", "dependencies": { @@ -5412,6 +2635,8 @@ }, "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5421,7 +2646,8 @@ }, "node_modules/@dabh/diagnostics": { "version": "2.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", + "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", "dependencies": { "colorspace": "1.1.x", "enabled": "2.0.x", @@ -5429,22 +2655,26 @@ } }, "node_modules/@datadog/pprof": { - "version": "3.2.0", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@datadog/pprof/-/pprof-5.5.1.tgz", + "integrity": "sha512-3pZVYqc5YkZJOj9Rc8kQ/wG4qlygcnnwFU/w0QKX6dEdJh+1+dWniuUu+GSEjy/H0jc14yhdT2eJJf/F2AnHNw==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { "delay": "^5.0.0", "node-gyp-build": "<4.0", "p-limit": "^3.1.0", - "pprof-format": "^2.0.7", + "pprof-format": "^2.1.0", "source-map": "^0.7.4" }, "engines": { - "node": ">=12" + "node": ">=16" } }, "node_modules/@dependents/detective-less": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@dependents/detective-less/-/detective-less-3.0.2.tgz", + "integrity": "sha512-1YUvQ+e0eeTWAHoN8Uz2x2U37jZs6IGutiIE5LXId7cxfUGhtZjzxE06FdUiuiRrW+UE0vNCdSNPH2lY4dQCOQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5457,6 +2687,8 @@ }, "node_modules/@digitalroute/cz-conventional-changelog-for-jira": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@digitalroute/cz-conventional-changelog-for-jira/-/cz-conventional-changelog-for-jira-8.0.1.tgz", + "integrity": "sha512-I7uNQ2R5LnDYVhQ01sfNvaxqe1PutXyDl8Kltj4L8uDa1LTYqQgWWp3yEj3XYDNjhUjsAheHW0lsmF1oiAjWVg==", "dev": true, "license": "MIT", "dependencies": { @@ -5478,20 +2710,27 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "license": "MIT", "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.0", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -5499,6 +2738,8 @@ }, "node_modules/@eslint/eslintrc": { "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "license": "MIT", "dependencies": { "ajv": "^6.12.4", @@ -5520,6 +2761,8 @@ }, "node_modules/@eslint/eslintrc/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -5534,10 +2777,14 @@ }, "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "license": "MIT" }, "node_modules/@eslint/js": { - "version": "8.56.0", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -5545,16 +2792,27 @@ }, "node_modules/@ewoudenberg/difflib": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@ewoudenberg/difflib/-/difflib-0.1.0.tgz", + "integrity": "sha512-OU5P5mJyD3OoWYMWY+yIgwvgNS9cFAU10f+DDuvtogcWQOoJIsQ4Hy2McSfUfhKjq8L0FuWVb4Rt7kgA+XK86A==", "dependencies": { "heap": ">= 0.2.0" } }, + "node_modules/@hapi/bourne": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-3.0.0.tgz", + "integrity": "sha512-Waj1cwPXJDucOib4a3bAISsKJVb15MKi9IvmTI/7ssVEm6sywXGjVJDhl6/umt1pK1ZS7PacXU3A1PmFKHEZ2w==", + "license": "BSD-3-Clause" + }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -5563,6 +2821,8 @@ }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "license": "Apache-2.0", "engines": { "node": ">=12.22" @@ -5573,11 +2833,16 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", "license": "BSD-3-Clause" }, "node_modules/@hutson/parse-repository-url": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz", + "integrity": "sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==", "dev": true, "license": "Apache-2.0", "engines": { @@ -5586,10 +2851,14 @@ }, "node_modules/@ioredis/commands": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", + "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==", "license": "MIT" }, "node_modules/@isaacs/cliui": { "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, "license": "ISC", "dependencies": { @@ -5605,7 +2874,9 @@ } }, "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "license": "MIT", "engines": { @@ -5617,6 +2888,8 @@ }, "node_modules/@isaacs/cliui/node_modules/ansi-styles": { "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "license": "MIT", "engines": { @@ -5628,11 +2901,15 @@ }, "node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, "license": "MIT" }, "node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "license": "MIT", "dependencies": { @@ -5649,6 +2926,8 @@ }, "node_modules/@isaacs/cliui/node_modules/strip-ansi": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5663,6 +2942,8 @@ }, "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5679,6 +2960,8 @@ }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "license": "ISC", "dependencies": { @@ -5694,6 +2977,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "license": "MIT", "dependencies": { @@ -5702,6 +2987,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/camelcase": { "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "license": "MIT", "engines": { @@ -5710,6 +2997,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -5722,6 +3011,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "license": "MIT", "dependencies": { @@ -5734,6 +3025,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -5745,6 +3038,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -5759,6 +3054,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -5770,6 +3067,8 @@ }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, "license": "MIT", "engines": { @@ -5778,6 +3077,8 @@ }, "node_modules/@jest/console": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "license": "MIT", "dependencies": { @@ -5794,6 +3095,8 @@ }, "node_modules/@jest/console/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -5808,6 +3111,8 @@ }, "node_modules/@jest/console/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -5823,6 +3128,8 @@ }, "node_modules/@jest/console/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5834,11 +3141,15 @@ }, "node_modules/@jest/console/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/@jest/console/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -5847,6 +3158,8 @@ }, "node_modules/@jest/console/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -5858,6 +3171,8 @@ }, "node_modules/@jest/core": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "license": "MIT", "dependencies": { @@ -5904,6 +3219,8 @@ }, "node_modules/@jest/core/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -5918,6 +3235,8 @@ }, "node_modules/@jest/core/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -5933,6 +3252,8 @@ }, "node_modules/@jest/core/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5944,11 +3265,15 @@ }, "node_modules/@jest/core/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/@jest/core/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -5957,6 +3282,8 @@ }, "node_modules/@jest/core/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -5968,6 +3295,8 @@ }, "node_modules/@jest/environment": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "license": "MIT", "dependencies": { @@ -5982,6 +3311,8 @@ }, "node_modules/@jest/expect": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5994,6 +3325,8 @@ }, "node_modules/@jest/expect-utils": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, "license": "MIT", "dependencies": { @@ -6005,6 +3338,8 @@ }, "node_modules/@jest/fake-timers": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6021,6 +3356,8 @@ }, "node_modules/@jest/globals": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6035,6 +3372,8 @@ }, "node_modules/@jest/reporters": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, "license": "MIT", "dependencies": { @@ -6077,6 +3416,8 @@ }, "node_modules/@jest/reporters/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -6091,6 +3432,8 @@ }, "node_modules/@jest/reporters/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -6106,6 +3449,8 @@ }, "node_modules/@jest/reporters/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6117,11 +3462,16 @@ }, "node_modules/@jest/reporters/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/@jest/reporters/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -6141,6 +3491,8 @@ }, "node_modules/@jest/reporters/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -6149,6 +3501,8 @@ }, "node_modules/@jest/reporters/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -6160,6 +3514,8 @@ }, "node_modules/@jest/schemas": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "license": "MIT", "dependencies": { @@ -6171,6 +3527,8 @@ }, "node_modules/@jest/source-map": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, "license": "MIT", "dependencies": { @@ -6184,6 +3542,8 @@ }, "node_modules/@jest/test-result": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "license": "MIT", "dependencies": { @@ -6198,6 +3558,8 @@ }, "node_modules/@jest/test-sequencer": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "license": "MIT", "dependencies": { @@ -6212,6 +3574,8 @@ }, "node_modules/@jest/transform": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "license": "MIT", "dependencies": { @@ -6237,6 +3601,8 @@ }, "node_modules/@jest/transform/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -6251,6 +3617,8 @@ }, "node_modules/@jest/transform/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -6266,6 +3634,8 @@ }, "node_modules/@jest/transform/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6277,11 +3647,15 @@ }, "node_modules/@jest/transform/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/@jest/transform/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -6290,6 +3664,8 @@ }, "node_modules/@jest/transform/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -6301,6 +3677,8 @@ }, "node_modules/@jest/types": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "license": "MIT", "dependencies": { @@ -6317,6 +3695,8 @@ }, "node_modules/@jest/types/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -6331,6 +3711,8 @@ }, "node_modules/@jest/types/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -6346,6 +3728,8 @@ }, "node_modules/@jest/types/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6357,11 +3741,15 @@ }, "node_modules/@jest/types/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/@jest/types/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -6370,6 +3758,8 @@ }, "node_modules/@jest/types/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -6380,20 +3770,24 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "license": "MIT", "engines": { @@ -6401,7 +3795,9 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "license": "MIT", "engines": { @@ -6409,12 +3805,16 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true, "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.20", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6424,18 +3824,22 @@ }, "node_modules/@jsdevtools/ono": { "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", "dev": true, "license": "MIT" }, "node_modules/@koa/router": { - "version": "12.0.1", + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/@koa/router/-/router-12.0.2.tgz", + "integrity": "sha512-sYcHglGKTxGF+hQ6x67xDfkE9o+NhVlRHBqq6gLywaMc6CojK/5vFZByphdonKinYlMLkEkacm+HEse9HzwgTA==", "license": "MIT", "dependencies": { "debug": "^4.3.4", "http-errors": "^2.0.0", "koa-compose": "^4.1.0", "methods": "^1.1.2", - "path-to-regexp": "^6.2.1" + "path-to-regexp": "^6.3.0" }, "engines": { "node": ">= 12" @@ -6443,6 +3847,8 @@ }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", "license": "BSD-3-Clause", "dependencies": { "detect-libc": "^2.0.0", @@ -6461,6 +3867,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "license": "MIT", "dependencies": { "semver": "^6.0.0" @@ -6474,6 +3882,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -6481,10 +3891,14 @@ }, "node_modules/@ndhoule/extend": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@ndhoule/extend/-/extend-2.0.0.tgz", + "integrity": "sha512-xb77tVVGDGwjy25a6RmBiiBQ9uvxhkG0OEpVkQ74oNFsy9u+4PGp5BIIblmJZmJBMgXiKxZtkr4GcmHCNVubBQ==", "license": "MIT" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", @@ -6496,6 +3910,8 @@ }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "license": "MIT", "engines": { "node": ">= 8" @@ -6503,6 +3919,8 @@ }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", @@ -6514,6 +3932,8 @@ }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, "license": "MIT", "optional": true, @@ -6526,6 +3946,7 @@ "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", "dev": true, + "license": "MIT", "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, @@ -6535,22 +3956,32 @@ }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.1", @@ -6559,26 +3990,38 @@ }, "node_modules/@protobufjs/float": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/path": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", "license": "BSD-3-Clause" }, "node_modules/@pyroscope/nodejs": { "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pyroscope/nodejs/-/nodejs-0.2.9.tgz", + "integrity": "sha512-pIw4pIqcNZTZxTUuV0OUI18UZEmx9lT2GaT75ny6FKVe2L1gxAwTCf5TKk8VsnUGY66buUkyaTHcTm7fy0BP/Q==", "license": "Apache-2.0", "dependencies": { "axios": "^0.28.0", @@ -6594,6 +4037,8 @@ }, "node_modules/@pyroscope/nodejs/node_modules/axios": { "version": "0.28.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.28.1.tgz", + "integrity": "sha512-iUcGA5a7p0mVb4Gm/sy+FSECNkPFT4y7wt6OM/CDpO/OnNCvSs3PoMG8ibrC9jRoGYU0gUK5pXVC4NPXq6lHRQ==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.0", @@ -6601,66 +4046,94 @@ "proxy-from-env": "^1.1.0" } }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "license": "MIT" + }, "node_modules/@rudderstack/integrations-lib": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.13.tgz", - "integrity": "sha512-MBI+OQpnYAuOzRlbGCnUX6oVfQsYA7daZ8z07WmqQYQtWFOfd2yFbaxKclu+R/a8W7+jBo4gvbW+ScEW6h+Mgg==", + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.25.tgz", + "integrity": "sha512-/GKqGlGrGWYxkZdqlyYgIK4mL6OK2ijkMcW3Lbg/INK7uZaR9/HFrc/cYX0JbGIb0b5Z49jc0lPO1+jLc3O5lg==", "license": "MIT", "dependencies": { "axios": "^1.4.0", - "axios-mock-adapter": "^1.22.0", - "crypto": "^1.0.1", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", + "fast-xml-parser": "^4.5.0", "get-value": "^3.0.1", "handlebars": "^4.7.8", + "jsonschema": "^1.5.0", "lodash": "^4.17.21", "moment": "^2.29.4", "moment-timezone": "^0.5.43", "set-value": "^4.1.0", "sha256": "^0.2.0", + "sqlstring": "^2.3.3", "tslib": "^2.4.0", - "winston": "^3.11.0" + "uuid": "^11.0.5", + "winston": "^3.11.0", + "zod": "^3.24.2" + } + }, + "node_modules/@rudderstack/integrations-lib/node_modules/uuid": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/esm/bin/uuid" } }, "node_modules/@rudderstack/json-template-engine": { - "version": "0.18.0", + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@rudderstack/json-template-engine/-/json-template-engine-0.19.5.tgz", + "integrity": "sha512-lA45cp8caboMECfNk/CXuP45hCx+W09mclEDiqqTQXilY1hdWp+r/zpcOBzFGZWSxIdrAp5cfhIYnUENx3XX5g==", "license": "MIT" }, "node_modules/@rudderstack/workflow-engine": { - "version": "0.8.13", + "version": "0.8.19", + "resolved": "https://registry.npmjs.org/@rudderstack/workflow-engine/-/workflow-engine-0.8.19.tgz", + "integrity": "sha512-w/AoIVlOvFahWBN6wtnwbQjAMGi15m8Lyw/2LuRaH7QO9Vl7yQhkNiyRiDq0MF6dQ9aiSzaxkoz0fowdrjMvPg==", "license": "MIT", "dependencies": { "@aws-crypto/sha256-js": "^5.2.0", - "@rudderstack/json-template-engine": "^0.17.1", + "@rudderstack/json-template-engine": "^0.19.5", "jsonata": "^2.0.5", "lodash": "^4.17.21", - "object-sizeof": "^2.6.4", - "yaml": "^2.4.3" + "object-sizeof": "^2.6.5", + "yaml": "^2.6.0" } }, - "node_modules/@rudderstack/workflow-engine/node_modules/@rudderstack/json-template-engine": { - "version": "0.17.1", - "license": "MIT" - }, "node_modules/@shopify/jest-koa-mocks": { - "version": "5.1.1", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@shopify/jest-koa-mocks/-/jest-koa-mocks-5.3.1.tgz", + "integrity": "sha512-BRxgfXmV1jMYXGhiGJamta22YoEJxL94qrxyZ/aXg2gWHjDjF6zpNapTfCUNbHJwOW7/tzylkHs53ac8xTZBBw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "license": "MIT", "dependencies": { "koa": "^2.13.4", "node-mocks-http": "^1.11.0" }, "engines": { - "node": "^14.17.0 || >=16.0.0" + "node": ">=18.12.0" } }, "node_modules/@sinclair/typebox": { "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true, "license": "MIT" }, "node_modules/@sindresorhus/is": { "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", + "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==", "dev": true, "license": "MIT", "engines": { @@ -6668,7 +4141,9 @@ } }, "node_modules/@sinonjs/commons": { - "version": "3.0.0", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -6677,6 +4152,8 @@ }, "node_modules/@sinonjs/fake-timers": { "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -6684,945 +4161,754 @@ } }, "node_modules/@smithy/abort-controller": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-3.1.2.tgz", - "integrity": "sha512-b5g+PNujlfqIib9BjkNB108NyO5aZM/RXjfOCXRCqXQ1oPnIkfvdORrztbGgCZdPe/BN/MKDlrGA7PafKPM2jw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.0.1.tgz", + "integrity": "sha512-fiUIYgIgRjMWznk6iLJz35K2YxSLHzLBA/RC6lBrKfQ8fHbPfvk7Pk9UvpKoHgJjI18MnbPuEju53zcVy6KF1g==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/chunked-blob-reader": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-3.0.0.tgz", - "integrity": "sha512-sbnURCwjF0gSToGlsBiAmd1lRCmSn72nu9axfJu5lIx6RUEgHu6GwTMbqCdhQSi0Pumcm5vFxsi9XWXb2mTaoA==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/chunked-blob-reader-native": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-3.0.0.tgz", - "integrity": "sha512-VDkpCYW+peSuM4zJip5WDfqvg2Mo/e8yxOv3VF1m11y7B8KKMKVFtmZWDe36Fvk8rGuWrPZHHXZ7rR7uM5yWyg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-base64": "^3.0.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/config-resolver": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-3.0.6.tgz", - "integrity": "sha512-j7HuVNoRd8EhcFp0MzcUb4fG40C7BcyshH+fAd3Jhd8bINNFvEQYBrZoS/SK6Pun9WPlfoI8uuU2SMz8DsEGlA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.4", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/core": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-2.4.1.tgz", - "integrity": "sha512-7cts7/Oni7aCHebHGiBeWoz5z+vmH+Vx2Z/UW3XtXMslcxI3PEwBZxNinepwZjixS3n12fPc247PHWmjU7ndsQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-5.0.0.tgz", + "integrity": "sha512-+sKqDBQqb036hh4NPaUiEkYFkTUGYzRsn3EuFhyfQfMy6oGHEUJDurLP9Ufb5dasr/XiAmPNMr6wa9afjQB+Gw==", "license": "Apache-2.0", "dependencies": { - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/core/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@smithy/chunked-blob-reader-native": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-4.0.0.tgz", + "integrity": "sha512-R9wM2yPmfEMsUmlMlIgSzOyICs0x9uu7UTHoccMyt7BWw8shcGM8HqB355+BZCPBcySvbTYMs62EgEQkNxz2ig==", "license": "Apache-2.0", "dependencies": { + "@smithy/util-base64": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/core/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@smithy/config-resolver": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.0.1.tgz", + "integrity": "sha512-Igfg8lKu3dRVkTSEm98QpZUvKEOa71jDX4vKRcvJVyRc3UgN3j7vFMf0s7xLQhYmKa8kyJGQgUJDOV5V3neVlQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/core/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@smithy/core": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.1.5.tgz", + "integrity": "sha512-HLclGWPkCsekQgsyzxLhCQLa8THWXtB5PxyYN+2O6nkyLt550KQKTlbV2D1/j5dNIQapAZM1+qFnpBFxZQkgCA==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/credential-provider-imds": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-3.2.1.tgz", - "integrity": "sha512-4z/oTWpRF2TqQI3aCM89/PWu3kim58XU4kOCTtuTJnoaS4KT95cPWMxbQfTN2vzcOe96SOKO8QouQW/+ESB1fQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.0.1.tgz", + "integrity": "sha512-l/qdInaDq1Zpznpmev/+52QomsJNZ3JkTl5yrTl02V6NBgJOQ4LY0SFw/8zsMwj3tLe8vqiIuwF6nxaEwgf6mg==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^3.1.5", - "@smithy/property-provider": "^3.1.4", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/eventstream-codec": { - "version": "3.1.2", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-4.0.1.tgz", + "integrity": "sha512-Q2bCAAR6zXNVtJgifsU16ZjKGqdw/DyecKNgIgi7dlqw04fqDu0mnq+JmGphqheypVc64CYq3azSuCpAdFk2+A==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/crc32": "5.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-hex-encoding": "^3.0.0", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/@smithy/eventstream-serde-browser": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-3.0.6.tgz", - "integrity": "sha512-2hM54UWQUOrki4BtsUI1WzmD13/SeaqT/AB3EUJKbcver/WgKNaiJ5y5F5XXuVe6UekffVzuUDrBZVAA3AWRpQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-4.0.1.tgz", + "integrity": "sha512-HbIybmz5rhNg+zxKiyVAnvdM3vkzjE6ccrJ620iPL8IXcJEntd3hnBl+ktMwIy12Te/kyrSbUb8UCdnUT4QEdA==", "license": "Apache-2.0", "dependencies": { - "@smithy/eventstream-serde-universal": "^3.0.5", - "@smithy/types": "^3.3.0", + "@smithy/eventstream-serde-universal": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/eventstream-serde-config-resolver": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-3.0.3.tgz", - "integrity": "sha512-NVTYjOuYpGfrN/VbRQgn31x73KDLfCXCsFdad8DiIc3IcdxL+dYA9zEQPyOP7Fy2QL8CPy2WE4WCUD+ZsLNfaQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-4.0.1.tgz", + "integrity": "sha512-lSipaiq3rmHguHa3QFF4YcCM3VJOrY9oq2sow3qlhFY+nBSTF/nrO82MUQRPrxHQXA58J5G1UnU2WuJfi465BA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/eventstream-serde-node": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-3.0.5.tgz", - "integrity": "sha512-+upXvnHNyZP095s11jF5dhGw/Ihzqwl5G+/KtMnoQOpdfC3B5HYCcDVG9EmgkhJMXJlM64PyN5gjJl0uXFQehQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-4.0.1.tgz", + "integrity": "sha512-o4CoOI6oYGYJ4zXo34U8X9szDe3oGjmHgsMGiZM0j4vtNoT+h80TLnkUcrLZR3+E6HIxqW+G+9WHAVfl0GXK0Q==", "license": "Apache-2.0", "dependencies": { - "@smithy/eventstream-serde-universal": "^3.0.5", - "@smithy/types": "^3.3.0", + "@smithy/eventstream-serde-universal": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/eventstream-serde-universal": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-3.0.5.tgz", - "integrity": "sha512-5u/nXbyoh1s4QxrvNre9V6vfyoLWuiVvvd5TlZjGThIikc3G+uNiG9uOTCWweSRjv1asdDIWK7nOmN7le4RYHQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-4.0.1.tgz", + "integrity": "sha512-Z94uZp0tGJuxds3iEAZBqGU2QiaBHP4YytLUjwZWx+oUeohCsLyUm33yp4MMBmhkuPqSbQCXq5hDet6JGUgHWA==", "license": "Apache-2.0", "dependencies": { - "@smithy/eventstream-codec": "^3.1.2", - "@smithy/types": "^3.3.0", + "@smithy/eventstream-codec": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/fetch-http-handler": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-3.2.5.tgz", - "integrity": "sha512-DjRtGmK8pKQMIo9+JlAKUt14Z448bg8nAN04yKIvlrrpmpRSG57s5d2Y83npks1r4gPtTRNbAFdQCoj9l3P2KQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/protocol-http": "^4.1.1", - "@smithy/querystring-builder": "^3.0.4", - "@smithy/types": "^3.4.0", - "@smithy/util-base64": "^3.0.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/hash-blob-browser": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-3.1.2.tgz", - "integrity": "sha512-hAbfqN2UbISltakCC2TP0kx4LqXBttEv2MqSPE98gVuDFMf05lU+TpC41QtqGP3Ff5A3GwZMPfKnEy0VmEUpmg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/chunked-blob-reader": "^3.0.0", - "@smithy/chunked-blob-reader-native": "^3.0.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/hash-node": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-3.0.4.tgz", - "integrity": "sha512-6FgTVqEfCr9z/7+Em8BwSkJKA2y3krf1em134x3yr2NHWVCo2KYI8tcA53cjeO47y41jwF84ntsEE0Pe6pNKlg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.4.0", - "@smithy/util-buffer-from": "^3.0.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/hash-node/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.0.1.tgz", + "integrity": "sha512-3aS+fP28urrMW2KTjb6z9iFow6jO8n3MFfineGbndvzGZit3taZhKWtTorf+Gp5RpFDDafeHlhfsGlDCXvUnJA==", "license": "Apache-2.0", "dependencies": { + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/hash-node/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@smithy/hash-blob-browser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-4.0.1.tgz", + "integrity": "sha512-rkFIrQOKZGS6i1D3gKJ8skJ0RlXqDvb1IyAphksaFOMzkn3v3I1eJ8m7OkLj0jf1McP63rcCEoLlkAn/HjcTRw==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/chunked-blob-reader": "^5.0.0", + "@smithy/chunked-blob-reader-native": "^4.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/hash-node/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@smithy/hash-node": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.1.tgz", + "integrity": "sha512-TJ6oZS+3r2Xu4emVse1YPB3Dq3d8RkZDKcPr71Nj/lJsdAP1c7oFzYqEn1IBc915TsgLl2xIJNuxCz+gLbLE0w==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/types": "^4.1.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/hash-stream-node": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-3.1.2.tgz", - "integrity": "sha512-PBgDMeEdDzi6JxKwbfBtwQG9eT9cVwsf0dZzLXoJF4sHKHs5HEo/3lJWpn6jibfJwT34I1EBXpBnZE8AxAft6g==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/hash-stream-node/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/hash-stream-node/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/hash-stream-node/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-4.0.1.tgz", + "integrity": "sha512-U1rAE1fxmReCIr6D2o/4ROqAQX+GffZpyMt3d7njtGDr2pUNmAKRWa49gsNVhCh2vVAuf3wXzWwNr2YN8PAXIw==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/types": "^4.1.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/invalid-dependency": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-3.0.4.tgz", - "integrity": "sha512-MJBUrojC4SEXi9aJcnNOE3oNAuYNphgCGFXscaCj2TA/59BTcXhzHACP8jnnEU3n4yir/NSLKzxqez0T4x4tjA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/is-array-buffer": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", - "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@smithy/md5-js": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-3.0.3.tgz", - "integrity": "sha512-O/SAkGVwpWmelpj/8yDtsaVe6sINHLB1q8YE/+ZQbDxIw3SRLbTZuRaI10K12sVoENdnHqzPp5i3/H+BcZ3m3Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/md5-js/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.1.tgz", + "integrity": "sha512-gdudFPf4QRQ5pzj7HEnu6FhKRi61BfH/Gk5Yf6O0KiSbr1LlVhgjThcvjdu658VE6Nve8vaIWB8/fodmS1rBPQ==", "license": "Apache-2.0", "dependencies": { + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/md5-js/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", + "node_modules/@smithy/is-array-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.0.0.tgz", + "integrity": "sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/md5-js/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", + "node_modules/@smithy/md5-js": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.0.1.tgz", + "integrity": "sha512-HLZ647L27APi6zXkZlzSFZIjpo8po45YiyjMGJZM3gyDY8n7dPGdmxIIljLm4gPt/7rRvutLTTkYJpZVfG5r+A==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/types": "^4.1.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/middleware-content-length": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-3.0.6.tgz", - "integrity": "sha512-AFyHCfe8rumkJkz+hCOVJmBagNBj05KypyDwDElA4TgMSA4eYDZRjVePFZuyABrJZFDc7uVj3dpFIDCEhf59SA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.1.tgz", + "integrity": "sha512-OGXo7w5EkB5pPiac7KNzVtfCW2vKBTZNuCctn++TTSOMpe6RZO/n6WEC1AxJINn3+vWLKW49uad3lo/u0WJ9oQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^4.1.1", - "@smithy/types": "^3.4.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/middleware-endpoint": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-3.1.1.tgz", - "integrity": "sha512-Irv+soW8NKluAtFSEsF8O3iGyLxa5oOevJb/e1yNacV9H7JP/yHyJuKST5YY2ORS1+W34VR8EuUrOF+K29Pl4g==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.0.6.tgz", + "integrity": "sha512-ftpmkTHIFqgaFugcjzLZv3kzPEFsBFSnq1JsIkr2mwFzCraZVhQk2gqN51OOeRxqhbPTkRFj39Qd2V91E/mQxg==", "license": "Apache-2.0", "dependencies": { - "@smithy/middleware-serde": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-middleware": "^3.0.4", + "@smithy/core": "^3.1.5", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/middleware-retry": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-3.0.16.tgz", - "integrity": "sha512-08kI36p1yB4CWO3Qi+UQxjzobt8iQJpnruF0K5BkbZmA/N/sJ51A1JJGJ36GgcbFyPfWw2FU48S5ZoqXt0h0jw==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.0.7.tgz", + "integrity": "sha512-58j9XbUPLkqAcV1kHzVX/kAR16GT+j7DUZJqwzsxh1jtz7G82caZiGyyFgUvogVfNTg3TeAOIJepGc8TXF4AVQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^3.1.5", - "@smithy/protocol-http": "^4.1.1", - "@smithy/service-error-classification": "^3.0.4", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/service-error-classification": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", "tslib": "^2.6.2", "uuid": "^9.0.1" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/middleware-serde": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-3.0.4.tgz", - "integrity": "sha512-1lPDB2O6IJ50Ucxgn7XrvZXbbuI48HmPCcMTuSoXT1lDzuTUfIuBjgAjpD8YLVMfnrjdepi/q45556LA51Pubw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.0.2.tgz", + "integrity": "sha512-Sdr5lOagCn5tt+zKsaW+U2/iwr6bI9p08wOkCp6/eL6iMbgdtc2R5Ety66rf87PeohR0ExI84Txz9GYv5ou3iQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/middleware-stack": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-3.0.4.tgz", - "integrity": "sha512-sLMRjtMCqtVcrOqaOZ10SUnlFE25BSlmLsi4bRSGFD7dgR54eqBjfqkVkPBQyrKBortfGM0+2DJoUPcGECR+nQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.0.1.tgz", + "integrity": "sha512-dHwDmrtR/ln8UTHpaIavRSzeIk5+YZTBtLnKwDW3G2t6nAupCiQUvNzNoHBpik63fwUaJPtlnMzXbQrNFWssIA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/node-config-provider": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-3.1.5.tgz", - "integrity": "sha512-dq/oR3/LxgCgizVk7in7FGTm0w9a3qM4mg3IIXLTCHeW3fV+ipssSvBZ2bvEx1+asfQJTyCnVLeYf7JKfd9v3Q==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.0.1.tgz", + "integrity": "sha512-8mRTjvCtVET8+rxvmzRNRR0hH2JjV0DFOmwXPrISmTIJEfnCBugpYYGAsCj8t41qd+RB5gbheSQ/6aKZCQvFLQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/node-http-handler": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-3.2.0.tgz", - "integrity": "sha512-5TFqaABbiY7uJMKbqR4OARjwI/l4TRoysDJ75pLpVQyO3EcmeloKYwDGyCtgB9WJniFx3BMkmGCB9+j+QiB+Ww==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.0.3.tgz", + "integrity": "sha512-dYCLeINNbYdvmMLtW0VdhW1biXt+PPCGazzT5ZjKw46mOtdgToQEwjqZSS9/EN8+tNs/RO0cEWG044+YZs97aA==", "license": "Apache-2.0", "dependencies": { - "@smithy/abort-controller": "^3.1.2", - "@smithy/protocol-http": "^4.1.1", - "@smithy/querystring-builder": "^3.0.4", - "@smithy/types": "^3.4.0", + "@smithy/abort-controller": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/property-provider": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-3.1.4.tgz", - "integrity": "sha512-BmhefQbfkSl9DeU0/e6k9N4sT5bya5etv2epvqLUz3eGyfRBhtQq60nDkc1WPp4c+KWrzK721cUc/3y0f2psPQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.1.tgz", + "integrity": "sha512-o+VRiwC2cgmk/WFV0jaETGOtX16VNPp2bSQEzu0whbReqE1BMqsP2ami2Vi3cbGVdKu1kq9gQkDAGKbt0WOHAQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/protocol-http": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-4.1.1.tgz", - "integrity": "sha512-Fm5+8LkeIus83Y8jTL1XHsBGP8sPvE1rEVyKf/87kbOPTbzEDMcgOlzcmYXat2h+nC3wwPtRy8hFqtJS71+Wow==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.0.1.tgz", + "integrity": "sha512-TE4cpj49jJNB/oHyh/cRVEgNZaoPaxd4vteJNB0yGidOCVR0jCw/hjPVsT8Q8FRmj8Bd3bFZt8Dh7xGCT+xMBQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/querystring-builder": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-3.0.4.tgz", - "integrity": "sha512-NEoPAsZPdpfVbF98qm8i5k1XMaRKeEnO47CaL5ja6Y1Z2DgJdwIJuJkTJypKm/IKfp8gc0uimIFLwhml8+/pAw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.0.1.tgz", + "integrity": "sha512-wU87iWZoCbcqrwszsOewEIuq+SU2mSoBE2CcsLwE0I19m0B2gOJr1MVjxWcDQYOzHbR1xCk7AcOBbGFUYOKvdg==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", - "@smithy/util-uri-escape": "^3.0.0", + "@smithy/types": "^4.1.0", + "@smithy/util-uri-escape": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/querystring-parser": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-3.0.4.tgz", - "integrity": "sha512-7CHPXffFcakFzhO0OZs/rn6fXlTHrSDdLhIT6/JIk1u2bvwguTL3fMCc1+CfcbXA7TOhjWXu3TcB1EGMqJQwHg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.0.1.tgz", + "integrity": "sha512-Ma2XC7VS9aV77+clSFylVUnPZRindhB7BbmYiNOdr+CHt/kZNJoPP0cd3QxCnCFyPXC4eybmyE98phEHkqZ5Jw==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/service-error-classification": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-3.0.4.tgz", - "integrity": "sha512-KciDHHKFVTb9A1KlJHBt2F26PBaDtoE23uTZy5qRvPzHPqrooXFi6fmx98lJb3Jl38PuUTqIuCUmmY3pacuMBQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.0.1.tgz", + "integrity": "sha512-3JNjBfOWpj/mYfjXJHB4Txc/7E4LVq32bwzE7m28GN79+M1f76XHflUaSUkhOriprPDzev9cX/M+dEB80DNDKA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0" + "@smithy/types": "^4.1.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/shared-ini-file-loader": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-3.1.5.tgz", - "integrity": "sha512-6jxsJ4NOmY5Du4FD0enYegNJl4zTSuKLiChIMqIkh+LapxiP7lmz5lYUNLE9/4cvA65mbBmtdzZ8yxmcqM5igg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.0.1.tgz", + "integrity": "sha512-hC8F6qTBbuHRI/uqDgqqi6J0R4GtEZcgrZPhFQnMhfJs3MnUTGSnR1NSJCJs5VWlMydu0kJz15M640fJlRsIOw==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/signature-v4": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-4.1.1.tgz", - "integrity": "sha512-SH9J9be81TMBNGCmjhrgMWu4YSpQ3uP1L06u/K9SDrE2YibUix1qxedPCxEQu02At0P0SrYDjvz+y91vLG0KRQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/types": "^3.4.0", - "@smithy/util-hex-encoding": "^3.0.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-uri-escape": "^3.0.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/signature-v4/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/signature-v4/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/signature-v4/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.0.1.tgz", + "integrity": "sha512-nCe6fQ+ppm1bQuw5iKoeJ0MJfz2os7Ic3GBjOkLOPtavbD1ONoyE3ygjBfz2ythFWm4YnRm6OxW+8p/m9uCoIA==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/smithy-client": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-3.3.0.tgz", - "integrity": "sha512-H32nVo8tIX82kB0xI2LBrIcj8jx/3/ITotNLbeG1UL0b3b440YPR/hUvqjFJiaB24pQrMjRbU8CugqH5sV0hkw==", + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.1.6.tgz", + "integrity": "sha512-UYDolNg6h2O0L+cJjtgSyKKvEKCOa/8FHYJnBobyeoeWDmNpXjwOAtw16ezyeu1ETuuLEOZbrynK0ZY1Lx9Jbw==", "license": "Apache-2.0", "dependencies": { - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/protocol-http": "^4.1.1", - "@smithy/types": "^3.4.0", - "@smithy/util-stream": "^3.1.4", + "@smithy/core": "^3.1.5", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/types": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-3.4.0.tgz", - "integrity": "sha512-0shOWSg/pnFXPcsSU8ZbaJ4JBHZJPPzLCJxafJvbMVFo9l1w81CqpgUqjlKGNHVrVB7fhIs+WS82JDTyzaLyLA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.1.0.tgz", + "integrity": "sha512-enhjdwp4D7CXmwLtD6zbcDMbo6/T6WtuuKCY49Xxc6OMOmUWlBEBDREsxxgV2LIdeQPW756+f97GzcgAwp3iLw==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/url-parser": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-3.0.4.tgz", - "integrity": "sha512-XdXfObA8WrloavJYtDuzoDhJAYc5rOt+FirFmKBRKaihu7QtU/METAxJgSo7uMK6hUkx0vFnqxV75urtRaLkLg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.0.1.tgz", + "integrity": "sha512-gPXcIEUtw7VlK8f/QcruNXm7q+T5hhvGu9tl63LsJPZ27exB6dtNwvh2HIi0v7JcXJ5emBxB+CJxwaLEdJfA+g==", "license": "Apache-2.0", "dependencies": { - "@smithy/querystring-parser": "^3.0.4", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/util-base64": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-3.0.0.tgz", - "integrity": "sha512-Kxvoh5Qtt0CDsfajiZOCpJxgtPHXOKwmM+Zy4waD43UoEMA+qPxxa98aE/7ZhdnBFZFXMOiBR5xbcaMhLtznQQ==", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/util-base64/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/util-base64/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/querystring-parser": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/util-base64/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", + "node_modules/@smithy/util-base64": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.0.0.tgz", + "integrity": "sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-body-length-browser": { - "version": "3.0.0", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.0.0.tgz", + "integrity": "sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/@smithy/util-body-length-node": { - "version": "3.0.0", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz", + "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-buffer-from": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", - "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.0.0.tgz", + "integrity": "sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==", + "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^2.2.0", + "@smithy/is-array-buffer": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-config-provider": { - "version": "3.0.0", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.0.0.tgz", + "integrity": "sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-defaults-mode-browser": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-3.0.16.tgz", - "integrity": "sha512-Os8ddfNBe7hmc5UMWZxygIHCyAqY0aWR8Wnp/aKbti3f8Df/r0J9ttMZIxeMjsFgtVjEryB0q7SGcwBsHk8WEw==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.7.tgz", + "integrity": "sha512-CZgDDrYHLv0RUElOsmZtAnp1pIjwDVCSuZWOPhIOBvG36RDfX1Q9+6lS61xBf+qqvHoqRjHxgINeQz47cYFC2Q==", "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^3.1.4", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", "bowser": "^2.11.0", "tslib": "^2.6.2" }, "engines": { - "node": ">= 10.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-defaults-mode-node": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-3.0.16.tgz", - "integrity": "sha512-rNhFIYRtrOrrhRlj6RL8jWA6/dcwrbGYAmy8+OAHjjzQ6zdzUBB1P+3IuJAgwWN6Y5GxI+mVXlM/pOjaoIgHow==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.7.tgz", + "integrity": "sha512-79fQW3hnfCdrfIi1soPbK3zmooRFnLpSx3Vxi6nUlqaaQeC5dm8plt4OTNDNqEEEDkvKghZSaoti684dQFVrGQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/config-resolver": "^3.0.6", - "@smithy/credential-provider-imds": "^3.2.1", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/property-provider": "^3.1.4", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">= 10.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-endpoints": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-2.1.0.tgz", - "integrity": "sha512-ilS7/0jcbS2ELdg0fM/4GVvOiuk8/U3bIFXUW25xE1Vh1Ol4DP6vVHQKqM40rCMizCLmJ9UxK+NeJrKlhI3HVA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.1.tgz", + "integrity": "sha512-zVdUENQpdtn9jbpD9SCFK4+aSiavRb9BxEtw9ZGUR1TYo6bBHbIoi7VkrFQ0/RwZlzx0wRBaRmPclj8iAoJCLA==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-hex-encoding": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-3.0.0.tgz", - "integrity": "sha512-eFndh1WEK5YMUYvy3lPlVmYY/fZcQE1D8oSf41Id2vCeIkKJXPcYDCZD+4+xViI6b1XSd7tE+s5AmXzz5ilabQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.0.0.tgz", + "integrity": "sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-middleware": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-3.0.4.tgz", - "integrity": "sha512-uSXHTBhstb1c4nHdmQEdkNMv9LiRNaJ/lWV2U/GO+5F236YFpdPw+hyWI9Zc0Rp9XKzwD9kVZvhZmEgp0UCVnA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.0.1.tgz", + "integrity": "sha512-HiLAvlcqhbzhuiOa0Lyct5IIlyIz0PQO5dnMlmQ/ubYM46dPInB+3yQGkfxsk6Q24Y0n3/JmcA1v5iEhmOF5mA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-retry": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-3.0.4.tgz", - "integrity": "sha512-JJr6g0tO1qO2tCQyK+n3J18r34ZpvatlFN5ULcLranFIBZPxqoivb77EPyNTVwTGMEvvq2qMnyjm4jMIxjdLFg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.0.1.tgz", + "integrity": "sha512-WmRHqNVwn3kI3rKk1LsKcVgPBG6iLTBGC1iYOV3GQegwJ3E8yjzHytPt26VNzOWr1qu0xE03nK0Ug8S7T7oufw==", "license": "Apache-2.0", "dependencies": { - "@smithy/service-error-classification": "^3.0.4", - "@smithy/types": "^3.4.0", + "@smithy/service-error-classification": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-stream": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-3.1.4.tgz", - "integrity": "sha512-txU3EIDLhrBZdGfon6E9V6sZz/irYnKFMblz4TLVjyq8hObNHNS2n9a2t7GIrl7d85zgEPhwLE0gANpZsvpsKg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.1.2.tgz", + "integrity": "sha512-44PKEqQ303d3rlQuiDpcCcu//hV8sn+u2JBo84dWCE0rvgeiVl0IlLMagbU++o0jCWhYCsHaAt9wZuZqNe05Hw==", "license": "Apache-2.0", "dependencies": { - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/types": "^3.4.0", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-buffer-from": "^3.0.0", - "@smithy/util-hex-encoding": "^3.0.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/util-stream/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/util-stream/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-uri-escape": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-3.0.0.tgz", - "integrity": "sha512-LqR7qYLgZTD7nWLBecUi4aqolw8Mhza9ArpNEQ881MJJIU2sE5iHCK6TdyqqzcDLy0OPe10IY4T8ctVdtynubg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.0.0.tgz", + "integrity": "sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-utf8": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", - "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.0.0.tgz", + "integrity": "sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==", + "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^2.2.0", + "@smithy/util-buffer-from": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-waiter": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-3.1.2.tgz", - "integrity": "sha512-4pP0EV3iTsexDx+8PPGAKCQpd/6hsQBaQhqWzU4hqKPHN5epPsxKbvUTIiYIHTxaKt6/kEaqPBpu/ufvfbrRzw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-4.0.2.tgz", + "integrity": "sha512-piUTHyp2Axx3p/kc2CIJkYSv0BAaheBQmbACZgQSSfWUumWNW+R1lL+H9PDBxKJkvOeEX+hKYEFiwO8xagL8AQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/abort-controller": "^3.1.1", - "@smithy/types": "^3.3.0", + "@smithy/abort-controller": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@tsconfig/node10": { - "version": "1.0.9", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", "dev": true, "license": "MIT" }, "node_modules/@tsconfig/node12": { "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true, "license": "MIT" }, "node_modules/@tsconfig/node14": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true, "license": "MIT" }, "node_modules/@tsconfig/node16": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true, "license": "MIT" }, "node_modules/@types/accepts": { "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==", "license": "MIT", "dependencies": { "@types/node": "*" @@ -7630,6 +4916,8 @@ }, "node_modules/@types/babel__core": { "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "license": "MIT", "dependencies": { @@ -7642,6 +4930,8 @@ }, "node_modules/@types/babel__generator": { "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, "license": "MIT", "dependencies": { @@ -7650,6 +4940,8 @@ }, "node_modules/@types/babel__template": { "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "license": "MIT", "dependencies": { @@ -7658,7 +4950,9 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.20.5", + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", + "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", "dev": true, "license": "MIT", "dependencies": { @@ -7667,6 +4961,8 @@ }, "node_modules/@types/body-parser": { "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", "license": "MIT", "dependencies": { "@types/connect": "*", @@ -7675,6 +4971,8 @@ }, "node_modules/@types/connect": { "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", "license": "MIT", "dependencies": { "@types/node": "*" @@ -7682,6 +4980,8 @@ }, "node_modules/@types/content-disposition": { "version": "0.5.8", + "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.8.tgz", + "integrity": "sha512-QVSSvno3dE0MgO76pJhmv4Qyi/j0Yk9pBp0Y7TJ2Tlj+KCgJWY6qX7nnxCOLkZ3VYRSIk1WTxCvwUSdx6CCLdg==", "license": "MIT" }, "node_modules/@types/cookiejar": { @@ -7692,7 +4992,9 @@ "license": "MIT" }, "node_modules/@types/cookies": { - "version": "0.7.10", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.9.0.tgz", + "integrity": "sha512-40Zk8qR147RABiQ7NQnBzWzDcjKzNrntB5BAmeGCb2p/MIyOE+4BVvc17wumsUqUw00bJYqoXFHYygQnEFh4/Q==", "license": "MIT", "dependencies": { "@types/connect": "*", @@ -7702,17 +5004,21 @@ } }, "node_modules/@types/express": { - "version": "4.17.21", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz", + "integrity": "sha512-DvZriSMehGHL1ZNLzi6MidnsDhUZM/x2pRdDIKdwbUNqqwHxMlRdkxtn6/EPKyqKpHqTl/4nRZsRNLpZxZRpPQ==", "license": "MIT", "dependencies": { "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.33", + "@types/express-serve-static-core": "^5.0.0", "@types/qs": "*", "@types/serve-static": "*" } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.41", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.6.tgz", + "integrity": "sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA==", "license": "MIT", "dependencies": { "@types/node": "*", @@ -7722,7 +5028,10 @@ } }, "node_modules/@types/fast-json-stable-stringify": { - "version": "2.1.0", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.2.tgz", + "integrity": "sha512-vsxcbfLDdjytnCnHXtinE40Xl46Wr7l/VGRGt7ewJwCPMKEHOdEsTxXX8xwgoR7cbc+6dE8SB4jlMrOV2zAg7g==", + "deprecated": "This is a stub types definition. fast-json-stable-stringify provides its own type definitions, so you do not need this installed.", "dev": true, "license": "MIT", "dependencies": { @@ -7731,6 +5040,8 @@ }, "node_modules/@types/graceful-fs": { "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "license": "MIT", "dependencies": { @@ -7738,20 +5049,28 @@ } }, "node_modules/@types/http-assert": { - "version": "1.5.5", + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.6.tgz", + "integrity": "sha512-TTEwmtjgVbYAzZYWyeHPrrtWnfVkm8tQkP8P21uQifPgMRgjrow3XDEYqucuC8SKZJT7pUnhU/JymvjggxO9vw==", "license": "MIT" }, "node_modules/@types/http-errors": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", "license": "MIT" }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", "dev": true, "license": "MIT" }, "node_modules/@types/istanbul-lib-report": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, "license": "MIT", "dependencies": { @@ -7760,6 +5079,8 @@ }, "node_modules/@types/istanbul-reports": { "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -7767,7 +5088,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.11", + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", "dev": true, "license": "MIT", "dependencies": { @@ -7777,25 +5100,34 @@ }, "node_modules/@types/json-schema": { "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "license": "MIT" }, "node_modules/@types/json5": { "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "license": "MIT" }, "node_modules/@types/jsonpath": { "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.4.tgz", + "integrity": "sha512-K3hxB8Blw0qgW6ExKgMbXQv2UPZBoE2GqLpVY+yr7nMD2Pq86lsuIzyAaiQ7eMqFL5B6di6pxSkogLJEyEHoGA==", "dev": true, "license": "MIT" }, "node_modules/@types/keygrip": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.6.tgz", + "integrity": "sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ==", "license": "MIT" }, "node_modules/@types/koa": { "version": "2.15.0", "resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.15.0.tgz", "integrity": "sha512-7QFsywoE5URbuVnG3loe03QXuGajrnotr3gQkXcEBShORai23MePfFYdhz90FEtBBpkyIYQbVD+evKtloCgX3g==", + "license": "MIT", "dependencies": { "@types/accepts": "*", "@types/content-disposition": "*", @@ -7809,6 +5141,8 @@ }, "node_modules/@types/koa-bodyparser": { "version": "4.3.12", + "resolved": "https://registry.npmjs.org/@types/koa-bodyparser/-/koa-bodyparser-4.3.12.tgz", + "integrity": "sha512-hKMmRMVP889gPIdLZmmtou/BijaU1tHPyMNmcK7FAHAdATnRcGQQy78EqTTxLH1D4FTsrxIzklAQCso9oGoebQ==", "dev": true, "license": "MIT", "dependencies": { @@ -7817,13 +5151,17 @@ }, "node_modules/@types/koa-compose": { "version": "3.2.8", + "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.8.tgz", + "integrity": "sha512-4Olc63RY+MKvxMwVknCUDhRQX1pFQoBZ/lXcRLP69PQkEpze/0cr8LNqJQe5NFb/b19DWi2a5bTi2VAlQzhJuA==", "license": "MIT", "dependencies": { "@types/koa": "*" } }, "node_modules/@types/lodash": { - "version": "4.14.202", + "version": "4.17.16", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.16.tgz", + "integrity": "sha512-HX7Em5NYQAXKW+1T+FiuG27NGwzJfCX3s1GjOa7ujxZa52kjJLOr4FUxT+giF6Tgxv1e+/czV/iTtBw27WTU9g==", "dev": true, "license": "MIT" }, @@ -7836,38 +5174,51 @@ }, "node_modules/@types/mime": { "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", "license": "MIT" }, "node_modules/@types/minimist": { "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==", "dev": true, "license": "MIT" }, "node_modules/@types/node": { - "version": "20.10.7", - "license": "MIT", - "dependencies": { - "undici-types": "~5.26.4" - } + "version": "20.5.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.1.tgz", + "integrity": "sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==", + "license": "MIT" }, "node_modules/@types/normalize-package-data": { "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", "license": "MIT" }, "node_modules/@types/qs": { - "version": "6.9.11", + "version": "6.9.18", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz", + "integrity": "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==", "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", "license": "MIT" }, "node_modules/@types/semver": { - "version": "7.5.6", + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "license": "MIT" }, "node_modules/@types/send": { "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", "license": "MIT", "dependencies": { "@types/mime": "^1", @@ -7875,16 +5226,20 @@ } }, "node_modules/@types/serve-static": { - "version": "1.15.5", + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", "license": "MIT", "dependencies": { "@types/http-errors": "*", - "@types/mime": "*", - "@types/node": "*" + "@types/node": "*", + "@types/send": "*" } }, "node_modules/@types/stack-utils": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true, "license": "MIT" }, @@ -7914,10 +5269,13 @@ }, "node_modules/@types/triple-beam": { "version": "1.3.5", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==" }, "node_modules/@types/yargs": { - "version": "17.0.32", + "version": "17.0.33", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", + "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", "dev": true, "license": "MIT", "dependencies": { @@ -7926,11 +5284,15 @@ }, "node_modules/@types/yargs-parser": { "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true, "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.4.0", @@ -7963,6 +5325,8 @@ }, "node_modules/@typescript-eslint/parser": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "5.62.0", @@ -7988,6 +5352,8 @@ }, "node_modules/@typescript-eslint/scope-manager": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", "license": "MIT", "dependencies": { "@typescript-eslint/types": "5.62.0", @@ -8003,6 +5369,8 @@ }, "node_modules/@typescript-eslint/type-utils": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", "license": "MIT", "dependencies": { "@typescript-eslint/typescript-estree": "5.62.0", @@ -8028,6 +5396,8 @@ }, "node_modules/@typescript-eslint/types": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -8039,6 +5409,8 @@ }, "node_modules/@typescript-eslint/typescript-estree": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "5.62.0", @@ -8064,6 +5436,8 @@ }, "node_modules/@typescript-eslint/utils": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", @@ -8088,6 +5462,8 @@ }, "node_modules/@typescript-eslint/visitor-keys": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "license": "MIT", "dependencies": { "@typescript-eslint/types": "5.62.0", @@ -8102,15 +5478,21 @@ } }, "node_modules/@ungap/structured-clone": { - "version": "1.2.0", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", "license": "ISC" }, "node_modules/abbrev": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "license": "ISC" }, "node_modules/accepts": { "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "license": "MIT", "dependencies": { "mime-types": "~2.1.34", @@ -8121,7 +5503,9 @@ } }, "node_modules/acorn": { - "version": "8.11.3", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -8132,26 +5516,37 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/acorn-walk": { - "version": "8.3.1", + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", "dev": true, "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, "engines": { "node": ">=0.4.0" } }, "node_modules/add-stream": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz", + "integrity": "sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ==", "dev": true, "license": "MIT" }, "node_modules/agent-base": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "license": "MIT", "dependencies": { "debug": "4" @@ -8161,13 +5556,14 @@ } }, "node_modules/ajv": { - "version": "8.12.0", - "license": "MIT", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dependencies": { - "fast-deep-equal": "^3.1.1", + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "require-from-string": "^2.0.2" }, "funding": { "type": "github", @@ -8176,6 +5572,8 @@ }, "node_modules/ajv-draft-04": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", + "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", "license": "MIT", "peerDependencies": { "ajv": "^8.5.0" @@ -8188,6 +5586,8 @@ }, "node_modules/ajv-formats": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", "license": "MIT", "dependencies": { "ajv": "^8.0.0" @@ -8201,13 +5601,68 @@ } } }, + "node_modules/allure-jest": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/allure-jest/-/allure-jest-3.2.0.tgz", + "integrity": "sha512-j6Ymctv9gvp2JRrUU6pIuFu+2hKxu4Qa+xxzw29i0IHUUZTeOszTS+9DHtk+ejnvuUBFsNlV7LwjPMSj1w8Igw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "allure-js-commons": "3.2.0" + }, + "peerDependencies": { + "jest": ">=24.8.0", + "jest-circus": ">=24.8.0", + "jest-cli": ">=24.8.0", + "jest-environment-jsdom": ">=24.8.0", + "jest-environment-node": ">=24.8.0" + }, + "peerDependenciesMeta": { + "jest": { + "optional": true + }, + "jest-circus": { + "optional": true + }, + "jest-cli": { + "optional": true + }, + "jest-environment-jsdom": { + "optional": true + }, + "jest-environment-node": { + "optional": true + } + } + }, + "node_modules/allure-js-commons": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-3.2.0.tgz", + "integrity": "sha512-UXRo3D6/XEIMosro+OldWj8phJ65eSOYaAUlThOpl6nJJ0sGngMpJYog+Z9FmZDo1BZn4edwLs4aAUaTgkz4Cg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "md5": "^2.3.0" + }, + "peerDependencies": { + "allure-playwright": "3.2.0" + }, + "peerDependenciesMeta": { + "allure-playwright": { + "optional": true + } + } + }, "node_modules/amazon-dsp-formatter": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/amazon-dsp-formatter/-/amazon-dsp-formatter-1.0.2.tgz", - "integrity": "sha512-CfsssMzLFh0IK6oz3j38ENGgp5LZ/q21YX4yXSavfI50CU2cJbupKOk+Bgg0sY67V0lWsYsmYrpkEI2aFG/duA==" + "integrity": "sha512-CfsssMzLFh0IK6oz3j38ENGgp5LZ/q21YX4yXSavfI50CU2cJbupKOk+Bgg0sY67V0lWsYsmYrpkEI2aFG/duA==", + "license": "MIT" }, "node_modules/ansi-align": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", "dev": true, "license": "ISC", "dependencies": { @@ -8216,6 +5671,8 @@ }, "node_modules/ansi-escapes": { "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "license": "MIT", "dependencies": { @@ -8230,6 +5687,8 @@ }, "node_modules/ansi-escapes/node_modules/type-fest": { "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -8241,6 +5700,8 @@ }, "node_modules/ansi-regex": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "license": "MIT", "engines": { "node": ">=8" @@ -8248,6 +5709,8 @@ }, "node_modules/ansi-styles": { "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "license": "MIT", "dependencies": { "color-convert": "^1.9.0" @@ -8258,11 +5721,15 @@ }, "node_modules/any-promise": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", "dev": true, "license": "MIT" }, "node_modules/anymatch": { "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "license": "ISC", "dependencies": { @@ -8275,15 +5742,22 @@ }, "node_modules/app-module-path": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/app-module-path/-/app-module-path-2.2.0.tgz", + "integrity": "sha512-gkco+qxENJV+8vFcDiiFhuoSvRXb2a/QPqpSoWhVz829VNJfOTnELbBmPmNKFxf3xdNnw4DWCkzkDaavcX/1YQ==", "dev": true, "license": "BSD-2-Clause" }, "node_modules/aproba": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "license": "ISC" }, "node_modules/are-we-there-yet": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", "license": "ISC", "dependencies": { "delegates": "^1.0.0", @@ -8295,6 +5769,8 @@ }, "node_modules/are-we-there-yet/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -8307,19 +5783,28 @@ }, "node_modules/arg": { "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true, "license": "MIT" }, "node_modules/argparse": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "license": "Python-2.0" }, "node_modules/array-buffer-byte-length": { - "version": "1.0.0", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -8327,6 +5812,8 @@ }, "node_modules/array-find-index": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==", "dev": true, "license": "MIT", "engines": { @@ -8335,17 +5822,22 @@ }, "node_modules/array-ify": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", "dev": true, "license": "MIT" }, "node_modules/array-includes": { - "version": "3.1.7", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" }, "engines": { @@ -8357,20 +5849,25 @@ }, "node_modules/array-union": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/array.prototype.findlastindex": { - "version": "1.2.3", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.2.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -8380,13 +5877,15 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.3.2", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -8396,13 +5895,15 @@ } }, "node_modules/array.prototype.flatmap": { - "version": "1.3.2", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -8412,16 +5913,18 @@ } }, "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.2", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", "license": "MIT", "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", - "is-array-buffer": "^3.0.2", - "is-shared-array-buffer": "^1.0.2" + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" }, "engines": { "node": ">= 0.4" @@ -8432,6 +5935,8 @@ }, "node_modules/arrify": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", "dev": true, "license": "MIT", "engines": { @@ -8440,11 +5945,15 @@ }, "node_modules/asap": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", "dev": true, "license": "MIT" }, "node_modules/ast-module-types": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-4.0.0.tgz", + "integrity": "sha512-Kd0o8r6CDazJGCRzs8Ivpn0xj19oNKrULhoJFzhGjRsLpekF2zyZs9Ukz+JvZhWD6smszfepakTFhAaYpsI12g==", "dev": true, "license": "MIT", "engines": { @@ -8452,15 +5961,30 @@ } }, "node_modules/async": { - "version": "3.2.5", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", "license": "MIT" }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/asynckit": { "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "license": "MIT" }, "node_modules/at-least-node": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true, "license": "ISC", "engines": { @@ -8468,8 +5992,13 @@ } }, "node_modules/available-typed-arrays": { - "version": "1.0.5", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -8479,10 +6008,14 @@ }, "node_modules/await-handler": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/await-handler/-/await-handler-1.1.2.tgz", + "integrity": "sha512-dihteGhwbJpT89kVbacWiyKeAZr+En0YGK6pAKQJLR0En9ZxSH2H4TTvfG4bBjzFq9gDAma4y9BrpDns6j5UiQ==", "license": "MIT" }, "node_modules/axios": { - "version": "1.7.5", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.2.tgz", + "integrity": "sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -8492,6 +6025,9 @@ }, "node_modules/axios-mock-adapter": { "version": "1.22.0", + "resolved": "https://registry.npmjs.org/axios-mock-adapter/-/axios-mock-adapter-1.22.0.tgz", + "integrity": "sha512-dmI0KbkyAhntUR05YY96qg2H6gg0XMl2+qTW0xmYg6Up+BFBAJYRLROMXRdDEL06/Wqwa0TJThAYvFtSFdRCZw==", + "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", @@ -8503,6 +6039,8 @@ }, "node_modules/babel-jest": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "license": "MIT", "dependencies": { @@ -8523,6 +6061,8 @@ }, "node_modules/babel-jest/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -8537,6 +6077,8 @@ }, "node_modules/babel-jest/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -8552,6 +6094,8 @@ }, "node_modules/babel-jest/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -8563,11 +6107,15 @@ }, "node_modules/babel-jest/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/babel-jest/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -8576,6 +6124,8 @@ }, "node_modules/babel-jest/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -8587,6 +6137,8 @@ }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -8602,6 +6154,8 @@ }, "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -8617,6 +6171,8 @@ }, "node_modules/babel-plugin-istanbul/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -8625,6 +6181,8 @@ }, "node_modules/babel-plugin-jest-hoist": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "license": "MIT", "dependencies": { @@ -8638,22 +6196,27 @@ } }, "node_modules/babel-preset-current-node-syntax": { - "version": "1.0.1", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz", + "integrity": "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==", "dev": true, "license": "MIT", "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" }, "peerDependencies": { "@babel/core": "^7.0.0" @@ -8661,6 +6224,8 @@ }, "node_modules/babel-preset-jest": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "license": "MIT", "dependencies": { @@ -8676,10 +6241,14 @@ }, "node_modules/balanced-match": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, "node_modules/base64-js": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "funding": [ { "type": "github", @@ -8698,6 +6267,8 @@ }, "node_modules/benchmark-suite": { "version": "0.1.8", + "resolved": "https://registry.npmjs.org/benchmark-suite/-/benchmark-suite-0.1.8.tgz", + "integrity": "sha512-UDfWBQfeq/lXcsjuGAanOrX6AhP6HQSsutGS7CfStcbE1loLge7aQr5DT6n8r/4bUoiK+5RYwnogNu5UuTBMNg==", "dev": true, "license": "MIT", "dependencies": { @@ -8713,6 +6284,8 @@ }, "node_modules/bindings": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "license": "MIT", "dependencies": { "file-uri-to-path": "1.0.0" @@ -8720,11 +6293,14 @@ }, "node_modules/bintrees": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", + "integrity": "sha512-VOMgTMwjAaUG580SXn3LacVgjurrbMme7ZZNYGSSV7mmtY6QQRh0Eg3pwIcntQ77DErK1L0NxkbetjcoXzVwKw==", "license": "MIT" }, "node_modules/bl": { "version": "4.1.0", - "dev": true, + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "license": "MIT", "dependencies": { "buffer": "^5.5.0", @@ -8734,7 +6310,8 @@ }, "node_modules/bl/node_modules/readable-stream": { "version": "3.6.2", - "dev": true, + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -8745,17 +6322,16 @@ "node": ">= 6" } }, - "node_modules/boolean": { - "version": "3.2.0", - "dev": true, - "license": "MIT" - }, "node_modules/bowser": { "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==", "license": "MIT" }, "node_modules/boxen": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", "dev": true, "license": "MIT", "dependencies": { @@ -8777,6 +6353,8 @@ }, "node_modules/boxen/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -8791,6 +6369,8 @@ }, "node_modules/boxen/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -8806,6 +6386,8 @@ }, "node_modules/boxen/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -8817,11 +6399,15 @@ }, "node_modules/boxen/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/boxen/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -8830,6 +6416,8 @@ }, "node_modules/boxen/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -8841,6 +6429,8 @@ }, "node_modules/brace-expansion": { "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -8849,6 +6439,8 @@ }, "node_modules/braces": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "license": "MIT", "dependencies": { "fill-range": "^7.1.1" @@ -8858,7 +6450,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.2", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", "dev": true, "funding": [ { @@ -8876,10 +6470,10 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001565", - "electron-to-chromium": "^1.4.601", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" @@ -8890,6 +6484,8 @@ }, "node_modules/bs-logger": { "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", "dev": true, "license": "MIT", "dependencies": { @@ -8901,6 +6497,8 @@ }, "node_modules/bser": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -8909,6 +6507,8 @@ }, "node_modules/btoa": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", + "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==", "license": "(MIT OR Apache-2.0)", "bin": { "btoa": "bin/btoa.js" @@ -8919,6 +6519,8 @@ }, "node_modules/buffer": { "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", "license": "MIT", "dependencies": { "base64-js": "^1.0.2", @@ -8927,11 +6529,15 @@ }, "node_modules/buffer-from": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true, "license": "MIT" }, "node_modules/builtin-modules": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true, "license": "MIT", "engines": { @@ -8943,6 +6549,8 @@ }, "node_modules/byline": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", + "integrity": "sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -8950,6 +6558,8 @@ }, "node_modules/bytes": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -8957,6 +6567,8 @@ }, "node_modules/cache-content-type": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz", + "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==", "license": "MIT", "dependencies": { "mime-types": "^2.1.18", @@ -8968,6 +6580,8 @@ }, "node_modules/cacheable-request": { "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz", + "integrity": "sha512-vag0O2LKZ/najSoUwDbVlnlCFvhBE/7mGTY2B5FgCBDcRD+oVV1HYTOwM6JZfMg/hIcM6IwnTZ1uQQL5/X3xIQ==", "dev": true, "license": "MIT", "dependencies": { @@ -8982,6 +6596,8 @@ }, "node_modules/cacheable-request/node_modules/get-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==", "dev": true, "license": "MIT", "engines": { @@ -8990,27 +6606,25 @@ }, "node_modules/cacheable-request/node_modules/json-buffer": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==", "dev": true, "license": "MIT" }, "node_modules/cacheable-request/node_modules/keyv": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", + "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==", "dev": true, "license": "MIT", "dependencies": { "json-buffer": "3.0.0" } }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/cachedir": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.3.0.tgz", + "integrity": "sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==", "dev": true, "license": "MIT", "engines": { @@ -9018,12 +6632,47 @@ } }, "node_modules/call-bind": { - "version": "1.0.5", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "license": "MIT", "dependencies": { - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -9031,11 +6680,15 @@ }, "node_modules/call-me-maybe": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", "dev": true, "license": "MIT" }, "node_modules/callsites": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "license": "MIT", "engines": { "node": ">=6" @@ -9043,6 +6696,8 @@ }, "node_modules/camelcase": { "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, "license": "MIT", "engines": { @@ -9054,6 +6709,8 @@ }, "node_modules/camelcase-keys": { "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", "dev": true, "license": "MIT", "dependencies": { @@ -9070,6 +6727,8 @@ }, "node_modules/camelcase-keys/node_modules/camelcase": { "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "license": "MIT", "engines": { @@ -9077,7 +6736,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001576", + "version": "1.0.30001702", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001702.tgz", + "integrity": "sha512-LoPe/D7zioC0REI5W73PeR1e1MLCipRGq/VkovJnd6Df+QVqT+vT33OXCp8QUd7kA7RZrHWxb1B36OQKI/0gOA==", "dev": true, "funding": [ { @@ -9097,6 +6758,8 @@ }, "node_modules/chalk": { "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", @@ -9109,6 +6772,8 @@ }, "node_modules/char-regex": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true, "license": "MIT", "engines": { @@ -9117,11 +6782,15 @@ }, "node_modules/chardet": { "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true, "license": "MIT" }, "node_modules/charenc": { "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", "license": "BSD-3-Clause", "engines": { "node": "*" @@ -9129,6 +6798,8 @@ }, "node_modules/check-more-types": { "version": "2.24.0", + "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", + "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", "dev": true, "license": "MIT", "engines": { @@ -9137,6 +6808,8 @@ }, "node_modules/chownr": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", "license": "ISC", "engines": { "node": ">=10" @@ -9144,6 +6817,8 @@ }, "node_modules/ci-info": { "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", "dev": true, "funding": [ { @@ -9157,12 +6832,16 @@ } }, "node_modules/cjs-module-lexer": { - "version": "1.2.3", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", + "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", "dev": true, "license": "MIT" }, "node_modules/clean-regexp": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", + "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==", "dev": true, "license": "MIT", "dependencies": { @@ -9174,6 +6853,8 @@ }, "node_modules/cli-boxes": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", "dev": true, "license": "MIT", "engines": { @@ -9185,6 +6866,8 @@ }, "node_modules/cli-cursor": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "license": "MIT", "dependencies": { @@ -9196,6 +6879,8 @@ }, "node_modules/cli-spinners": { "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", "dev": true, "license": "MIT", "engines": { @@ -9207,6 +6892,8 @@ }, "node_modules/cli-truncate": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", + "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", "dev": true, "license": "MIT", "dependencies": { @@ -9221,7 +6908,9 @@ } }, "node_modules/cli-truncate/node_modules/ansi-regex": { - "version": "6.0.1", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "license": "MIT", "engines": { @@ -9233,11 +6922,15 @@ }, "node_modules/cli-truncate/node_modules/emoji-regex": { "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, "license": "MIT" }, "node_modules/cli-truncate/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "license": "MIT", "dependencies": { @@ -9254,6 +6947,8 @@ }, "node_modules/cli-truncate/node_modules/strip-ansi": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "license": "MIT", "dependencies": { @@ -9268,6 +6963,8 @@ }, "node_modules/cli-width": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true, "license": "ISC", "engines": { @@ -9276,6 +6973,8 @@ }, "node_modules/cliui": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "license": "ISC", "dependencies": { @@ -9289,6 +6988,8 @@ }, "node_modules/clone": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", "license": "MIT", "engines": { "node": ">=0.8" @@ -9296,6 +6997,8 @@ }, "node_modules/clone-response": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==", "dev": true, "license": "MIT", "dependencies": { @@ -9304,6 +7007,8 @@ }, "node_modules/cluster-key-slot": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", "license": "Apache-2.0", "engines": { "node": ">=0.10.0" @@ -9311,6 +7016,8 @@ }, "node_modules/co": { "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "license": "MIT", "engines": { "iojs": ">= 1.0.0", @@ -9318,23 +7025,32 @@ } }, "node_modules/co-body": { - "version": "6.1.0", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/co-body/-/co-body-6.2.0.tgz", + "integrity": "sha512-Kbpv2Yd1NdL1V/V4cwLVxraHDV6K8ayohr2rmH0J87Er8+zJjcTa6dAn9QMPC9CRgU8+aNajKbSf1TzDB1yKPA==", "license": "MIT", "dependencies": { + "@hapi/bourne": "^3.0.0", "inflation": "^2.0.0", "qs": "^6.5.2", "raw-body": "^2.3.3", "type-is": "^1.6.16" + }, + "engines": { + "node": ">=8.0.0" } }, "node_modules/collect-v8-coverage": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true, "license": "MIT" }, "node_modules/color": { "version": "3.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", "dependencies": { "color-convert": "^1.9.3", "color-string": "^1.6.0" @@ -9342,6 +7058,8 @@ }, "node_modules/color-convert": { "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "license": "MIT", "dependencies": { "color-name": "1.1.3" @@ -9349,11 +7067,14 @@ }, "node_modules/color-name": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "license": "MIT" }, "node_modules/color-string": { "version": "1.9.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" @@ -9361,6 +7082,8 @@ }, "node_modules/color-support": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", "license": "ISC", "bin": { "color-support": "bin.js" @@ -9368,11 +7091,15 @@ }, "node_modules/colorette": { "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true, "license": "MIT" }, "node_modules/colors": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", "license": "MIT", "engines": { "node": ">=0.1.90" @@ -9380,7 +7107,8 @@ }, "node_modules/colorspace": { "version": "1.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", "dependencies": { "color": "^3.1.3", "text-hex": "1.0.x" @@ -9388,6 +7116,8 @@ }, "node_modules/combined-stream": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" @@ -9398,6 +7128,8 @@ }, "node_modules/commander": { "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true, "license": "MIT", "engines": { @@ -9405,7 +7137,9 @@ } }, "node_modules/commitizen": { - "version": "4.3.0", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.3.1.tgz", + "integrity": "sha512-gwAPAVTy/j5YcOOebcCRIijn+mSjWJC+IYKivTu6aG8Ei/scoXgfsMRnuAk6b0GRste2J4NGxVdMN3ZpfNaVaw==", "dev": true, "license": "MIT", "dependencies": { @@ -9427,217 +7161,62 @@ "bin": { "commitizen": "bin/commitizen", "cz": "bin/git-cz", - "git-cz": "bin/git-cz" - }, - "engines": { - "node": ">= 12" - } - }, - "node_modules/commitizen/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/commitizen/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/commitizen/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/commitizen/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/commitizen/node_modules/glob": { - "version": "7.2.3", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/commitizen/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/commitizen/node_modules/inquirer": { - "version": "8.2.5", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.1", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.21", - "mute-stream": "0.0.8", - "ora": "^5.4.1", - "run-async": "^2.4.0", - "rxjs": "^7.5.5", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/commitizen/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/commitlint": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@commitlint/cli": "^17.8.1", - "@commitlint/types": "^17.8.1" - }, - "bin": { - "commitlint": "cli.js" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/commitlint/node_modules/@commitlint/types": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/commitlint/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/commitlint/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/commitlint/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" + "git-cz": "bin/git-cz" }, "engines": { - "node": ">=7.0.0" + "node": ">= 12" } }, - "node_modules/commitlint/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/commitlint/node_modules/has-flag": { - "version": "4.0.0", + "node_modules/commitizen/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, - "license": "MIT", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, "engines": { - "node": ">=8" + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/commitlint/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/commitlint": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/commitlint/-/commitlint-17.8.1.tgz", + "integrity": "sha512-X+VPJwZsQDeGj/DG1NsxhZEl+oMHKNC+1myZ/zauNDoo+7OuLHfTOUU1C1a4CjKW4b6T7NuoFcYfK0kRCjCtbA==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "@commitlint/cli": "^17.8.1", + "@commitlint/types": "^17.8.1" + }, + "bin": { + "commitlint": "cli.js" }, "engines": { - "node": ">=8" + "node": ">=v14" } }, "node_modules/commondir": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true, "license": "MIT" }, "node_modules/compare-func": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", "dev": true, "license": "MIT", "dependencies": { @@ -9647,6 +7226,8 @@ }, "node_modules/component-each": { "version": "0.2.6", + "resolved": "https://registry.npmjs.org/component-each/-/component-each-0.2.6.tgz", + "integrity": "sha512-IOXG+HZmbgaBS8Rqy+tAMrwsPdEY1BWcPcp0xI2ZOzKQhHvSVGrL7iCnoDU37TEKOCfaf4ywsR6GwAr0JivPjg==", "dependencies": { "component-type": "1.0.0", "to-function": "2.0.6" @@ -9654,6 +7235,8 @@ }, "node_modules/component-emitter": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", "dev": true, "license": "MIT", "funding": { @@ -9661,17 +7244,25 @@ } }, "node_modules/component-props": { - "version": "1.1.1" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/component-props/-/component-props-1.1.1.tgz", + "integrity": "sha512-69pIRJs9fCCHRqCz3390YF2LV1Lu6iEMZ5zuVqqUn+G20V9BNXlMs0cWawWeW9g4Ynmg29JmkG6R7/lUJoGd1Q==" }, "node_modules/component-type": { - "version": "1.0.0" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/component-type/-/component-type-1.0.0.tgz", + "integrity": "sha512-qzUg4SGDH6KFYlcklmeZwucbtosh/XGwuIffqXAhC1dZyjO7Xu1UuaxwKRY29EncuBj/DH+h6Zot3AdZS6xdFw==" }, "node_modules/concat-map": { "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "license": "MIT" }, "node_modules/concat-stream": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", "dev": true, "engines": [ "node >= 6.0" @@ -9686,6 +7277,8 @@ }, "node_modules/concat-stream/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -9699,14 +7292,20 @@ }, "node_modules/confusing-browser-globals": { "version": "1.0.11", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", + "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", "license": "MIT" }, "node_modules/console-control-strings": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", "license": "ISC" }, "node_modules/content-disposition": { "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "license": "MIT", "dependencies": { "safe-buffer": "5.2.1" @@ -9717,6 +7316,8 @@ }, "node_modules/content-type": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -9724,6 +7325,8 @@ }, "node_modules/conventional-changelog": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-2.0.3.tgz", + "integrity": "sha512-4bcII9cJHSKb2qi9e8qGF6aJHLf/AB0dokhyR+X6QILTMl77s4l163vK+reXhajvfOYbbHQvsrWybr5+PKZwNA==", "dev": true, "license": "MIT", "dependencies": { @@ -9745,6 +7348,8 @@ }, "node_modules/conventional-changelog-angular": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-6.0.0.tgz", + "integrity": "sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==", "dev": true, "license": "ISC", "dependencies": { @@ -9756,6 +7361,8 @@ }, "node_modules/conventional-changelog-atom": { "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-2.0.8.tgz", + "integrity": "sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw==", "dev": true, "license": "ISC", "dependencies": { @@ -9767,6 +7374,8 @@ }, "node_modules/conventional-changelog-codemirror": { "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.8.tgz", + "integrity": "sha512-z5DAsn3uj1Vfp7po3gpt2Boc+Bdwmw2++ZHa5Ak9k0UKsYAO5mH1UBTN0qSCuJZREIhX6WU4E1p3IW2oRCNzQw==", "dev": true, "license": "ISC", "dependencies": { @@ -9778,11 +7387,15 @@ }, "node_modules/conventional-changelog-config-spec": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-config-spec/-/conventional-changelog-config-spec-2.1.0.tgz", + "integrity": "sha512-IpVePh16EbbB02V+UA+HQnnPIohgXvJRxHcS5+Uwk4AT5LjzCZJm5sp/yqs5C6KZJ1jMsV4paEV13BN1pvDuxQ==", "dev": true, "license": "MIT" }, "node_modules/conventional-changelog-conventionalcommits": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-6.1.0.tgz", + "integrity": "sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw==", "dev": true, "license": "ISC", "dependencies": { @@ -9794,6 +7407,8 @@ }, "node_modules/conventional-changelog-core": { "version": "3.2.3", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz", + "integrity": "sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ==", "dev": true, "license": "MIT", "dependencies": { @@ -9817,6 +7432,8 @@ }, "node_modules/conventional-changelog-core/node_modules/camelcase": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==", "dev": true, "license": "MIT", "engines": { @@ -9825,6 +7442,8 @@ }, "node_modules/conventional-changelog-core/node_modules/camelcase-keys": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha512-Ej37YKYbFUI8QiYlvj9YHb6/Z60dZyPJW0Cs8sFilMbd2lP0bw3ylAq9yJkK4lcTA2dID5fG8LjmJYbO7kWb7Q==", "dev": true, "license": "MIT", "dependencies": { @@ -9838,6 +7457,8 @@ }, "node_modules/conventional-changelog-core/node_modules/conventional-commits-parser": { "version": "3.2.4", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz", + "integrity": "sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -9857,6 +7478,8 @@ }, "node_modules/conventional-changelog-core/node_modules/conventional-commits-parser/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -9870,6 +7493,8 @@ }, "node_modules/conventional-changelog-core/node_modules/conventional-commits-parser/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -9878,6 +7503,8 @@ }, "node_modules/conventional-changelog-core/node_modules/dargs": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", + "integrity": "sha512-jyweV/k0rbv2WK4r9KLayuBrSh2Py0tNmV7LBoSMH4hMQyrG8OPyIOWB2VEx4DJKXWmK4lopYMVvORlDt2S8Aw==", "dev": true, "license": "MIT", "dependencies": { @@ -9889,6 +7516,8 @@ }, "node_modules/conventional-changelog-core/node_modules/git-raw-commits": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz", + "integrity": "sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==", "dev": true, "license": "MIT", "dependencies": { @@ -9907,6 +7536,8 @@ }, "node_modules/conventional-changelog-core/node_modules/git-raw-commits/node_modules/meow": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", "dev": true, "license": "MIT", "dependencies": { @@ -9926,6 +7557,8 @@ }, "node_modules/conventional-changelog-core/node_modules/git-raw-commits/node_modules/split2": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", "dev": true, "license": "ISC", "dependencies": { @@ -9934,6 +7567,8 @@ }, "node_modules/conventional-changelog-core/node_modules/git-raw-commits/node_modules/through2": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "license": "MIT", "dependencies": { @@ -9943,6 +7578,8 @@ }, "node_modules/conventional-changelog-core/node_modules/indent-string": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha512-BYqTHXTGUIvg7t1r4sJNKcbDZkL92nkXA8YtRpbjFHRHGDL/NtUeiBJMeE60kIFN/Mg8ESaWQvftaYMGJzQZCQ==", "dev": true, "license": "MIT", "engines": { @@ -9951,6 +7588,8 @@ }, "node_modules/conventional-changelog-core/node_modules/map-obj": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha512-TzQSV2DiMYgoF5RycneKVUzIa9bQsj/B3tTgsE3dOGqlzHnGIDaC7XBE7grnA+8kZPnfqSGFe95VHc2oc0VFUQ==", "dev": true, "license": "MIT", "engines": { @@ -9959,6 +7598,8 @@ }, "node_modules/conventional-changelog-core/node_modules/minimist-options": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", "dev": true, "license": "MIT", "dependencies": { @@ -9971,6 +7612,8 @@ }, "node_modules/conventional-changelog-core/node_modules/quick-lru": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha512-tRS7sTgyxMXtLum8L65daJnHUhfDUgboRdcWW2bR9vBfrj2+O5HSMbQOJfJJjIVSPFqbBCF37FpwWXGitDc5tA==", "dev": true, "license": "MIT", "engines": { @@ -9979,6 +7622,8 @@ }, "node_modules/conventional-changelog-core/node_modules/redent": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha512-XNwrTx77JQCEMXTeb8movBKuK75MgH0RZkujNuDKCezemx/voapl9i2gCSi8WWm8+ox5ycJi1gxF22fR7c0Ciw==", "dev": true, "license": "MIT", "dependencies": { @@ -9991,6 +7636,8 @@ }, "node_modules/conventional-changelog-core/node_modules/strip-indent": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha512-RsSNPLpq6YUL7QYy44RnPVTn/lcVZtb48Uof3X5JLbF4zD/Gs7ZFDv2HWol+leoQN2mT86LAzSshGfkTlSOpsA==", "dev": true, "license": "MIT", "engines": { @@ -9999,6 +7646,8 @@ }, "node_modules/conventional-changelog-core/node_modules/through2": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10008,6 +7657,8 @@ }, "node_modules/conventional-changelog-ember": { "version": "2.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.9.tgz", + "integrity": "sha512-ulzIReoZEvZCBDhcNYfDIsLTHzYHc7awh+eI44ZtV5cx6LVxLlVtEmcO+2/kGIHGtw+qVabJYjdI5cJOQgXh1A==", "dev": true, "license": "ISC", "dependencies": { @@ -10019,6 +7670,8 @@ }, "node_modules/conventional-changelog-eslint": { "version": "3.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.9.tgz", + "integrity": "sha512-6NpUCMgU8qmWmyAMSZO5NrRd7rTgErjrm4VASam2u5jrZS0n38V7Y9CzTtLT2qwz5xEChDR4BduoWIr8TfwvXA==", "dev": true, "license": "ISC", "dependencies": { @@ -10030,6 +7683,8 @@ }, "node_modules/conventional-changelog-express": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-2.0.6.tgz", + "integrity": "sha512-SDez2f3iVJw6V563O3pRtNwXtQaSmEfTCaTBPCqn0oG0mfkq0rX4hHBq5P7De2MncoRixrALj3u3oQsNK+Q0pQ==", "dev": true, "license": "ISC", "dependencies": { @@ -10041,6 +7696,8 @@ }, "node_modules/conventional-changelog-jquery": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-0.1.0.tgz", + "integrity": "sha512-wbz5vVcvu/SPZTDFB21fF/xo5zFq6NQR42jhtUfOrrP1N/ZjNshhGb3expCGqHYdnUHzPevHeUafsVrdxVD5Og==", "dev": true, "license": "ISC", "dependencies": { @@ -10049,6 +7706,8 @@ }, "node_modules/conventional-changelog-jscs": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-jscs/-/conventional-changelog-jscs-0.1.0.tgz", + "integrity": "sha512-V8sey4tE0nJUlWGi2PZKDMfawYLf/+F165xhhDjcIoTEJDxssVV5PMVzTQzjS6U/dEX85fWkur+bs6imOqkIng==", "dev": true, "license": "ISC", "dependencies": { @@ -10057,6 +7716,8 @@ }, "node_modules/conventional-changelog-jshint": { "version": "2.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.9.tgz", + "integrity": "sha512-wMLdaIzq6TNnMHMy31hql02OEQ8nCQfExw1SE0hYL5KvU+JCTuPaDO+7JiogGT2gJAxiUGATdtYYfh+nT+6riA==", "dev": true, "license": "ISC", "dependencies": { @@ -10069,6 +7730,8 @@ }, "node_modules/conventional-changelog-preset-loader": { "version": "2.3.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", + "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", "dev": true, "license": "MIT", "engines": { @@ -10077,6 +7740,8 @@ }, "node_modules/conventional-changelog-writer": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.1.0.tgz", + "integrity": "sha512-WwKcUp7WyXYGQmkLsX4QmU42AZ1lqlvRW9mqoyiQzdD+rJWbTepdWoKJuwXTS+yq79XKnQNa93/roViPQrAQgw==", "dev": true, "license": "MIT", "dependencies": { @@ -10100,6 +7765,8 @@ }, "node_modules/conventional-changelog-writer/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -10113,6 +7780,8 @@ }, "node_modules/conventional-changelog-writer/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -10121,6 +7790,8 @@ }, "node_modules/conventional-changelog-writer/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -10129,6 +7800,8 @@ }, "node_modules/conventional-changelog/node_modules/compare-func": { "version": "1.3.4", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.4.tgz", + "integrity": "sha512-sq2sWtrqKPkEXAC8tEJA1+BqAH9GbFkGBtUOqrUX57VSfwp8xyktctk+uLoRy5eccTdxzDcVIztlYDpKs3Jv1Q==", "dev": true, "license": "MIT", "dependencies": { @@ -10138,6 +7811,8 @@ }, "node_modules/conventional-changelog/node_modules/conventional-changelog-angular": { "version": "1.6.6", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz", + "integrity": "sha512-suQnFSqCxRwyBxY68pYTsFkG0taIdinHLNEAX5ivtw8bCRnIgnpvcHmlR/yjUyZIrNPYAoXlY1WiEKWgSE4BNg==", "dev": true, "license": "ISC", "dependencies": { @@ -10147,11 +7822,15 @@ }, "node_modules/conventional-commit-types": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-3.0.0.tgz", + "integrity": "sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg==", "dev": true, "license": "ISC" }, "node_modules/conventional-commits-filter": { "version": "2.0.7", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz", + "integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==", "dev": true, "license": "MIT", "dependencies": { @@ -10164,6 +7843,8 @@ }, "node_modules/conventional-commits-parser": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-4.0.0.tgz", + "integrity": "sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg==", "dev": true, "license": "MIT", "dependencies": { @@ -10181,6 +7862,8 @@ }, "node_modules/conventional-github-releaser": { "version": "3.1.5", + "resolved": "https://registry.npmjs.org/conventional-github-releaser/-/conventional-github-releaser-3.1.5.tgz", + "integrity": "sha512-VhPKbdN92b2ygnQLkuwHIfUaPAVrVfJVuQdxbmmVPkN927LDP98HthLWFVShh4pxqLK0nE66v78RERGJVeCzbg==", "dev": true, "license": "MIT", "dependencies": { @@ -10206,6 +7889,8 @@ }, "node_modules/conventional-github-releaser/node_modules/camelcase": { "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "license": "MIT", "engines": { @@ -10214,6 +7899,8 @@ }, "node_modules/conventional-github-releaser/node_modules/debug": { "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10222,6 +7909,8 @@ }, "node_modules/conventional-github-releaser/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -10234,6 +7923,8 @@ }, "node_modules/conventional-github-releaser/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -10245,6 +7936,8 @@ }, "node_modules/conventional-github-releaser/node_modules/meow": { "version": "7.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", + "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", "dev": true, "license": "MIT", "dependencies": { @@ -10269,6 +7962,8 @@ }, "node_modules/conventional-github-releaser/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -10283,6 +7978,8 @@ }, "node_modules/conventional-github-releaser/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -10294,6 +7991,8 @@ }, "node_modules/conventional-github-releaser/node_modules/read-pkg": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "dev": true, "license": "MIT", "dependencies": { @@ -10308,6 +8007,8 @@ }, "node_modules/conventional-github-releaser/node_modules/read-pkg-up": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, "license": "MIT", "dependencies": { @@ -10324,6 +8025,8 @@ }, "node_modules/conventional-github-releaser/node_modules/read-pkg-up/node_modules/type-fest": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -10332,6 +8035,8 @@ }, "node_modules/conventional-github-releaser/node_modules/read-pkg/node_modules/type-fest": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -10340,6 +8045,8 @@ }, "node_modules/conventional-github-releaser/node_modules/semver": { "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "license": "ISC", "bin": { @@ -10348,6 +8055,8 @@ }, "node_modules/conventional-github-releaser/node_modules/type-fest": { "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -10359,6 +8068,8 @@ }, "node_modules/conventional-github-releaser/node_modules/yargs-parser": { "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "license": "ISC", "dependencies": { @@ -10371,6 +8082,8 @@ }, "node_modules/conventional-recommended-bump": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz", + "integrity": "sha512-uiApbSiNGM/kkdL9GTOLAqC4hbptObFo4wW2QRyHsKciGAfQuLU1ShZ1BIVI/+K2BE/W1AWYQMCXAsv4dyKPaw==", "dev": true, "license": "MIT", "dependencies": { @@ -10392,6 +8105,8 @@ }, "node_modules/conventional-recommended-bump/node_modules/conventional-commits-parser": { "version": "3.2.4", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz", + "integrity": "sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -10411,6 +8126,8 @@ }, "node_modules/conventional-recommended-bump/node_modules/git-semver-tags": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz", + "integrity": "sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==", "dev": true, "license": "MIT", "dependencies": { @@ -10426,6 +8143,8 @@ }, "node_modules/conventional-recommended-bump/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -10439,6 +8158,8 @@ }, "node_modules/conventional-recommended-bump/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -10447,6 +8168,8 @@ }, "node_modules/conventional-recommended-bump/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -10454,23 +8177,33 @@ } }, "node_modules/convert-hex": { - "version": "0.1.0" + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/convert-hex/-/convert-hex-0.1.0.tgz", + "integrity": "sha512-w20BOb1PiR/sEJdS6wNrUjF5CSfscZFUp7R9NSlXH8h2wynzXVEPFPJECAnkNylZ+cvf3p7TyRUHggDmrwXT9A==" }, "node_modules/convert-source-map": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true, "license": "MIT" }, "node_modules/convert-string": { - "version": "0.1.0" + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/convert-string/-/convert-string-0.1.0.tgz", + "integrity": "sha512-1KX9ESmtl8xpT2LN2tFnKSbV4NiarbVi8DVb39ZriijvtTklyrT+4dT1wsGMHKD3CJUjXgvJzstm9qL9ICojGA==" }, "node_modules/cookiejar": { "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", "dev": true, "license": "MIT" }, "node_modules/cookies": { "version": "0.9.1", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.9.1.tgz", + "integrity": "sha512-TG2hpqe4ELx54QER/S3HQ9SRVnQnGBtKUz5bLQWtYAQ+o6GpgMs6sYUvaiJjVxb+UXwhRhAEP3m7LbsIZ77Hmw==", "license": "MIT", "dependencies": { "depd": "~2.0.0", @@ -10482,15 +8215,21 @@ }, "node_modules/copy-to": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/copy-to/-/copy-to-2.0.1.tgz", + "integrity": "sha512-3DdaFaU/Zf1AnpLiFDeNCD4TOWe3Zl2RZaTzUvWiIk5ERzcCodOE20Vqq4fzCbNoHURFHT4/us/Lfq+S2zyY4w==", "license": "MIT" }, "node_modules/core-util-is": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true, "license": "MIT" }, "node_modules/cosmiconfig": { "version": "8.3.6", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", + "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", "dev": true, "license": "MIT", "dependencies": { @@ -10515,24 +8254,25 @@ } }, "node_modules/cosmiconfig-typescript-loader": { - "version": "5.0.0", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.4.0.tgz", + "integrity": "sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==", "dev": true, "license": "MIT", - "optional": true, - "dependencies": { - "jiti": "^1.19.1" - }, "engines": { - "node": ">=v16" + "node": ">=v14.21.3" }, "peerDependencies": { "@types/node": "*", - "cosmiconfig": ">=8.2", + "cosmiconfig": ">=7", + "ts-node": ">=10", "typescript": ">=4" } }, "node_modules/create-jest": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", "dev": true, "license": "MIT", "dependencies": { @@ -10553,6 +8293,8 @@ }, "node_modules/create-jest/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -10567,6 +8309,8 @@ }, "node_modules/create-jest/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -10582,6 +8326,8 @@ }, "node_modules/create-jest/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10593,11 +8339,15 @@ }, "node_modules/create-jest/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/create-jest/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -10606,6 +8356,8 @@ }, "node_modules/create-jest/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -10617,6 +8369,8 @@ }, "node_modules/create-require": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true, "license": "MIT" }, @@ -10636,21 +8390,23 @@ }, "node_modules/crypt": { "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", "license": "BSD-3-Clause", "engines": { "node": "*" } }, - "node_modules/crypto": { - "version": "1.0.1", - "license": "ISC" - }, "node_modules/crypto-js": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==", "license": "MIT" }, "node_modules/currently-unhandled": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==", "dev": true, "license": "MIT", "dependencies": { @@ -10662,6 +8418,8 @@ }, "node_modules/cz-conventional-changelog": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-3.3.0.tgz", + "integrity": "sha512-U466fIzU5U22eES5lTNiNbZ+d8dfcHcssH4o7QsdWaCcRs/feIPCxKYSWkYBNs5mny7MvEfwpTLWjvbm94hecw==", "dev": true, "license": "MIT", "dependencies": { @@ -10681,14 +8439,69 @@ }, "node_modules/dargs": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", + "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/dateformat": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", "dev": true, "license": "MIT", "engines": { @@ -10696,10 +8509,12 @@ } }, "node_modules/debug": { - "version": "4.3.4", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -10712,6 +8527,8 @@ }, "node_modules/decamelize": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true, "license": "MIT", "engines": { @@ -10720,6 +8537,8 @@ }, "node_modules/decamelize-keys": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", "dev": true, "license": "MIT", "dependencies": { @@ -10735,6 +8554,8 @@ }, "node_modules/decamelize-keys/node_modules/map-obj": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", "dev": true, "license": "MIT", "engines": { @@ -10743,6 +8564,8 @@ }, "node_modules/decode-uri-component": { "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", "dev": true, "license": "MIT", "engines": { @@ -10751,6 +8574,8 @@ }, "node_modules/decompress-response": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==", "dev": true, "license": "MIT", "dependencies": { @@ -10762,16 +8587,21 @@ }, "node_modules/dedent": { "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", "dev": true, "license": "MIT" }, "node_modules/deep-equal": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw==", "license": "MIT" }, "node_modules/deep-extend": { "version": "0.6.0", - "dev": true, + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "license": "MIT", "engines": { "node": ">=4.0.0" @@ -10779,10 +8609,14 @@ }, "node_modules/deep-is": { "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "license": "MIT" }, "node_modules/deepmerge": { "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, "license": "MIT", "engines": { @@ -10791,6 +8625,8 @@ }, "node_modules/defaults": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "license": "MIT", "dependencies": { "clone": "^1.0.2" @@ -10801,25 +8637,34 @@ }, "node_modules/defaults/node_modules/clone": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", "license": "MIT", "engines": { "node": ">=0.8" } }, "node_modules/define-data-property": { - "version": "1.1.1", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/define-properties": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", @@ -10835,6 +8680,8 @@ }, "node_modules/delay": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", + "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", "license": "MIT", "engines": { "node": ">=10" @@ -10845,6 +8692,8 @@ }, "node_modules/delayed-stream": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "license": "MIT", "engines": { "node": ">=0.4.0" @@ -10852,10 +8701,14 @@ }, "node_modules/delegates": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", "license": "MIT" }, "node_modules/denque": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", "license": "Apache-2.0", "engines": { "node": ">=0.10" @@ -10863,6 +8716,8 @@ }, "node_modules/depd": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -10870,6 +8725,8 @@ }, "node_modules/dependency-tree": { "version": "9.0.0", + "resolved": "https://registry.npmjs.org/dependency-tree/-/dependency-tree-9.0.0.tgz", + "integrity": "sha512-osYHZJ1fBSon3lNLw70amAXsQ+RGzXsPvk9HbBgTLbp/bQBmpH5mOmsUvqXU+YEWVU0ZLewsmzOET/8jWswjDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10888,11 +8745,15 @@ }, "node_modules/dependency-tree/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/dependency-tree/node_modules/detective-stylus": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-3.0.0.tgz", + "integrity": "sha512-1xYTzbrduExqMYmte7Qk99IRA3Aa6oV7PYzd+3yDcQXkmENvyGF/arripri6lxRDdNYEb4fZFuHtNRAXbz3iAA==", "dev": true, "license": "MIT", "engines": { @@ -10901,6 +8762,8 @@ }, "node_modules/dependency-tree/node_modules/module-definition": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/module-definition/-/module-definition-4.1.0.tgz", + "integrity": "sha512-rHXi/DpMcD2qcKbPCTklDbX9lBKJrUSl971TW5l6nMpqKCIlzJqmQ8cfEF5M923h2OOLHPDVlh5pJxNyV+AJlw==", "dev": true, "license": "MIT", "dependencies": { @@ -10916,6 +8779,8 @@ }, "node_modules/dependency-tree/node_modules/precinct": { "version": "9.2.1", + "resolved": "https://registry.npmjs.org/precinct/-/precinct-9.2.1.tgz", + "integrity": "sha512-uzKHaTyiVejWW7VJtHInb9KBUq9yl9ojxXGujhjhDmPon2wgZPBKQIKR+6csGqSlUeGXAA4MEFnU6DesxZib+A==", "dev": true, "license": "MIT", "dependencies": { @@ -10941,6 +8806,8 @@ }, "node_modules/dependency-tree/node_modules/precinct/node_modules/commander": { "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", "dev": true, "license": "MIT", "engines": { @@ -10949,6 +8816,8 @@ }, "node_modules/dependency-tree/node_modules/typescript": { "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "license": "Apache-2.0", "bin": { @@ -10961,6 +8830,8 @@ }, "node_modules/destroy": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "license": "MIT", "engines": { "node": ">= 0.8", @@ -10969,6 +8840,8 @@ }, "node_modules/detect-file": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==", "dev": true, "license": "MIT", "engines": { @@ -10977,6 +8850,8 @@ }, "node_modules/detect-indent": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", "dev": true, "license": "MIT", "engines": { @@ -10985,6 +8860,8 @@ }, "node_modules/detect-libc": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", "license": "Apache-2.0", "engines": { "node": ">=8" @@ -10992,6 +8869,8 @@ }, "node_modules/detect-newline": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true, "license": "MIT", "engines": { @@ -11000,6 +8879,8 @@ }, "node_modules/detective-amd": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-4.2.0.tgz", + "integrity": "sha512-RbuEJHz78A8nW7CklkqTzd8lDCN42En53dgEIsya0DilpkwslamSZDasLg8dJyxbw46OxhSQeY+C2btdSkCvQQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11017,6 +8898,8 @@ }, "node_modules/detective-cjs": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/detective-cjs/-/detective-cjs-4.1.0.tgz", + "integrity": "sha512-QxzMwt5MfPLwS7mG30zvnmOvHLx5vyVvjsAV6gQOyuMoBR5G1DhS1eJZ4P10AlH+HSnk93mTcrg3l39+24XCtg==", "dev": true, "license": "MIT", "dependencies": { @@ -11029,6 +8912,8 @@ }, "node_modules/detective-es6": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/detective-es6/-/detective-es6-3.0.1.tgz", + "integrity": "sha512-evPeYIEdK1jK3Oji5p0hX4sPV/1vK+o4ihcWZkMQE6voypSW/cIBiynOLxQk5KOOQbdP8oOAsYqouMTYO5l1sw==", "dev": true, "license": "MIT", "dependencies": { @@ -11040,6 +8925,8 @@ }, "node_modules/detective-less": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/detective-less/-/detective-less-1.0.2.tgz", + "integrity": "sha512-Rps1xDkEEBSq3kLdsdnHZL1x2S4NGDcbrjmd4q+PykK5aJwDdP5MBgrJw1Xo+kyUHuv3JEzPqxr+Dj9ryeDRTA==", "dev": true, "license": "MIT", "dependencies": { @@ -11053,6 +8940,8 @@ }, "node_modules/detective-less/node_modules/node-source-walk": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-4.3.0.tgz", + "integrity": "sha512-8Q1hXew6ETzqKRAs3jjLioSxNfT1cx74ooiF8RlAONwVMcfq+UdzLC2eB5qcPldUxaE5w3ytLkrmV1TGddhZTA==", "dev": true, "license": "MIT", "dependencies": { @@ -11064,6 +8953,8 @@ }, "node_modules/detective-postcss": { "version": "6.1.3", + "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-6.1.3.tgz", + "integrity": "sha512-7BRVvE5pPEvk2ukUWNQ+H2XOq43xENWbH0LcdCE14mwgTBEAMoAx+Fc1rdp76SmyZ4Sp48HlV7VedUnP6GA1Tw==", "dev": true, "license": "MIT", "dependencies": { @@ -11077,6 +8968,8 @@ }, "node_modules/detective-sass": { "version": "4.1.3", + "resolved": "https://registry.npmjs.org/detective-sass/-/detective-sass-4.1.3.tgz", + "integrity": "sha512-xGRbwGaGte57gvEqM8B9GDiURY3El/H49vA6g9wFkxq9zalmTlTAuqWu+BsH0iwonGPruLt55tZZDEZqPc6lag==", "dev": true, "license": "MIT", "dependencies": { @@ -11089,6 +8982,8 @@ }, "node_modules/detective-scss": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/detective-scss/-/detective-scss-3.1.1.tgz", + "integrity": "sha512-FWkfru1jZBhUeuBsOeGKXKAVDrzYFSQFK2o2tuG/nCCFQ0U/EcXC157MNAcR5mmj+mCeneZzlkBOFJTesDjrww==", "dev": true, "license": "MIT", "dependencies": { @@ -11101,6 +8996,8 @@ }, "node_modules/detective-stylus": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-2.0.1.tgz", + "integrity": "sha512-/Tvs1pWLg8eYwwV6kZQY5IslGaYqc/GACxjcaGudiNtN5nKCH6o2WnJK3j0gA3huCnoQcbv8X7oz/c1lnvE3zQ==", "dev": true, "license": "MIT", "engines": { @@ -11109,6 +9006,8 @@ }, "node_modules/detective-typescript": { "version": "9.1.1", + "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-9.1.1.tgz", + "integrity": "sha512-Uc1yVutTF0RRm1YJ3g//i1Cn2vx1kwHj15cnzQP6ff5koNzQ0idc1zAC73ryaWEulA0ElRXFTq6wOqe8vUQ3MA==", "dev": true, "license": "MIT", "dependencies": { @@ -11123,6 +9022,8 @@ }, "node_modules/detective-typescript/node_modules/typescript": { "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "license": "Apache-2.0", "bin": { @@ -11135,6 +9036,8 @@ }, "node_modules/dezalgo": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", "dev": true, "license": "ISC", "dependencies": { @@ -11144,6 +9047,8 @@ }, "node_modules/diff": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -11152,6 +9057,8 @@ }, "node_modules/diff-sequences": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "license": "MIT", "engines": { @@ -11160,6 +9067,8 @@ }, "node_modules/dir-glob": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "license": "MIT", "dependencies": { "path-type": "^4.0.0" @@ -11170,6 +9079,8 @@ }, "node_modules/doctrine": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" @@ -11180,6 +9091,8 @@ }, "node_modules/dot-prop": { "version": "4.2.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz", + "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11190,17 +9103,21 @@ } }, "node_modules/dotenv": { - "version": "16.3.1", + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", "license": "BSD-2-Clause", "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" + "url": "https://dotenvx.com" } }, "node_modules/dotgitignore": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/dotgitignore/-/dotgitignore-2.1.0.tgz", + "integrity": "sha512-sCm11ak2oY6DglEPpCB8TixLjWAxd3kJTs6UIcSasNYxXdFPV+YKlye92c8H4kKFqV5qYMIh7d+cYecEg0dIkA==", "dev": true, "license": "ISC", "dependencies": { @@ -11213,6 +9130,8 @@ }, "node_modules/dotgitignore/node_modules/find-up": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "license": "MIT", "dependencies": { @@ -11224,6 +9143,8 @@ }, "node_modules/dotgitignore/node_modules/locate-path": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "license": "MIT", "dependencies": { @@ -11236,6 +9157,8 @@ }, "node_modules/dotgitignore/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -11250,6 +9173,8 @@ }, "node_modules/dotgitignore/node_modules/p-locate": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11261,6 +9186,8 @@ }, "node_modules/dotgitignore/node_modules/path-exists": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true, "license": "MIT", "engines": { @@ -11269,6 +9196,8 @@ }, "node_modules/dreamopt": { "version": "0.8.0", + "resolved": "https://registry.npmjs.org/dreamopt/-/dreamopt-0.8.0.tgz", + "integrity": "sha512-vyJTp8+mC+G+5dfgsY+r3ckxlz+QMX40VjPQsZc5gxVAxLmi64TBoVkP54A/pRAXMXsbu2GMMBrZPxNv23waMg==", "dependencies": { "wordwrap": ">=0.0.2" }, @@ -11276,18 +9205,38 @@ "node": ">=0.4.0" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/duplexer3": { "version": "0.1.5", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz", + "integrity": "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==", "dev": true, "license": "BSD-3-Clause" }, "node_modules/eastasianwidth": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true, "license": "MIT" }, "node_modules/ee-first": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "license": "MIT" }, "node_modules/ejs": { @@ -11295,6 +9244,7 @@ "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "jake": "^10.8.5" }, @@ -11306,12 +9256,16 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.625", + "version": "1.5.112", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.112.tgz", + "integrity": "sha512-oen93kVyqSb3l+ziUgzIOlWt/oOuy4zRmpwestMn4rhFWAoFJeFuCVte9F2fASjeZZo7l/Cif9TiyrdW4CwEMA==", "dev": true, "license": "ISC" }, "node_modules/emittery": { "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, "license": "MIT", "engines": { @@ -11323,10 +9277,14 @@ }, "node_modules/emoji-regex": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT" }, "node_modules/empty-dir": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/empty-dir/-/empty-dir-1.0.0.tgz", + "integrity": "sha512-97qcDM6mUA1jAeX6cktw7akc5awIGA+VIkA5MygKOKA+c2Vseo/xwKN0JNJTUhZUtPwZboKVD2p1xu+sV/F4xA==", "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -11334,10 +9292,13 @@ }, "node_modules/enabled": { "version": "2.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" }, "node_modules/encodeurl": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -11345,13 +9306,17 @@ }, "node_modules/end-of-stream": { "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "license": "MIT", "dependencies": { "once": "^1.4.0" } }, "node_modules/enhanced-resolve": { - "version": "5.15.0", + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", + "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", "dev": true, "license": "MIT", "dependencies": { @@ -11364,6 +9329,8 @@ }, "node_modules/entities": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", + "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -11375,6 +9342,8 @@ }, "node_modules/error-ex": { "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "license": "MIT", "dependencies": { "is-arrayish": "^0.2.1" @@ -11382,54 +9351,70 @@ }, "node_modules/error-stack-parser": { "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", "license": "MIT", "dependencies": { "stackframe": "^1.3.4" } }, "node_modules/es-abstract": { - "version": "1.22.3", - "license": "MIT", - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "arraybuffer.prototype.slice": "^1.0.2", - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.5", - "es-set-tostringtag": "^2.0.1", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.2", - "get-symbol-description": "^1.0.0", - "globalthis": "^1.0.3", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0", - "internal-slot": "^1.0.5", - "is-array-buffer": "^3.0.2", + "version": "1.23.9", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz", + "integrity": "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==", + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.0", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.12", - "is-weakref": "^1.0.2", - "object-inspect": "^1.13.1", + "is-data-view": "^1.0.2", + "is-regex": "^1.2.1", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.0", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.3", "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.1", - "safe-array-concat": "^1.0.1", - "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", - "string.prototype.trimstart": "^1.0.7", - "typed-array-buffer": "^1.0.0", - "typed-array-byte-length": "^1.0.0", - "typed-array-byte-offset": "^1.0.0", - "typed-array-length": "^1.0.4", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.13" + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.3", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.18" }, "engines": { "node": ">= 0.4" @@ -11438,32 +9423,72 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-set-tostringtag": { - "version": "2.0.2", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.2", - "has-tostringtag": "^1.0.0", - "hasown": "^2.0.0" + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-shim-unscopables": { - "version": "1.0.2", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", "license": "MIT", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/es-to-primitive": { - "version": "1.2.1", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", "license": "MIT", "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" }, "engines": { "node": ">= 0.4" @@ -11474,10 +9499,14 @@ }, "node_modules/es6-promise": { "version": "3.3.1", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "integrity": "sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==", "license": "MIT" }, "node_modules/escalade": { - "version": "3.1.1", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "license": "MIT", "engines": { @@ -11486,10 +9515,14 @@ }, "node_modules/escape-html": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "license": "MIT" }, "node_modules/escape-string-regexp": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "license": "MIT", "engines": { "node": ">=0.8.0" @@ -11497,6 +9530,8 @@ }, "node_modules/escodegen": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -11517,6 +9552,8 @@ }, "node_modules/escodegen/node_modules/estraverse": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -11525,6 +9562,8 @@ }, "node_modules/escodegen/node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "license": "BSD-3-Clause", "optional": true, @@ -11533,14 +9572,17 @@ } }, "node_modules/eslint": { - "version": "8.56.0", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -11587,6 +9629,8 @@ }, "node_modules/eslint-config-airbnb-base": { "version": "15.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", + "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", "license": "MIT", "dependencies": { "confusing-browser-globals": "^1.0.10", @@ -11604,6 +9648,8 @@ }, "node_modules/eslint-config-airbnb-base/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -11611,6 +9657,8 @@ }, "node_modules/eslint-config-airbnb-typescript": { "version": "17.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-17.1.0.tgz", + "integrity": "sha512-GPxI5URre6dDpJ0CtcthSZVBAfI+Uw7un5OYNVxP2EYi3H81Jw701yFP7AU+/vCE7xBtFmjge7kfhhk4+RAiig==", "license": "MIT", "dependencies": { "eslint-config-airbnb-base": "^15.0.0" @@ -11624,6 +9672,8 @@ }, "node_modules/eslint-config-prettier": { "version": "8.10.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", + "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", "dev": true, "license": "MIT", "bin": { @@ -11635,6 +9685,8 @@ }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "license": "MIT", "dependencies": { "debug": "^3.2.7", @@ -11644,13 +9696,17 @@ }, "node_modules/eslint-import-resolver-node/node_modules/debug": { "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-module-utils": { - "version": "2.8.0", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", + "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", "license": "MIT", "dependencies": { "debug": "^3.2.7" @@ -11666,42 +9722,50 @@ }, "node_modules/eslint-module-utils/node_modules/debug": { "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-plugin-import": { - "version": "2.29.1", + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", + "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "license": "MIT", "dependencies": { - "array-includes": "^3.1.7", - "array.prototype.findlastindex": "^1.2.3", + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.8", + "array.prototype.findlastindex": "^1.2.5", "array.prototype.flat": "^1.3.2", "array.prototype.flatmap": "^1.3.2", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.8.0", - "hasown": "^2.0.0", - "is-core-module": "^2.13.1", + "eslint-module-utils": "^2.12.0", + "hasown": "^2.0.2", + "is-core-module": "^2.15.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.fromentries": "^2.0.7", - "object.groupby": "^1.0.1", - "object.values": "^1.1.7", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.0", "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.8", "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" }, "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, "node_modules/eslint-plugin-import/node_modules/debug": { "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "license": "MIT", "dependencies": { "ms": "^2.1.1" @@ -11709,6 +9773,8 @@ }, "node_modules/eslint-plugin-import/node_modules/doctrine": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" @@ -11719,6 +9785,8 @@ }, "node_modules/eslint-plugin-import/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -11726,6 +9794,8 @@ }, "node_modules/eslint-plugin-json": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-json/-/eslint-plugin-json-3.1.0.tgz", + "integrity": "sha512-MrlG2ynFEHe7wDGwbUuFPsaT2b1uhuEFhJ+W1f1u+1C2EkXmTYJp4B1aAdQQ8M+CC3t//N/oRKiIVw14L2HR1g==", "dev": true, "license": "MIT", "dependencies": { @@ -11737,10 +9807,11 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", - "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.3.tgz", + "integrity": "sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==", "dev": true, + "license": "MIT", "dependencies": { "prettier-linter-helpers": "^1.0.0", "synckit": "^0.9.1" @@ -11768,6 +9839,8 @@ }, "node_modules/eslint-plugin-sonarjs": { "version": "0.19.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.19.0.tgz", + "integrity": "sha512-6+s5oNk5TFtVlbRxqZN7FIGmjdPCYQKaTzFPmqieCmsU1kBYDzndTeQav0xtQNwZJWu5awWfTGe8Srq9xFOGnw==", "dev": true, "license": "LGPL-3.0", "engines": { @@ -11779,6 +9852,8 @@ }, "node_modules/eslint-plugin-unicorn": { "version": "46.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-46.0.1.tgz", + "integrity": "sha512-setGhMTiLAddg1asdwjZ3hekIN5zLznNa5zll7pBPwFOka6greCKDQydfqy4fqyUhndi74wpDzClSQMEcmOaew==", "dev": true, "license": "MIT", "dependencies": { @@ -11811,6 +9886,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -11823,6 +9900,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -11834,6 +9913,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -11848,6 +9929,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -11859,6 +9942,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/read-pkg": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "dev": true, "license": "MIT", "dependencies": { @@ -11873,6 +9958,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/read-pkg-up": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, "license": "MIT", "dependencies": { @@ -11889,6 +9976,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/read-pkg/node_modules/type-fest": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -11897,6 +9986,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/type-fest": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -11905,6 +9996,8 @@ }, "node_modules/eslint-scope": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", @@ -11916,6 +10009,8 @@ }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -11926,6 +10021,8 @@ }, "node_modules/eslint/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -11940,6 +10037,8 @@ }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -11953,6 +10052,8 @@ }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -11967,6 +10068,8 @@ }, "node_modules/eslint/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -11977,10 +10080,14 @@ }, "node_modules/eslint/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "license": "MIT" }, "node_modules/eslint/node_modules/escape-string-regexp": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "license": "MIT", "engines": { "node": ">=10" @@ -11991,6 +10098,8 @@ }, "node_modules/eslint/node_modules/eslint-scope": { "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", @@ -12005,6 +10114,8 @@ }, "node_modules/eslint/node_modules/estraverse": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -12012,6 +10123,8 @@ }, "node_modules/eslint/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "license": "MIT", "engines": { "node": ">=8" @@ -12019,10 +10132,14 @@ }, "node_modules/eslint/node_modules/json-schema-traverse": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "license": "MIT" }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -12033,6 +10150,8 @@ }, "node_modules/espree": { "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.9.0", @@ -12048,6 +10167,8 @@ }, "node_modules/esprima": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", @@ -12058,7 +10179,9 @@ } }, "node_modules/esquery": { - "version": "1.5.0", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" @@ -12069,6 +10192,8 @@ }, "node_modules/esquery/node_modules/estraverse": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -12076,6 +10201,8 @@ }, "node_modules/esrecurse": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" @@ -12086,6 +10213,8 @@ }, "node_modules/esrecurse/node_modules/estraverse": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -12093,6 +10222,8 @@ }, "node_modules/estraverse": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -12100,6 +10231,8 @@ }, "node_modules/esutils": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" @@ -12107,11 +10240,15 @@ }, "node_modules/eventemitter3": { "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", "dev": true, "license": "MIT" }, "node_modules/events": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "license": "MIT", "engines": { "node": ">=0.8.x" @@ -12119,6 +10256,8 @@ }, "node_modules/execa": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "license": "MIT", "dependencies": { @@ -12141,13 +10280,26 @@ }, "node_modules/exit": { "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", "dev": true, "engines": { "node": ">= 0.8.0" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, "node_modules/expand-tilde": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", "dev": true, "license": "MIT", "dependencies": { @@ -12159,6 +10311,8 @@ }, "node_modules/expect": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "license": "MIT", "dependencies": { @@ -12174,6 +10328,8 @@ }, "node_modules/expose-gc": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/expose-gc/-/expose-gc-1.0.0.tgz", + "integrity": "sha512-ecOHrdm+zyOCGIwX18/1RHkUWgxDqGGRiGhaNC+42jReTtudbm2ID/DMa/wpaHwqy5YQHPZvsDqRM2F2iZ0uVA==", "dev": true, "license": "MIT", "engines": { @@ -12182,6 +10338,8 @@ }, "node_modules/external-editor": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "license": "MIT", "dependencies": { @@ -12195,22 +10353,28 @@ }, "node_modules/fast-deep-equal": { "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "license": "MIT" }, "node_modules/fast-diff": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", "dev": true, "license": "Apache-2.0" }, "node_modules/fast-glob": { - "version": "3.3.2", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" @@ -12218,6 +10382,8 @@ }, "node_modules/fast-glob/node_modules/glob-parent": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "license": "ISC", "dependencies": { "is-glob": "^4.0.1" @@ -12228,50 +10394,71 @@ }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "license": "MIT" }, "node_modules/fast-printf": { - "version": "1.6.9", + "version": "1.6.10", + "resolved": "https://registry.npmjs.org/fast-printf/-/fast-printf-1.6.10.tgz", + "integrity": "sha512-GwTgG9O4FVIdShhbVF3JxOgSBY2+ePGsu2V/UONgoCPzF9VY6ZdBMKsHKCYQHZwNk3qNouUolRDsgVxcVA5G1w==", "dev": true, "license": "BSD-3-Clause", - "dependencies": { - "boolean": "^3.1.4" - }, "engines": { "node": ">=10.0" } }, "node_modules/fast-safe-stringify": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", "dev": true, "license": "MIT" }, - "node_modules/fast-xml-parser": { - "version": "4.4.1", + "node_modules/fast-uri": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", + "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", "funding": [ { "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" + "url": "https://github.com/sponsors/fastify" }, { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/fast-xml-parser": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz", + "integrity": "sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" } ], "license": "MIT", "dependencies": { - "strnum": "^1.0.5" + "strnum": "^1.1.1" }, "bin": { "fxparser": "src/cli/cli.js" } }, "node_modules/fastq": { - "version": "1.16.0", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "license": "ISC", "dependencies": { "reusify": "^1.0.4" @@ -12279,6 +10466,8 @@ }, "node_modules/fb-watchman": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -12287,10 +10476,13 @@ }, "node_modules/fecha": { "version": "4.2.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", + "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==" }, "node_modules/figures": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "license": "MIT", "dependencies": { @@ -12305,6 +10497,8 @@ }, "node_modules/file-entry-cache": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "license": "MIT", "dependencies": { "flat-cache": "^3.0.4" @@ -12315,6 +10509,8 @@ }, "node_modules/file-uri-to-path": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", "license": "MIT" }, "node_modules/filelist": { @@ -12322,6 +10518,7 @@ "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", "dev": true, + "license": "Apache-2.0", "dependencies": { "minimatch": "^5.0.1" } @@ -12331,6 +10528,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -12340,6 +10538,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -12349,6 +10548,8 @@ }, "node_modules/filing-cabinet": { "version": "3.3.1", + "resolved": "https://registry.npmjs.org/filing-cabinet/-/filing-cabinet-3.3.1.tgz", + "integrity": "sha512-renEK4Hh6DUl9Vl22Y3cxBq1yh8oNvbAdXnhih0wVpmea+uyKjC9K4QeRjUaybIiIewdzfum+Fg15ZqJ/GyCaA==", "dev": true, "license": "MIT", "dependencies": { @@ -12375,11 +10576,15 @@ }, "node_modules/filing-cabinet/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/filing-cabinet/node_modules/typescript": { "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", "dev": true, "license": "Apache-2.0", "bin": { @@ -12392,6 +10597,8 @@ }, "node_modules/fill-range": { "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -12402,6 +10609,8 @@ }, "node_modules/find-node-modules": { "version": "2.1.3", + "resolved": "https://registry.npmjs.org/find-node-modules/-/find-node-modules-2.1.3.tgz", + "integrity": "sha512-UC2I2+nx1ZuOBclWVNdcnbDR5dlrOdVb7xNjmT/lHE+LsgztWks3dG7boJ37yTS/venXw84B/mAW9uHVoC5QRg==", "dev": true, "license": "MIT", "dependencies": { @@ -12411,11 +10620,15 @@ }, "node_modules/find-root": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", "dev": true, "license": "MIT" }, "node_modules/find-up": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "license": "MIT", "dependencies": { "locate-path": "^6.0.0", @@ -12430,6 +10643,8 @@ }, "node_modules/findit2": { "version": "2.2.3", + "resolved": "https://registry.npmjs.org/findit2/-/findit2-2.2.3.tgz", + "integrity": "sha512-lg/Moejf4qXovVutL0Lz4IsaPoNYMuxt4PA0nGqFxnJ1CTTGGlEO2wKgoDpwknhvZ8k4Q2F+eesgkLbG2Mxfog==", "license": "MIT", "engines": { "node": ">=0.8.22" @@ -12437,6 +10652,8 @@ }, "node_modules/findup-sync": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-4.0.0.tgz", + "integrity": "sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12451,6 +10668,8 @@ }, "node_modules/flat": { "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "license": "BSD-3-Clause", "bin": { "flat": "cli.js" @@ -12458,6 +10677,8 @@ }, "node_modules/flat-cache": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "license": "MIT", "dependencies": { "flatted": "^3.2.9", @@ -12469,20 +10690,28 @@ } }, "node_modules/flatted": { - "version": "3.2.9", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "license": "ISC" }, "node_modules/flatten": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.3.tgz", + "integrity": "sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==", + "deprecated": "flatten is deprecated in favor of utility frameworks such as lodash.", "dev": true, "license": "MIT" }, "node_modules/fn.name": { "version": "1.1.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "node_modules/follow-redirects": { - "version": "1.15.6", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "funding": [ { "type": "individual", @@ -12500,18 +10729,28 @@ } }, "node_modules/for-each": { - "version": "0.3.3", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", "license": "MIT", "dependencies": { - "is-callable": "^1.1.3" + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/foreground-child": { - "version": "3.1.1", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, "license": "ISC", "dependencies": { - "cross-spawn": "^7.0.0", + "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" }, "engines": { @@ -12523,6 +10762,8 @@ }, "node_modules/foreground-child/node_modules/signal-exit": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, "license": "ISC", "engines": { @@ -12533,11 +10774,14 @@ } }, "node_modules/form-data": { - "version": "4.0.0", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" }, "engines": { @@ -12546,6 +10790,8 @@ }, "node_modules/formidable": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.2.tgz", + "integrity": "sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==", "dev": true, "license": "MIT", "dependencies": { @@ -12560,6 +10806,8 @@ }, "node_modules/fresh": { "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -12567,6 +10815,8 @@ }, "node_modules/from2": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", "dev": true, "license": "MIT", "dependencies": { @@ -12574,8 +10824,16 @@ "readable-stream": "^2.0.0" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" + }, "node_modules/fs-extra": { "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12590,6 +10848,8 @@ }, "node_modules/fs-minipass": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "license": "ISC", "dependencies": { "minipass": "^3.0.0" @@ -12600,6 +10860,8 @@ }, "node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -12610,39 +10872,37 @@ }, "node_modules/fs-minipass/node_modules/yallist": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "license": "ISC" }, "node_modules/fs.realpath": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "license": "ISC" }, - "node_modules/fsevents": { - "version": "2.3.3", - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/function.prototype.name": { - "version": "1.1.6", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" }, "engines": { "node": ">= 0.4" @@ -12653,6 +10913,8 @@ }, "node_modules/functions-have-names": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -12660,6 +10922,9 @@ }, "node_modules/gauge": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", "license": "ISC", "dependencies": { "aproba": "^1.0.3 || ^2.0.0", @@ -12678,6 +10943,8 @@ }, "node_modules/gensync": { "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, "license": "MIT", "engines": { @@ -12686,6 +10953,8 @@ }, "node_modules/get-amd-module-type": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-amd-module-type/-/get-amd-module-type-4.1.0.tgz", + "integrity": "sha512-0e/eK6vTGCnSfQ6eYs3wtH05KotJYIP7ZIZEueP/KlA+0dIAEs8bYFvOd/U56w1vfjhJqBagUxVMyy9Tr/cViQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12698,6 +10967,8 @@ }, "node_modules/get-caller-file": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, "license": "ISC", "engines": { @@ -12705,13 +10976,24 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.2", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -12719,11 +11001,15 @@ }, "node_modules/get-own-enumerable-property-symbols": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", "dev": true, "license": "ISC" }, "node_modules/get-package-type": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, "license": "MIT", "engines": { @@ -12732,6 +11018,8 @@ }, "node_modules/get-pkg-repo": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", + "integrity": "sha512-xPCyvcEOxCJDxhBfXDNH+zA7mIRGb2aY1gIUJWsZkpJbp1BLHl+/Sycg26Dv+ZbZAJkO61tzbBtqHUi30NGBvg==", "dev": true, "license": "MIT", "dependencies": { @@ -12747,6 +11035,8 @@ }, "node_modules/get-pkg-repo/node_modules/camelcase": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha512-DLIsRzJVBQu72meAKPkWQOLcujdXT32hwdfnkI1frSiSRMK1MofjKHf+MEx0SB6fjEFXL8fBDv1dKymBlOp4Qw==", "dev": true, "license": "MIT", "engines": { @@ -12755,6 +11045,8 @@ }, "node_modules/get-pkg-repo/node_modules/camelcase-keys": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha512-bA/Z/DERHKqoEOrp+qeGKw1QlvEQkGZSc0XaY6VnTxZr+Kv1G5zFwttpjv8qxZ/sBPT4nthwZaAcsAZTJlSKXQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12767,6 +11059,8 @@ }, "node_modules/get-pkg-repo/node_modules/find-up": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", "dev": true, "license": "MIT", "dependencies": { @@ -12779,6 +11073,8 @@ }, "node_modules/get-pkg-repo/node_modules/indent-string": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha512-aqwDFWSgSgfRaEwao5lg5KEcVd/2a+D1rvoG7NdilmYz0NwRk6StWpWdz/Hpk34MKPpx7s8XxUqimfcQK6gGlg==", "dev": true, "license": "MIT", "dependencies": { @@ -12790,6 +11086,8 @@ }, "node_modules/get-pkg-repo/node_modules/load-json-file": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", "dev": true, "license": "MIT", "dependencies": { @@ -12805,6 +11103,8 @@ }, "node_modules/get-pkg-repo/node_modules/map-obj": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", "dev": true, "license": "MIT", "engines": { @@ -12813,6 +11113,8 @@ }, "node_modules/get-pkg-repo/node_modules/meow": { "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha512-TNdwZs0skRlpPpCUK25StC4VH+tP5GgeY1HQOOGP+lQ2xtdkN2VtT/5tiX9k3IWpkBPV9b3LsAWXn4GGi/PrSA==", "dev": true, "license": "MIT", "dependencies": { @@ -12833,6 +11135,8 @@ }, "node_modules/get-pkg-repo/node_modules/parse-json": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12844,6 +11148,8 @@ }, "node_modules/get-pkg-repo/node_modules/path-exists": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12855,6 +11161,8 @@ }, "node_modules/get-pkg-repo/node_modules/path-type": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", "dev": true, "license": "MIT", "dependencies": { @@ -12868,6 +11176,8 @@ }, "node_modules/get-pkg-repo/node_modules/read-pkg": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12881,6 +11191,8 @@ }, "node_modules/get-pkg-repo/node_modules/read-pkg-up": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", "dev": true, "license": "MIT", "dependencies": { @@ -12893,6 +11205,8 @@ }, "node_modules/get-pkg-repo/node_modules/redent": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha512-qtW5hKzGQZqKoh6JNSD+4lfitfPKGz42e6QwiRmPM5mmKtR0N41AbJRYu0xJi7nhOJ4WDgRkKvAk6tw4WIwR4g==", "dev": true, "license": "MIT", "dependencies": { @@ -12905,6 +11219,8 @@ }, "node_modules/get-pkg-repo/node_modules/strip-bom": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", "dev": true, "license": "MIT", "dependencies": { @@ -12916,6 +11232,8 @@ }, "node_modules/get-pkg-repo/node_modules/strip-indent": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha512-I5iQq6aFMM62fBEAIB/hXzwJD6EEZ0xEGCX2t7oXqaKPIRgt4WruAQ285BISgdkP+HLGWyeGmNJcpIwFeRYRUA==", "dev": true, "license": "MIT", "dependencies": { @@ -12928,8 +11246,23 @@ "node": ">=0.10.0" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stdin": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha512-F5aQMywwJ2n85s4hJPTT9RPxGmubonuB10MNYo17/xph174n2MIR33HRguhzVag10O/npM7SPk73LMZNP+FaWw==", "dev": true, "license": "MIT", "engines": { @@ -12938,6 +11271,8 @@ }, "node_modules/get-stream": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "license": "MIT", "engines": { @@ -12948,11 +11283,14 @@ } }, "node_modules/get-symbol-description": { - "version": "1.0.0", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -12963,6 +11301,8 @@ }, "node_modules/get-value": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-3.0.1.tgz", + "integrity": "sha512-mKZj9JLQrwMBtj5wxi6MH8Z5eSKaERpAwjg43dPtlGI1ZVEgH/qC7T8/6R2OBSUA+zzHBZgICsVJaEIV2tKTDA==", "license": "MIT", "dependencies": { "isobject": "^3.0.1" @@ -12973,6 +11313,8 @@ }, "node_modules/gh-got": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/gh-got/-/gh-got-7.1.0.tgz", + "integrity": "sha512-KeWkkhresa7sbpzQLYzITMgez5rMigUsijhmSAHcLDORIMUbdlkdoZyaN1wQvIjmUZnyb/wkAPaXb4MQKX0mdQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12985,6 +11327,8 @@ }, "node_modules/git-raw-commits": { "version": "2.0.11", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.11.tgz", + "integrity": "sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==", "dev": true, "license": "MIT", "dependencies": { @@ -13003,6 +11347,8 @@ }, "node_modules/git-raw-commits/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -13016,6 +11362,8 @@ }, "node_modules/git-raw-commits/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -13024,6 +11372,8 @@ }, "node_modules/git-remote-origin-url": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", + "integrity": "sha512-eU+GGrZgccNJcsDH5LkXR3PB9M958hxc7sbA8DFJjrv9j4L2P/eZfKhM+QD6wyzpiv+b1BpK0XrYCxkovtjSLw==", "dev": true, "license": "MIT", "dependencies": { @@ -13036,6 +11386,8 @@ }, "node_modules/git-semver-tags": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-2.0.3.tgz", + "integrity": "sha512-tj4FD4ww2RX2ae//jSrXZzrocla9db5h0V7ikPl1P/WwoZar9epdUhwR7XHXSgc+ZkNq72BEEerqQuicoEQfzA==", "dev": true, "license": "MIT", "dependencies": { @@ -13051,6 +11403,8 @@ }, "node_modules/git-semver-tags/node_modules/camelcase": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==", "dev": true, "license": "MIT", "engines": { @@ -13059,6 +11413,8 @@ }, "node_modules/git-semver-tags/node_modules/camelcase-keys": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha512-Ej37YKYbFUI8QiYlvj9YHb6/Z60dZyPJW0Cs8sFilMbd2lP0bw3ylAq9yJkK4lcTA2dID5fG8LjmJYbO7kWb7Q==", "dev": true, "license": "MIT", "dependencies": { @@ -13072,6 +11428,8 @@ }, "node_modules/git-semver-tags/node_modules/indent-string": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha512-BYqTHXTGUIvg7t1r4sJNKcbDZkL92nkXA8YtRpbjFHRHGDL/NtUeiBJMeE60kIFN/Mg8ESaWQvftaYMGJzQZCQ==", "dev": true, "license": "MIT", "engines": { @@ -13080,6 +11438,8 @@ }, "node_modules/git-semver-tags/node_modules/map-obj": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha512-TzQSV2DiMYgoF5RycneKVUzIa9bQsj/B3tTgsE3dOGqlzHnGIDaC7XBE7grnA+8kZPnfqSGFe95VHc2oc0VFUQ==", "dev": true, "license": "MIT", "engines": { @@ -13088,6 +11448,8 @@ }, "node_modules/git-semver-tags/node_modules/meow": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", "dev": true, "license": "MIT", "dependencies": { @@ -13107,6 +11469,8 @@ }, "node_modules/git-semver-tags/node_modules/minimist-options": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13119,6 +11483,8 @@ }, "node_modules/git-semver-tags/node_modules/quick-lru": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha512-tRS7sTgyxMXtLum8L65daJnHUhfDUgboRdcWW2bR9vBfrj2+O5HSMbQOJfJJjIVSPFqbBCF37FpwWXGitDc5tA==", "dev": true, "license": "MIT", "engines": { @@ -13127,6 +11493,8 @@ }, "node_modules/git-semver-tags/node_modules/redent": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha512-XNwrTx77JQCEMXTeb8movBKuK75MgH0RZkujNuDKCezemx/voapl9i2gCSi8WWm8+ox5ycJi1gxF22fR7c0Ciw==", "dev": true, "license": "MIT", "dependencies": { @@ -13139,6 +11507,8 @@ }, "node_modules/git-semver-tags/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -13147,6 +11517,8 @@ }, "node_modules/git-semver-tags/node_modules/strip-indent": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha512-RsSNPLpq6YUL7QYy44RnPVTn/lcVZtb48Uof3X5JLbF4zD/Gs7ZFDv2HWol+leoQN2mT86LAzSshGfkTlSOpsA==", "dev": true, "license": "MIT", "engines": { @@ -13155,35 +11527,45 @@ }, "node_modules/gitconfiglocal": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", + "integrity": "sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ==", "dev": true, "license": "BSD", "dependencies": { "ini": "^1.3.2" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT" + }, "node_modules/glob": { - "version": "10.3.10", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-parent": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "license": "ISC", "dependencies": { "is-glob": "^4.0.3" @@ -13194,6 +11576,8 @@ }, "node_modules/glob/node_modules/brace-expansion": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "license": "MIT", "dependencies": { @@ -13201,7 +11585,9 @@ } }, "node_modules/glob/node_modules/minimatch": { - "version": "9.0.3", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "license": "ISC", "dependencies": { @@ -13216,6 +11602,8 @@ }, "node_modules/global-dirs": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==", "dev": true, "license": "MIT", "dependencies": { @@ -13227,6 +11615,8 @@ }, "node_modules/global-modules": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "dev": true, "license": "MIT", "dependencies": { @@ -13240,6 +11630,8 @@ }, "node_modules/global-prefix": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", "dev": true, "license": "MIT", "dependencies": { @@ -13255,6 +11647,8 @@ }, "node_modules/global-prefix/node_modules/which": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "license": "ISC", "dependencies": { @@ -13266,6 +11660,8 @@ }, "node_modules/globals": { "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "license": "MIT", "dependencies": { "type-fest": "^0.20.2" @@ -13278,10 +11674,13 @@ } }, "node_modules/globalthis": { - "version": "1.0.3", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "license": "MIT", "dependencies": { - "define-properties": "^1.1.3" + "define-properties": "^1.2.1", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -13292,6 +11691,8 @@ }, "node_modules/globby": { "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "license": "MIT", "dependencies": { "array-union": "^2.1.0", @@ -13310,6 +11711,8 @@ }, "node_modules/gonzales-pe": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", + "integrity": "sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13323,10 +11726,12 @@ } }, "node_modules/gopd": { - "version": "1.0.1", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.1.3" + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -13334,6 +11739,8 @@ }, "node_modules/got": { "version": "8.3.2", + "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", + "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", "dev": true, "license": "MIT", "dependencies": { @@ -13361,6 +11768,8 @@ }, "node_modules/got/node_modules/get-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==", "dev": true, "license": "MIT", "engines": { @@ -13369,6 +11778,8 @@ }, "node_modules/got/node_modules/pify": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", "dev": true, "license": "MIT", "engines": { @@ -13377,20 +11788,28 @@ }, "node_modules/graceful-fs": { "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true, "license": "ISC" }, "node_modules/graphemer": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "license": "MIT" }, "node_modules/growly": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", + "integrity": "sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw==", "dev": true, "license": "MIT" }, "node_modules/handlebars": { "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "license": "MIT", "dependencies": { "minimist": "^1.2.5", @@ -13410,6 +11829,8 @@ }, "node_modules/handlebars/node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -13417,6 +11838,8 @@ }, "node_modules/hard-rejection": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", "dev": true, "license": "MIT", "engines": { @@ -13424,32 +11847,46 @@ } }, "node_modules/has-bigints": { - "version": "1.0.2", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-flag": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/has-property-descriptors": { - "version": "1.0.1", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.2" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-proto": { - "version": "1.0.1", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -13459,6 +11896,8 @@ }, "node_modules/has-symbol-support-x": { "version": "1.4.2", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", "dev": true, "license": "MIT", "engines": { @@ -13466,7 +11905,9 @@ } }, "node_modules/has-symbols": { - "version": "1.0.3", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -13477,6 +11918,8 @@ }, "node_modules/has-to-string-tag-x": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", "dev": true, "license": "MIT", "dependencies": { @@ -13487,10 +11930,12 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "license": "MIT", "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -13501,10 +11946,14 @@ }, "node_modules/has-unicode": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", "license": "ISC" }, "node_modules/has-value": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-2.0.2.tgz", + "integrity": "sha512-ybKOlcRsK2MqrM3Hmz/lQxXHZ6ejzSPzpNabKB45jb5qDgJvKPa3SdapTsTLwEb9WltgWpOmNax7i+DzNOk4TA==", "license": "MIT", "dependencies": { "get-value": "^3.0.0", @@ -13516,6 +11965,8 @@ }, "node_modules/has-values": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-2.0.1.tgz", + "integrity": "sha512-+QdH3jOmq9P8GfdjFg0eJudqx1FqU62NQJ4P16rOEHeRdl7ckgwn6uqQjzYE0ZoHVV/e5E2esuJ5Gl5+HUW19w==", "license": "MIT", "dependencies": { "kind-of": "^6.0.2" @@ -13525,7 +11976,9 @@ } }, "node_modules/hasown": { - "version": "2.0.0", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -13536,10 +11989,14 @@ }, "node_modules/heap": { "version": "0.2.7", + "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.7.tgz", + "integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==", "license": "MIT" }, "node_modules/hexoid": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", + "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==", "dev": true, "license": "MIT", "engines": { @@ -13548,6 +12005,8 @@ }, "node_modules/homedir-polyfill": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", "dev": true, "license": "MIT", "dependencies": { @@ -13559,15 +12018,21 @@ }, "node_modules/hosted-git-info": { "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "license": "ISC" }, "node_modules/html-escaper": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true, "license": "MIT" }, "node_modules/http-assert": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.5.0.tgz", + "integrity": "sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==", "license": "MIT", "dependencies": { "deep-equal": "~1.0.1", @@ -13579,6 +12044,8 @@ }, "node_modules/http-assert/node_modules/depd": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -13586,6 +12053,8 @@ }, "node_modules/http-assert/node_modules/http-errors": { "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", "license": "MIT", "dependencies": { "depd": "~1.1.2", @@ -13600,6 +12069,8 @@ }, "node_modules/http-assert/node_modules/statuses": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -13607,11 +12078,15 @@ }, "node_modules/http-cache-semantics": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true, "license": "BSD-2-Clause" }, "node_modules/http-errors": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "license": "MIT", "dependencies": { "depd": "2.0.0", @@ -13625,7 +12100,9 @@ } }, "node_modules/http-graceful-shutdown": { - "version": "3.1.13", + "version": "3.1.14", + "resolved": "https://registry.npmjs.org/http-graceful-shutdown/-/http-graceful-shutdown-3.1.14.tgz", + "integrity": "sha512-aTbGAZDUtRt7gRmU+li7rt5WbJeemULZHLNrycJ1dRBU80Giut6NvzG8h5u1TW1zGHXkPGpEtoEKhPKogIRKdA==", "license": "MIT", "dependencies": { "debug": "^4.3.4" @@ -13636,6 +12113,8 @@ }, "node_modules/http-terminator": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/http-terminator/-/http-terminator-3.2.0.tgz", + "integrity": "sha512-JLjck1EzPaWjsmIf8bziM3p9fgR1Y3JoUKAkyYEbZmFrIvJM6I8vVJfBGWlEtV9IWOvzNnaTtjuwZeBY2kwB4g==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -13650,6 +12129,8 @@ }, "node_modules/http-terminator/node_modules/type-fest": { "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -13661,6 +12142,8 @@ }, "node_modules/https-proxy-agent": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "license": "MIT", "dependencies": { "agent-base": "6", @@ -13671,7 +12154,9 @@ } }, "node_modules/human-format": { - "version": "1.2.0", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/human-format/-/human-format-1.2.1.tgz", + "integrity": "sha512-o5Ldz62VWR5lYUZ8aVQaLKiN37NsHnmk3xjMoUjza3mGkk8MvMofgZT0T6HKSCKSJIir+AWk9Dx8KhxvZAUgCg==", "dev": true, "license": "ISC", "engines": { @@ -13680,6 +12165,8 @@ }, "node_modules/human-signals": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -13687,10 +12174,11 @@ } }, "node_modules/husky": { - "version": "9.1.6", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.6.tgz", - "integrity": "sha512-sqbjZKK7kf44hfdE94EoX8MZNk0n7HeW37O4YrVGCF4wzgQjp+akPAkfUK5LZ6KuR/6sqeAVuXHji+RzQgOn5A==", + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", "dev": true, + "license": "MIT", "bin": { "husky": "bin.js" }, @@ -13703,6 +12191,8 @@ }, "node_modules/iconv-lite": { "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" @@ -13713,6 +12203,8 @@ }, "node_modules/ieee754": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "funding": [ { "type": "github", @@ -13730,14 +12222,18 @@ "license": "BSD-3-Clause" }, "node_modules/ignore": { - "version": "5.3.0", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/import-fresh": { - "version": "3.3.0", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "license": "MIT", "dependencies": { "parent-module": "^1.0.0", @@ -13752,13 +12248,17 @@ }, "node_modules/import-fresh/node_modules/resolve-from": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/import-local": { - "version": "3.1.0", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", "dev": true, "license": "MIT", "dependencies": { @@ -13777,6 +12277,8 @@ }, "node_modules/imurmurhash": { "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "license": "MIT", "engines": { "node": ">=0.8.19" @@ -13784,6 +12286,8 @@ }, "node_modules/indent-string": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, "license": "MIT", "engines": { @@ -13792,11 +12296,15 @@ }, "node_modules/indexes-of": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha512-bup+4tap3Hympa+JBJUG7XuOsdNQ6fxt0MHyXMKuLBKn0OqsTfvUxkUrroEX1+B2VsSHvCjiIcZVxRtYa4nllA==", "dev": true, "license": "MIT" }, "node_modules/inflation": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/inflation/-/inflation-2.1.0.tgz", + "integrity": "sha512-t54PPJHG1Pp7VQvxyVCJ9mBbjG3Hqryges9bXoOO6GExCPa+//i/d5GSuFtpx3ALLd7lgIAur6zrIlBQyJuMlQ==", "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -13804,6 +12312,9 @@ }, "node_modules/inflight": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -13812,15 +12323,20 @@ }, "node_modules/inherits": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, "node_modules/ini": { "version": "1.3.8", - "dev": true, + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "license": "ISC" }, "node_modules/inquirer": { - "version": "8.2.6", + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz", + "integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13838,7 +12354,7 @@ "string-width": "^4.1.0", "strip-ansi": "^6.0.0", "through": "^2.3.6", - "wrap-ansi": "^6.0.1" + "wrap-ansi": "^7.0.0" }, "engines": { "node": ">=12.0.0" @@ -13846,6 +12362,8 @@ }, "node_modules/inquirer/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -13860,6 +12378,8 @@ }, "node_modules/inquirer/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -13875,6 +12395,8 @@ }, "node_modules/inquirer/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13886,11 +12408,15 @@ }, "node_modules/inquirer/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/inquirer/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -13899,6 +12425,8 @@ }, "node_modules/inquirer/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -13908,26 +12436,15 @@ "node": ">=8" } }, - "node_modules/inquirer/node_modules/wrap-ansi": { - "version": "6.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/internal-slot": { - "version": "1.0.6", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.2", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -13935,6 +12452,8 @@ }, "node_modules/into-stream": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", + "integrity": "sha512-TcdjPibTksa1NQximqep2r17ISRiNE9fwlfbg3F8ANdvP5/yrFTew86VcO//jk4QTaMlbjypPBq76HN2zaKfZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13946,7 +12465,9 @@ } }, "node_modules/ioredis": { - "version": "5.3.2", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.5.0.tgz", + "integrity": "sha512-7CutT89g23FfSa8MDoIFs2GYYa0PaNiW/OrT+nRyjRXHDZd17HmIgy+reOQ/yhh72NznNjGuS8kbCAcA4Ro4mw==", "license": "MIT", "dependencies": { "@ioredis/commands": "^1.1.1", @@ -13969,6 +12490,8 @@ }, "node_modules/ip-regex": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", + "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==", "license": "MIT", "engines": { "node": ">=8" @@ -13976,18 +12499,25 @@ }, "node_modules/is": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", + "integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==", "license": "MIT", "engines": { "node": "*" } }, "node_modules/is-array-buffer": { - "version": "3.0.2", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -13995,24 +12525,52 @@ }, "node_modules/is-arrayish": { "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "license": "MIT" }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-bigint": { - "version": "1.0.4", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "license": "MIT", "dependencies": { - "has-bigints": "^1.0.1" + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-boolean-object": { - "version": "1.1.2", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -14023,6 +12581,9 @@ }, "node_modules/is-buffer": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "dev": true, "funding": [ { "type": "github", @@ -14044,6 +12605,8 @@ }, "node_modules/is-builtin-module": { "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", + "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", "dev": true, "license": "MIT", "dependencies": { @@ -14058,6 +12621,8 @@ }, "node_modules/is-callable": { "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -14067,20 +12632,45 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "license": "MIT", "dependencies": { - "hasown": "^2.0.0" + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-date-object": { - "version": "1.0.5", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -14091,6 +12681,8 @@ }, "node_modules/is-docker": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true, "license": "MIT", "bin": { @@ -14105,13 +12697,32 @@ }, "node_modules/is-extglob": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-finite": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", "dev": true, "license": "MIT", "engines": { @@ -14123,6 +12734,8 @@ }, "node_modules/is-fullwidth-code-point": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", "dev": true, "license": "MIT", "engines": { @@ -14134,6 +12747,8 @@ }, "node_modules/is-generator-fn": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, "license": "MIT", "engines": { @@ -14141,10 +12756,15 @@ } }, "node_modules/is-generator-function": { - "version": "1.0.10", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -14155,6 +12775,8 @@ }, "node_modules/is-glob": { "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -14165,6 +12787,8 @@ }, "node_modules/is-interactive": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "dev": true, "license": "MIT", "engines": { @@ -14173,6 +12797,8 @@ }, "node_modules/is-ip": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-3.1.0.tgz", + "integrity": "sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q==", "license": "MIT", "dependencies": { "ip-regex": "^4.0.0" @@ -14181,8 +12807,10 @@ "node": ">=8" } }, - "node_modules/is-negative-zero": { - "version": "2.0.2", + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -14193,16 +12821,21 @@ }, "node_modules/is-number": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/is-number-object": { - "version": "1.0.7", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -14213,6 +12846,8 @@ }, "node_modules/is-obj": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", "dev": true, "license": "MIT", "engines": { @@ -14221,6 +12856,8 @@ }, "node_modules/is-object": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.2.tgz", + "integrity": "sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA==", "dev": true, "license": "MIT", "funding": { @@ -14229,6 +12866,8 @@ }, "node_modules/is-path-inside": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "license": "MIT", "engines": { "node": ">=8" @@ -14236,6 +12875,8 @@ }, "node_modules/is-plain-obj": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", "dev": true, "license": "MIT", "engines": { @@ -14244,6 +12885,8 @@ }, "node_modules/is-plain-object": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "license": "MIT", "dependencies": { "isobject": "^3.0.1" @@ -14254,17 +12897,23 @@ }, "node_modules/is-primitive": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-3.0.1.tgz", + "integrity": "sha512-GljRxhWvlCNRfZyORiH77FwdFwGcMO620o37EOYC0ORWdq+WYNVqW0w2Juzew4M+L81l6/QS3t5gkkihyRqv9w==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-regex": { - "version": "1.1.4", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -14275,6 +12924,8 @@ }, "node_modules/is-regexp": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==", "dev": true, "license": "MIT", "engines": { @@ -14283,22 +12934,43 @@ }, "node_modules/is-relative-path": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-relative-path/-/is-relative-path-1.0.2.tgz", + "integrity": "sha512-i1h+y50g+0hRbBD+dbnInl3JlJ702aar58snAeX+MxBAPvzXGej7sYoPMhlnykabt0ZzCJNBEyzMlekuQZN7fA==", "dev": true, "license": "MIT" }, "node_modules/is-retry-allowed": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", + "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-shared-array-buffer": { - "version": "1.0.2", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2" + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -14306,6 +12978,8 @@ }, "node_modules/is-stream": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "license": "MIT", "engines": { "node": ">=8" @@ -14315,10 +12989,13 @@ } }, "node_modules/is-string": { - "version": "1.0.7", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -14328,10 +13005,14 @@ } }, "node_modules/is-symbol": { - "version": "1.0.4", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "license": "MIT", "dependencies": { - "has-symbols": "^1.0.2" + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -14342,6 +13023,8 @@ }, "node_modules/is-text-path": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", + "integrity": "sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==", "dev": true, "license": "MIT", "dependencies": { @@ -14352,10 +13035,12 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.12", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "license": "MIT", "dependencies": { - "which-typed-array": "^1.1.11" + "which-typed-array": "^1.1.16" }, "engines": { "node": ">= 0.4" @@ -14366,6 +13051,8 @@ }, "node_modules/is-unicode-supported": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, "license": "MIT", "engines": { @@ -14377,11 +13064,15 @@ }, "node_modules/is-url": { "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", "dev": true, "license": "MIT" }, "node_modules/is-url-superb": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-url-superb/-/is-url-superb-4.0.0.tgz", + "integrity": "sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==", "dev": true, "license": "MIT", "engines": { @@ -14393,14 +13084,49 @@ }, "node_modules/is-utf8": { "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", "dev": true, "license": "MIT" }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-weakref": { - "version": "1.0.2", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2" + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -14408,6 +13134,8 @@ }, "node_modules/is-windows": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true, "license": "MIT", "engines": { @@ -14416,6 +13144,8 @@ }, "node_modules/is-wsl": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, "license": "MIT", "dependencies": { @@ -14427,34 +13157,49 @@ }, "node_modules/isarray": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true, "license": "MIT" }, "node_modules/iserror": { "version": "0.0.2", + "resolved": "https://registry.npmjs.org/iserror/-/iserror-0.0.2.tgz", + "integrity": "sha512-oKGGrFVaWwETimP3SiWwjDeY27ovZoyZPHtxblC4hCq9fXxed/jasx+ATWFFjCVSRZng8VTMsN1nDnGo6zMBSw==", "license": "MIT" }, "node_modules/isexe": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, "node_modules/isobject": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/isolated-vm": { - "version": "4.5.0", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/isolated-vm/-/isolated-vm-5.0.3.tgz", + "integrity": "sha512-GNqX0j7dkwdaNQfFogLLb/tSuPZbXtKlk5ldaJ084ngjaW9/bn34x9FQFL856p20KSZoubIIummmiJf+2hzhCw==", "hasInstallScript": true, "license": "ISC", + "dependencies": { + "prebuild-install": "^7.1.2" + }, "engines": { - "node": ">=10.4.0" + "node": ">=18.0.0" } }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -14462,13 +13207,15 @@ } }, "node_modules/istanbul-lib-instrument": { - "version": "6.0.1", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", "istanbul-lib-coverage": "^3.2.0", "semver": "^7.5.4" }, @@ -14478,6 +13225,8 @@ }, "node_modules/istanbul-lib-report": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -14491,6 +13240,8 @@ }, "node_modules/istanbul-lib-report/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -14499,6 +13250,8 @@ }, "node_modules/istanbul-lib-report/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -14510,6 +13263,8 @@ }, "node_modules/istanbul-lib-source-maps": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -14523,6 +13278,8 @@ }, "node_modules/istanbul-lib-source-maps/node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -14530,7 +13287,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.6", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -14543,6 +13302,8 @@ }, "node_modules/isurl": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", "dev": true, "license": "MIT", "dependencies": { @@ -14554,15 +13315,14 @@ } }, "node_modules/jackspeak": { - "version": "2.3.6", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, - "engines": { - "node": ">=14" - }, "funding": { "url": "https://github.com/sponsors/isaacs" }, @@ -14575,6 +13335,7 @@ "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "async": "^3.2.3", "chalk": "^4.0.2", @@ -14593,6 +13354,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -14608,6 +13370,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -14624,6 +13387,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -14635,13 +13399,15 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/jake/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -14651,6 +13417,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -14660,6 +13427,8 @@ }, "node_modules/jest": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "license": "MIT", "dependencies": { @@ -14685,6 +13454,8 @@ }, "node_modules/jest-changed-files": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "license": "MIT", "dependencies": { @@ -14698,6 +13469,8 @@ }, "node_modules/jest-circus": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "license": "MIT", "dependencies": { @@ -14728,6 +13501,8 @@ }, "node_modules/jest-circus/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -14742,6 +13517,8 @@ }, "node_modules/jest-circus/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -14757,6 +13534,8 @@ }, "node_modules/jest-circus/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -14768,11 +13547,15 @@ }, "node_modules/jest-circus/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-circus/node_modules/dedent": { - "version": "1.5.1", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz", + "integrity": "sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==", "dev": true, "license": "MIT", "peerDependencies": { @@ -14786,6 +13569,8 @@ }, "node_modules/jest-circus/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -14794,6 +13579,8 @@ }, "node_modules/jest-circus/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -14805,6 +13592,8 @@ }, "node_modules/jest-cli": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "license": "MIT", "dependencies": { @@ -14837,6 +13626,8 @@ }, "node_modules/jest-cli/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -14851,6 +13642,8 @@ }, "node_modules/jest-cli/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -14866,6 +13659,8 @@ }, "node_modules/jest-cli/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -14877,11 +13672,15 @@ }, "node_modules/jest-cli/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-cli/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -14890,6 +13689,8 @@ }, "node_modules/jest-cli/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -14901,6 +13702,8 @@ }, "node_modules/jest-config": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "license": "MIT", "dependencies": { @@ -14945,6 +13748,8 @@ }, "node_modules/jest-config/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -14959,6 +13764,8 @@ }, "node_modules/jest-config/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -14974,6 +13781,8 @@ }, "node_modules/jest-config/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -14985,11 +13794,16 @@ }, "node_modules/jest-config/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-config/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -15009,6 +13823,8 @@ }, "node_modules/jest-config/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15017,6 +13833,8 @@ }, "node_modules/jest-config/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15028,6 +13846,8 @@ }, "node_modules/jest-diff": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "license": "MIT", "dependencies": { @@ -15042,6 +13862,8 @@ }, "node_modules/jest-diff/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15056,6 +13878,8 @@ }, "node_modules/jest-diff/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15071,6 +13895,8 @@ }, "node_modules/jest-diff/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15082,11 +13908,15 @@ }, "node_modules/jest-diff/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-diff/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15095,6 +13925,8 @@ }, "node_modules/jest-diff/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15106,6 +13938,8 @@ }, "node_modules/jest-docblock": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "license": "MIT", "dependencies": { @@ -15117,6 +13951,8 @@ }, "node_modules/jest-each": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15132,6 +13968,8 @@ }, "node_modules/jest-each/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15146,6 +13984,8 @@ }, "node_modules/jest-each/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15161,6 +14001,8 @@ }, "node_modules/jest-each/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15172,11 +14014,15 @@ }, "node_modules/jest-each/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-each/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15185,6 +14031,8 @@ }, "node_modules/jest-each/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15196,6 +14044,8 @@ }, "node_modules/jest-environment-node": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, "license": "MIT", "dependencies": { @@ -15212,6 +14062,8 @@ }, "node_modules/jest-get-type": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, "license": "MIT", "engines": { @@ -15220,6 +14072,8 @@ }, "node_modules/jest-haste-map": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, "license": "MIT", "dependencies": { @@ -15244,6 +14098,8 @@ }, "node_modules/jest-leak-detector": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "license": "MIT", "dependencies": { @@ -15256,6 +14112,8 @@ }, "node_modules/jest-matcher-utils": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "license": "MIT", "dependencies": { @@ -15270,6 +14128,8 @@ }, "node_modules/jest-matcher-utils/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15284,6 +14144,8 @@ }, "node_modules/jest-matcher-utils/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15299,6 +14161,8 @@ }, "node_modules/jest-matcher-utils/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15310,11 +14174,15 @@ }, "node_modules/jest-matcher-utils/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-matcher-utils/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15323,6 +14191,8 @@ }, "node_modules/jest-matcher-utils/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15334,6 +14204,8 @@ }, "node_modules/jest-message-util": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "license": "MIT", "dependencies": { @@ -15353,6 +14225,8 @@ }, "node_modules/jest-message-util/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15367,6 +14241,8 @@ }, "node_modules/jest-message-util/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15382,6 +14258,8 @@ }, "node_modules/jest-message-util/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15393,11 +14271,15 @@ }, "node_modules/jest-message-util/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-message-util/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15406,6 +14288,8 @@ }, "node_modules/jest-message-util/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15417,6 +14301,8 @@ }, "node_modules/jest-mock": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "license": "MIT", "dependencies": { @@ -15430,6 +14316,8 @@ }, "node_modules/jest-pnp-resolver": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, "license": "MIT", "engines": { @@ -15446,6 +14334,8 @@ }, "node_modules/jest-regex-util": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, "license": "MIT", "engines": { @@ -15454,6 +14344,8 @@ }, "node_modules/jest-resolve": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "license": "MIT", "dependencies": { @@ -15473,6 +14365,8 @@ }, "node_modules/jest-resolve-dependencies": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, "license": "MIT", "dependencies": { @@ -15485,6 +14379,8 @@ }, "node_modules/jest-resolve/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15499,6 +14395,8 @@ }, "node_modules/jest-resolve/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15514,6 +14412,8 @@ }, "node_modules/jest-resolve/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15525,11 +14425,15 @@ }, "node_modules/jest-resolve/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-resolve/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15538,6 +14442,8 @@ }, "node_modules/jest-resolve/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15549,6 +14455,8 @@ }, "node_modules/jest-runner": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15580,6 +14488,8 @@ }, "node_modules/jest-runner/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15594,6 +14504,8 @@ }, "node_modules/jest-runner/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15609,6 +14521,8 @@ }, "node_modules/jest-runner/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15620,11 +14534,15 @@ }, "node_modules/jest-runner/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-runner/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15633,6 +14551,8 @@ }, "node_modules/jest-runner/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15644,6 +14564,8 @@ }, "node_modules/jest-runtime": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15676,6 +14598,8 @@ }, "node_modules/jest-runtime/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15690,6 +14614,8 @@ }, "node_modules/jest-runtime/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15705,6 +14631,8 @@ }, "node_modules/jest-runtime/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15716,11 +14644,16 @@ }, "node_modules/jest-runtime/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-runtime/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -15740,6 +14673,8 @@ }, "node_modules/jest-runtime/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15748,6 +14683,8 @@ }, "node_modules/jest-runtime/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15759,6 +14696,8 @@ }, "node_modules/jest-snapshot": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "license": "MIT", "dependencies": { @@ -15789,6 +14728,8 @@ }, "node_modules/jest-snapshot/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15803,6 +14744,8 @@ }, "node_modules/jest-snapshot/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15818,6 +14761,8 @@ }, "node_modules/jest-snapshot/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15829,11 +14774,15 @@ }, "node_modules/jest-snapshot/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-snapshot/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15842,6 +14791,8 @@ }, "node_modules/jest-snapshot/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15853,6 +14804,8 @@ }, "node_modules/jest-sonar": { "version": "0.2.16", + "resolved": "https://registry.npmjs.org/jest-sonar/-/jest-sonar-0.2.16.tgz", + "integrity": "sha512-ES6Z9BbIVDELtbz+/b6pv41B2qOfp38cQpoCLqei21FtlkG/GzhyQ0M3egEIM+erpJOkpRKM8Tc8/YQtHdiTXA==", "dev": true, "license": "MIT", "dependencies": { @@ -15862,6 +14815,8 @@ }, "node_modules/jest-util": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "license": "MIT", "dependencies": { @@ -15878,6 +14833,8 @@ }, "node_modules/jest-util/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15892,6 +14849,8 @@ }, "node_modules/jest-util/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15907,6 +14866,8 @@ }, "node_modules/jest-util/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15918,11 +14879,15 @@ }, "node_modules/jest-util/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-util/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15931,6 +14896,8 @@ }, "node_modules/jest-util/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15942,6 +14909,8 @@ }, "node_modules/jest-validate": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "license": "MIT", "dependencies": { @@ -15958,6 +14927,8 @@ }, "node_modules/jest-validate/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15972,6 +14943,8 @@ }, "node_modules/jest-validate/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15987,6 +14960,8 @@ }, "node_modules/jest-validate/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15998,11 +14973,15 @@ }, "node_modules/jest-validate/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-validate/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -16011,6 +14990,8 @@ }, "node_modules/jest-validate/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -16022,6 +15003,8 @@ }, "node_modules/jest-watcher": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "license": "MIT", "dependencies": { @@ -16040,6 +15023,8 @@ }, "node_modules/jest-watcher/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -16054,6 +15039,8 @@ }, "node_modules/jest-watcher/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -16069,6 +15056,8 @@ }, "node_modules/jest-watcher/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16080,11 +15069,15 @@ }, "node_modules/jest-watcher/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-watcher/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -16093,6 +15086,8 @@ }, "node_modules/jest-watcher/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -16103,7 +15098,9 @@ } }, "node_modules/jest-when": { - "version": "3.6.0", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/jest-when/-/jest-when-3.7.0.tgz", + "integrity": "sha512-aLbiyxmtksijcrKFir7n+t+XPbqSLV01eDkRyX28WM4VgA/iSc3mG8R8O2evDtOAa6SefrJiTIt/rTqqyrwVZg==", "dev": true, "license": "MIT", "peerDependencies": { @@ -16112,6 +15109,8 @@ }, "node_modules/jest-worker": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "license": "MIT", "dependencies": { @@ -16126,6 +15125,8 @@ }, "node_modules/jest-worker/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -16134,6 +15135,8 @@ }, "node_modules/jest-worker/node_modules/supports-color": { "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -16146,25 +15149,22 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/jiti": { - "version": "1.21.0", - "dev": true, - "license": "MIT", - "optional": true, - "bin": { - "jiti": "bin/jiti.js" - } - }, "node_modules/js-sha1": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/js-sha1/-/js-sha1-0.6.0.tgz", + "integrity": "sha512-01gwBFreYydzmU9BmZxpVk6svJJHrVxEN3IOiGl6VO93bVKYETJ0sIth6DASI6mIFdt7NmfX9UiByRzsYHGU9w==", "license": "MIT" }, "node_modules/js-tokens": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -16174,7 +15174,9 @@ } }, "node_modules/jsesc": { - "version": "3.0.2", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, "license": "MIT", "bin": { @@ -16186,10 +15188,14 @@ }, "node_modules/json-buffer": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "license": "MIT" }, "node_modules/json-diff": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/json-diff/-/json-diff-1.0.6.tgz", + "integrity": "sha512-tcFIPRdlc35YkYdGxcamJjllUhXWv4n2rK9oJ2RsAzV4FBkuV4ojKEDgcZ+kpKxDmJKv+PFK65+1tVVOnSeEqA==", "license": "MIT", "dependencies": { "@ewoudenberg/difflib": "0.1.0", @@ -16205,19 +15211,27 @@ }, "node_modules/json-parse-better-errors": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true, "license": "MIT" }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "license": "MIT" }, "node_modules/json-schema-traverse": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "license": "MIT" }, "node_modules/json-size": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-size/-/json-size-1.0.0.tgz", + "integrity": "sha512-sh8Ff4sNVI3FU1LjFXiNpcG9Er9bsn8WbeR79mGj4Ljd+/NBmxqYCV1sPzndUTGsWXa3LVUx3aLlZxpq1DzCBA==", "license": "MIT", "dependencies": { "utf8-length": "0.0.1" @@ -16225,15 +15239,21 @@ }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "license": "MIT" }, "node_modules/json-stringify-safe": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true, "license": "ISC" }, "node_modules/json5": { "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "license": "MIT", "bin": { @@ -16244,19 +15264,25 @@ } }, "node_modules/jsonata": { - "version": "2.0.5", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/jsonata/-/jsonata-2.0.6.tgz", + "integrity": "sha512-WhQB5tXQ32qjkx2GYHFw2XbL90u+LLzjofAYwi+86g6SyZeXHz9F1Q0amy3dWRYczshOC3Haok9J4pOCgHtwyQ==", "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/jsonc-parser": { - "version": "3.2.0", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", "dev": true, "license": "MIT" }, "node_modules/jsonfile": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16268,14 +15294,26 @@ }, "node_modules/jsonparse": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", "dev": true, "engines": [ "node >= 0.2.0" ], "license": "MIT" }, + "node_modules/jsonschema": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.5.0.tgz", + "integrity": "sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==", + "engines": { + "node": "*" + } + }, "node_modules/JSONStream": { "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "dev": true, "license": "(MIT OR Apache-2.0)", "dependencies": { @@ -16291,17 +15329,17 @@ }, "node_modules/jsontoxml": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/jsontoxml/-/jsontoxml-1.0.1.tgz", + "integrity": "sha512-dtKGq0K8EWQBRqcAaePSgKR4Hyjfsz/LkurHSV3Cxk4H+h2fWDeaN2jzABz+ZmOJylgXS7FGeWmbZ6jgYUMdJQ==", "license": "MIT", "engines": { "node": ">=0.2.0" } }, - "node_modules/jstoxml": { - "version": "5.0.2", - "license": "MIT" - }, "node_modules/keygrip": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", + "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", "license": "MIT", "dependencies": { "tsscmp": "1.0.6" @@ -16312,6 +15350,8 @@ }, "node_modules/keyv": { "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "license": "MIT", "dependencies": { "json-buffer": "3.0.1" @@ -16319,6 +15359,8 @@ }, "node_modules/kind-of": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -16326,6 +15368,8 @@ }, "node_modules/kleur": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true, "license": "MIT", "engines": { @@ -16333,9 +15377,10 @@ } }, "node_modules/koa": { - "version": "2.15.3", - "resolved": "https://registry.npmjs.org/koa/-/koa-2.15.3.tgz", - "integrity": "sha512-j/8tY9j5t+GVMLeioLaxweJiKUayFhlGqNTzf2ZGwL0ZCQijd2RLHK0SLW5Tsko8YyyqCZC2cojIb0/s62qTAg==", + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/koa/-/koa-2.16.0.tgz", + "integrity": "sha512-Afhqq0Vq3W7C+/rW6IqHVBDLzqObwZ07JaUNUEF8yCQ6afiyFE3RAy+i7V0E46XOWlH7vPWn/x0vsZwNy6PWxw==", + "license": "MIT", "dependencies": { "accepts": "^1.3.5", "cache-content-type": "^1.0.0", @@ -16367,6 +15412,8 @@ }, "node_modules/koa-bodyparser": { "version": "4.4.1", + "resolved": "https://registry.npmjs.org/koa-bodyparser/-/koa-bodyparser-4.4.1.tgz", + "integrity": "sha512-kBH3IYPMb+iAXnrxIhXnW+gXV8OTzCu8VPDqvcDHW9SQrbkHmqPQtiZwrltNmSq6/lpipHnT7k7PsjlVD7kK0w==", "license": "MIT", "dependencies": { "co-body": "^6.0.0", @@ -16379,10 +15426,14 @@ }, "node_modules/koa-compose": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz", + "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==", "license": "MIT" }, "node_modules/koa-convert": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-2.0.0.tgz", + "integrity": "sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA==", "license": "MIT", "dependencies": { "co": "^4.6.0", @@ -16394,6 +15445,8 @@ }, "node_modules/koa/node_modules/http-errors": { "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", "license": "MIT", "dependencies": { "depd": "~1.1.2", @@ -16408,6 +15461,8 @@ }, "node_modules/koa/node_modules/http-errors/node_modules/depd": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -16415,13 +15470,17 @@ }, "node_modules/koa/node_modules/statuses": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/koa2-swagger-ui": { - "version": "5.10.0", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/koa2-swagger-ui/-/koa2-swagger-ui-5.11.0.tgz", + "integrity": "sha512-EjmeK07RHjb+xje1fLVhQa66NWPrba9gZN/DDHo3Nc98raJ+dVxqrQADIHkZb3GAkdNdrrczb8x7n9euevxuJw==", "license": "MIT", "dependencies": { "handlebars": "^4.7.8", @@ -16434,6 +15493,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "license": "MIT", "dependencies": { "locate-path": "^5.0.0", @@ -16445,6 +15506,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "license": "MIT", "dependencies": { "p-locate": "^4.1.0" @@ -16455,6 +15518,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "license": "MIT", "dependencies": { "p-try": "^2.0.0" @@ -16468,6 +15533,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "license": "MIT", "dependencies": { "p-limit": "^2.2.0" @@ -16478,6 +15545,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/read-pkg": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "license": "MIT", "dependencies": { "@types/normalize-package-data": "^2.4.0", @@ -16491,6 +15560,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/read-pkg-up": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "license": "MIT", "dependencies": { "find-up": "^4.1.0", @@ -16506,6 +15577,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/read-pkg/node_modules/type-fest": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=8" @@ -16513,6 +15586,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/type-fest": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=8" @@ -16520,10 +15595,13 @@ }, "node_modules/kuler": { "version": "2.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" }, "node_modules/lazy-ass": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", + "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", "dev": true, "license": "MIT", "engines": { @@ -16532,6 +15610,8 @@ }, "node_modules/leven": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, "license": "MIT", "engines": { @@ -16540,6 +15620,8 @@ }, "node_modules/levn": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", @@ -16550,12 +15632,15 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.11.12", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.11.12.tgz", - "integrity": "sha512-QkJn9/D7zZ1ucvT++TQSvZuSA2xAWeUytU+DiEQwbPKLyrDpvbul2AFs1CGbRAPpSCCk47aRAb5DX5mmcayp4g==" + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.4.tgz", + "integrity": "sha512-vLmhg7Gan7idyAKfc6pvCtNzvar4/eIzrVVk3hjNFH5+fGqyjD0gQRovdTrDl20wsmZhBtmZpcsR0tOfquwb8g==", + "license": "MIT" }, "node_modules/lilconfig": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", "dev": true, "license": "MIT", "engines": { @@ -16564,10 +15649,14 @@ }, "node_modules/lines-and-columns": { "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "license": "MIT" }, "node_modules/lint-staged": { "version": "13.3.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.3.0.tgz", + "integrity": "sha512-mPRtrYnipYYv1FEE134ufbWpeggNTo+O/UPzngoaKzbzHAthvR55am+8GfHTnqNRQVRRrYQLGW9ZyUoD7DsBHQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16594,6 +15683,8 @@ }, "node_modules/lint-staged/node_modules/chalk": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, "license": "MIT", "engines": { @@ -16605,14 +15696,36 @@ }, "node_modules/lint-staged/node_modules/commander": { "version": "11.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", + "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", "dev": true, "license": "MIT", "engines": { "node": ">=16" } }, + "node_modules/lint-staged/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/lint-staged/node_modules/execa": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", + "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", "dev": true, "license": "MIT", "dependencies": { @@ -16635,6 +15748,8 @@ }, "node_modules/lint-staged/node_modules/human-signals": { "version": "4.3.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", + "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -16643,6 +15758,8 @@ }, "node_modules/lint-staged/node_modules/is-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, "license": "MIT", "engines": { @@ -16652,8 +15769,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lint-staged/node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/lint-staged/node_modules/mimic-fn": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, "license": "MIT", "engines": { @@ -16663,8 +15796,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lint-staged/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, "node_modules/lint-staged/node_modules/npm-run-path": { - "version": "5.2.0", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16679,6 +15821,8 @@ }, "node_modules/lint-staged/node_modules/onetime": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16693,6 +15837,8 @@ }, "node_modules/lint-staged/node_modules/path-key": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, "license": "MIT", "engines": { @@ -16704,6 +15850,8 @@ }, "node_modules/lint-staged/node_modules/strip-final-newline": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, "license": "MIT", "engines": { @@ -16715,6 +15863,8 @@ }, "node_modules/lint-staged/node_modules/yaml": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", + "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", "dev": true, "license": "ISC", "engines": { @@ -16723,6 +15873,8 @@ }, "node_modules/listr2": { "version": "6.6.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-6.6.1.tgz", + "integrity": "sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==", "dev": true, "license": "MIT", "dependencies": { @@ -16746,7 +15898,9 @@ } }, "node_modules/listr2/node_modules/ansi-regex": { - "version": "6.0.1", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "license": "MIT", "engines": { @@ -16758,6 +15912,8 @@ }, "node_modules/listr2/node_modules/ansi-styles": { "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "license": "MIT", "engines": { @@ -16769,16 +15925,22 @@ }, "node_modules/listr2/node_modules/emoji-regex": { "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, "license": "MIT" }, "node_modules/listr2/node_modules/eventemitter3": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", "dev": true, "license": "MIT" }, "node_modules/listr2/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "license": "MIT", "dependencies": { @@ -16795,6 +15957,8 @@ }, "node_modules/listr2/node_modules/strip-ansi": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16809,6 +15973,8 @@ }, "node_modules/listr2/node_modules/wrap-ansi": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16825,6 +15991,8 @@ }, "node_modules/load-json-file": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", "dev": true, "license": "MIT", "dependencies": { @@ -16839,6 +16007,8 @@ }, "node_modules/load-json-file/node_modules/parse-json": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", "dev": true, "license": "MIT", "dependencies": { @@ -16851,6 +16021,8 @@ }, "node_modules/load-json-file/node_modules/pify": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", "dev": true, "license": "MIT", "engines": { @@ -16859,6 +16031,8 @@ }, "node_modules/load-json-file/node_modules/strip-bom": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, "license": "MIT", "engines": { @@ -16867,6 +16041,8 @@ }, "node_modules/locate-path": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "license": "MIT", "dependencies": { "p-locate": "^5.0.0" @@ -16880,81 +16056,116 @@ }, "node_modules/lodash": { "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "license": "MIT" }, "node_modules/lodash._reinterpolate": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==", "dev": true, "license": "MIT" }, "node_modules/lodash.camelcase": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", "dev": true, "license": "MIT" }, "node_modules/lodash.defaults": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", "license": "MIT" }, "node_modules/lodash.isarguments": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", "license": "MIT" }, "node_modules/lodash.isfunction": { "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz", + "integrity": "sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==", "dev": true, "license": "MIT" }, "node_modules/lodash.ismatch": { "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", + "integrity": "sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==", "dev": true, "license": "MIT" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", "dev": true, "license": "MIT" }, "node_modules/lodash.kebabcase": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==", "dev": true, "license": "MIT" }, "node_modules/lodash.map": { "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", + "integrity": "sha512-worNHGKLDetmcEYDvh2stPCrrQRkP20E4l0iIS7F8EvzMqBBi7ltvFN5m1HvTf1P7Jk1txKhvFcmYsCr8O2F1Q==", "dev": true, "license": "MIT" }, "node_modules/lodash.memoize": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", "dev": true, "license": "MIT" }, "node_modules/lodash.merge": { "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "license": "MIT" }, "node_modules/lodash.mergewith": { "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", "dev": true, "license": "MIT" }, "node_modules/lodash.snakecase": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", "dev": true, "license": "MIT" }, "node_modules/lodash.sortby": { "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", "license": "MIT" }, "node_modules/lodash.startcase": { "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", + "integrity": "sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==", "dev": true, "license": "MIT" }, "node_modules/lodash.template": { "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", + "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", + "deprecated": "This package is deprecated. Use https://socket.dev/npm/package/eta instead.", "dev": true, "license": "MIT", "dependencies": { @@ -16964,6 +16175,8 @@ }, "node_modules/lodash.templatesettings": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", + "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16972,15 +16185,21 @@ }, "node_modules/lodash.uniq": { "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", "license": "MIT" }, "node_modules/lodash.upperfirst": { "version": "4.3.1", + "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", + "integrity": "sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==", "dev": true, "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "license": "MIT", "dependencies": { @@ -16996,6 +16215,8 @@ }, "node_modules/log-symbols/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -17010,6 +16231,8 @@ }, "node_modules/log-symbols/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -17025,6 +16248,8 @@ }, "node_modules/log-symbols/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17036,11 +16261,15 @@ }, "node_modules/log-symbols/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/log-symbols/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -17049,6 +16278,8 @@ }, "node_modules/log-symbols/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -17060,6 +16291,8 @@ }, "node_modules/log-update": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", + "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", "dev": true, "license": "MIT", "dependencies": { @@ -17078,6 +16311,8 @@ }, "node_modules/log-update/node_modules/ansi-escapes": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", "dev": true, "license": "MIT", "dependencies": { @@ -17091,7 +16326,9 @@ } }, "node_modules/log-update/node_modules/ansi-regex": { - "version": "6.0.1", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "license": "MIT", "engines": { @@ -17103,6 +16340,8 @@ }, "node_modules/log-update/node_modules/ansi-styles": { "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "license": "MIT", "engines": { @@ -17114,6 +16353,8 @@ }, "node_modules/log-update/node_modules/cli-cursor": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dev": true, "license": "MIT", "dependencies": { @@ -17128,11 +16369,15 @@ }, "node_modules/log-update/node_modules/emoji-regex": { "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, "license": "MIT" }, "node_modules/log-update/node_modules/restore-cursor": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dev": true, "license": "MIT", "dependencies": { @@ -17148,6 +16393,8 @@ }, "node_modules/log-update/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "license": "MIT", "dependencies": { @@ -17164,6 +16411,8 @@ }, "node_modules/log-update/node_modules/strip-ansi": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17178,6 +16427,8 @@ }, "node_modules/log-update/node_modules/type-fest": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -17189,6 +16440,8 @@ }, "node_modules/log-update/node_modules/wrap-ansi": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17204,8 +16457,9 @@ } }, "node_modules/logform": { - "version": "2.6.0", - "license": "MIT", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", + "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", "dependencies": { "@colors/colors": "1.6.0", "@types/triple-beam": "^1.3.2", @@ -17219,11 +16473,15 @@ } }, "node_modules/long": { - "version": "5.2.3", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.1.tgz", + "integrity": "sha512-ka87Jz3gcx/I7Hal94xaN2tZEOPoUOEVftkQqZx2EeQRN7LGdfLlI3FvZ+7WDplm+vK2Urx9ULrvSowtdCieng==", "license": "Apache-2.0" }, "node_modules/longest": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-2.0.1.tgz", + "integrity": "sha512-Ajzxb8CM6WAnFjgiloPsI3bF+WCxcvhdIG3KNA2KN962+tdBsHcuQ4k4qX/EcS/2CRkcc0iAkR956Nib6aXU/Q==", "dev": true, "license": "MIT", "engines": { @@ -17232,6 +16490,8 @@ }, "node_modules/loud-rejection": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha512-RPNliZOFkqFumDhvYqOaNY4Uz9oJM2K9tC6JWsJJsNdhuONW4LQHRBpb0qf4pJApVffI5N39SwzWZJuEhfd7eQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17243,7 +16503,9 @@ } }, "node_modules/lowercase-keys": { - "version": "1.0.1", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "integrity": "sha512-RPlX0+PHuvxVDZ7xX+EBVAp4RsVxP/TdDSN2mJYdiq1Lc4Hz7EUSjUI7RZrKKlmrIzVhf6Jo2stj7++gVarS0A==", "dev": true, "license": "MIT", "engines": { @@ -17252,6 +16514,8 @@ }, "node_modules/lru-cache": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "license": "ISC", "dependencies": { @@ -17260,6 +16524,8 @@ }, "node_modules/madge": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/madge/-/madge-6.1.0.tgz", + "integrity": "sha512-irWhT5RpFOc6lkzGHKLihonCVgM0YtfNUh4IrFeW3EqHpnt/JHUG3z26j8PeJEktCGB4tmGOOOJi1Rl/ACWucQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17307,6 +16573,8 @@ }, "node_modules/madge/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -17321,6 +16589,8 @@ }, "node_modules/madge/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -17336,6 +16606,8 @@ }, "node_modules/madge/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17347,11 +16619,15 @@ }, "node_modules/madge/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/madge/node_modules/commander": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true, "license": "MIT", "engines": { @@ -17360,6 +16636,8 @@ }, "node_modules/madge/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -17368,6 +16646,8 @@ }, "node_modules/madge/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -17379,6 +16659,8 @@ }, "node_modules/make-dir": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "license": "MIT", "dependencies": { @@ -17393,11 +16675,15 @@ }, "node_modules/make-error": { "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true, "license": "ISC" }, "node_modules/makeerror": { "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -17406,6 +16692,8 @@ }, "node_modules/map-obj": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", "dev": true, "license": "MIT", "engines": { @@ -17417,10 +16705,23 @@ }, "node_modules/match-json": { "version": "1.3.7", + "resolved": "https://registry.npmjs.org/match-json/-/match-json-1.3.7.tgz", + "integrity": "sha512-2/GIaio/oVWVHGdKOIbqfgqT5vH91K3c91l6EAsVydMAjB0iGy5PVABicKzNT1VAgHskZHbaZK9q96AmgTEqkw==", "license": "MIT" }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/md5": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", "license": "BSD-3-Clause", "dependencies": { "charenc": "0.0.2", @@ -17430,10 +16731,14 @@ }, "node_modules/md5/node_modules/is-buffer": { "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "license": "MIT" }, "node_modules/media-typer": { "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -17441,6 +16746,8 @@ }, "node_modules/meow": { "version": "8.1.2", + "resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz", + "integrity": "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==", "dev": true, "license": "MIT", "dependencies": { @@ -17465,6 +16772,8 @@ }, "node_modules/meow/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -17477,6 +16786,8 @@ }, "node_modules/meow/node_modules/hosted-git-info": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", "dev": true, "license": "ISC", "dependencies": { @@ -17488,6 +16799,8 @@ }, "node_modules/meow/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -17499,6 +16812,8 @@ }, "node_modules/meow/node_modules/lru-cache": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "license": "ISC", "dependencies": { @@ -17510,6 +16825,8 @@ }, "node_modules/meow/node_modules/normalize-package-data": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -17524,6 +16841,8 @@ }, "node_modules/meow/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -17538,6 +16857,8 @@ }, "node_modules/meow/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -17549,6 +16870,8 @@ }, "node_modules/meow/node_modules/read-pkg": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "dev": true, "license": "MIT", "dependencies": { @@ -17563,6 +16886,8 @@ }, "node_modules/meow/node_modules/read-pkg-up": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, "license": "MIT", "dependencies": { @@ -17579,6 +16904,8 @@ }, "node_modules/meow/node_modules/read-pkg-up/node_modules/type-fest": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -17587,11 +16914,15 @@ }, "node_modules/meow/node_modules/read-pkg/node_modules/hosted-git-info": { "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true, "license": "ISC" }, "node_modules/meow/node_modules/read-pkg/node_modules/normalize-package-data": { "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -17603,6 +16934,8 @@ }, "node_modules/meow/node_modules/read-pkg/node_modules/semver": { "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "license": "ISC", "bin": { @@ -17611,6 +16944,8 @@ }, "node_modules/meow/node_modules/read-pkg/node_modules/type-fest": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -17619,6 +16954,8 @@ }, "node_modules/meow/node_modules/type-fest": { "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -17630,16 +16967,22 @@ }, "node_modules/meow/node_modules/yallist": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true, "license": "ISC" }, "node_modules/merge": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/merge/-/merge-2.1.1.tgz", + "integrity": "sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==", "dev": true, "license": "MIT" }, "node_modules/merge-descriptors": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -17647,11 +16990,15 @@ }, "node_modules/merge-stream": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true, "license": "MIT" }, "node_modules/merge2": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "license": "MIT", "engines": { "node": ">= 8" @@ -17659,16 +17006,20 @@ }, "node_modules/methods": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/micromatch": { - "version": "4.0.5", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -17676,18 +17027,21 @@ } }, "node_modules/mime": { - "version": "2.6.0", - "dev": true, + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "license": "MIT", "bin": { "mime": "cli.js" }, "engines": { - "node": ">=4.0.0" + "node": ">=4" } }, "node_modules/mime-db": { "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -17695,6 +17049,8 @@ }, "node_modules/mime-types": { "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -17705,6 +17061,8 @@ }, "node_modules/mimic-fn": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, "license": "MIT", "engines": { @@ -17713,6 +17071,8 @@ }, "node_modules/mimic-response": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", "dev": true, "license": "MIT", "engines": { @@ -17721,6 +17081,8 @@ }, "node_modules/min-indent": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true, "license": "MIT", "engines": { @@ -17729,6 +17091,8 @@ }, "node_modules/minimatch": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -17739,6 +17103,8 @@ }, "node_modules/minimist": { "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -17746,6 +17112,8 @@ }, "node_modules/minimist-options": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", "dev": true, "license": "MIT", "dependencies": { @@ -17758,7 +17126,9 @@ } }, "node_modules/minipass": { - "version": "7.0.4", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, "license": "ISC", "engines": { @@ -17767,6 +17137,8 @@ }, "node_modules/minizlib": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", "license": "MIT", "dependencies": { "minipass": "^3.0.0", @@ -17778,6 +17150,8 @@ }, "node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -17788,10 +17162,14 @@ }, "node_modules/minizlib/node_modules/yallist": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "license": "ISC" }, "node_modules/mkdirp": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" @@ -17800,8 +17178,16 @@ "node": ">=10" } }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT" + }, "node_modules/mocked-env": { "version": "1.3.5", + "resolved": "https://registry.npmjs.org/mocked-env/-/mocked-env-1.3.5.tgz", + "integrity": "sha512-GyYY6ynVOdEoRlaGpaq8UYwdWkvrsU2xRme9B+WPSuJcNjh17+3QIxSYU6zwee0SbehhV6f06VZ4ahjG+9zdrA==", "dev": true, "license": "MIT", "dependencies": { @@ -17816,6 +17202,8 @@ }, "node_modules/mocked-env/node_modules/debug": { "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "license": "MIT", "dependencies": { @@ -17830,8 +17218,17 @@ } } }, + "node_modules/mocked-env/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, "node_modules/modclean": { "version": "3.0.0-beta.1", + "resolved": "https://registry.npmjs.org/modclean/-/modclean-3.0.0-beta.1.tgz", + "integrity": "sha512-NyJpuqXMUI190sZePU+dBcwlGaqhfFC+UL5WyNSxmNLOHATg9cVSgRpbY+mUbwUj7t5trb4vYscgXArKevYsdA==", "license": "MIT", "dependencies": { "await-handler": "^1.1.0", @@ -17856,10 +17253,13 @@ "node_modules/modclean-patterns-default": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/modclean-patterns-default/-/modclean-patterns-default-1.1.2.tgz", - "integrity": "sha512-h2+ES3SKl+JOtfptJjwJz5fdogFI0byYssw3lXoESNkOcXCnjCvvW6IbMagAKFmfWOx+n9esyomxWP1w4edZjg==" + "integrity": "sha512-h2+ES3SKl+JOtfptJjwJz5fdogFI0byYssw3lXoESNkOcXCnjCvvW6IbMagAKFmfWOx+n9esyomxWP1w4edZjg==", + "license": "MIT" }, "node_modules/modclean/node_modules/ansi-regex": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "license": "MIT", "engines": { "node": ">=4" @@ -17867,6 +17267,8 @@ }, "node_modules/modclean/node_modules/cli-cursor": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", "license": "MIT", "dependencies": { "restore-cursor": "^2.0.0" @@ -17877,6 +17279,8 @@ }, "node_modules/modclean/node_modules/cli-spinners": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz", + "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", "license": "MIT", "engines": { "node": ">=4" @@ -17884,10 +17288,15 @@ }, "node_modules/modclean/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "license": "MIT" }, "node_modules/modclean/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -17906,6 +17315,8 @@ }, "node_modules/modclean/node_modules/log-symbols": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", "license": "MIT", "dependencies": { "chalk": "^2.0.1" @@ -17916,6 +17327,8 @@ }, "node_modules/modclean/node_modules/mimic-fn": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "license": "MIT", "engines": { "node": ">=4" @@ -17923,6 +17336,8 @@ }, "node_modules/modclean/node_modules/onetime": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", "license": "MIT", "dependencies": { "mimic-fn": "^1.0.0" @@ -17933,6 +17348,8 @@ }, "node_modules/modclean/node_modules/ora": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-2.1.0.tgz", + "integrity": "sha512-hNNlAd3gfv/iPmsNxYoAPLvxg7HuPozww7fFonMZvL84tP6Ox5igfk5j/+a9rtJJwqMgKK+JgWsAQik5o0HTLA==", "license": "MIT", "dependencies": { "chalk": "^2.3.1", @@ -17948,6 +17365,8 @@ }, "node_modules/modclean/node_modules/restore-cursor": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", "license": "MIT", "dependencies": { "onetime": "^2.0.0", @@ -17959,6 +17378,9 @@ }, "node_modules/modclean/node_modules/rimraf": { "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "license": "ISC", "dependencies": { "glob": "^7.1.3" @@ -17969,6 +17391,8 @@ }, "node_modules/modclean/node_modules/strip-ansi": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", "license": "MIT", "dependencies": { "ansi-regex": "^3.0.0" @@ -17979,6 +17403,8 @@ }, "node_modules/modify-values": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", + "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", "dev": true, "license": "MIT", "engines": { @@ -17987,6 +17413,8 @@ }, "node_modules/module-definition": { "version": "3.4.0", + "resolved": "https://registry.npmjs.org/module-definition/-/module-definition-3.4.0.tgz", + "integrity": "sha512-XxJ88R1v458pifaSkPNLUTdSPNVGMP2SXVncVmApGO+gAfrLANiYe6JofymCzVceGOMwQE2xogxBSc8uB7XegA==", "dev": true, "license": "MIT", "dependencies": { @@ -18002,6 +17430,8 @@ }, "node_modules/module-definition/node_modules/ast-module-types": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-3.0.0.tgz", + "integrity": "sha512-CMxMCOCS+4D+DkOQfuZf+vLrSEmY/7xtORwdxs4wtcC1wVgvk2MqFFTwQCFhvWsI4KPU9lcWXPI8DgRiz+xetQ==", "dev": true, "license": "MIT", "engines": { @@ -18010,6 +17440,8 @@ }, "node_modules/module-definition/node_modules/node-source-walk": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-4.3.0.tgz", + "integrity": "sha512-8Q1hXew6ETzqKRAs3jjLioSxNfT1cx74ooiF8RlAONwVMcfq+UdzLC2eB5qcPldUxaE5w3ytLkrmV1TGddhZTA==", "dev": true, "license": "MIT", "dependencies": { @@ -18021,6 +17453,8 @@ }, "node_modules/module-lookup-amd": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/module-lookup-amd/-/module-lookup-amd-7.0.1.tgz", + "integrity": "sha512-w9mCNlj0S8qviuHzpakaLVc+/7q50jl9a/kmJ/n8bmXQZgDPkQHnPBb8MUOYh3WpAYkXuNc2c+khsozhIp/amQ==", "dev": true, "license": "MIT", "dependencies": { @@ -18039,11 +17473,16 @@ }, "node_modules/module-lookup-amd/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/module-lookup-amd/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -18063,13 +17502,17 @@ }, "node_modules/moment": { "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", "license": "MIT", "engines": { "node": "*" } }, "node_modules/moment-timezone": { - "version": "0.5.44", + "version": "0.5.47", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.47.tgz", + "integrity": "sha512-UbNt/JAWS0m/NJOebR0QMRHBk0hu03r5dx9GK8Cs0AS3I81yDcOc9k+DytPItgVvBP7J6Mf6U2n3BPAacAV9oA==", "license": "MIT", "dependencies": { "moment": "^2.29.4" @@ -18079,20 +17522,28 @@ } }, "node_modules/ms": { - "version": "2.1.2", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, "node_modules/mute-stream": { "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true, "license": "ISC" }, "node_modules/nan": { - "version": "2.19.0", + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.2.tgz", + "integrity": "sha512-DANghxFkS1plDdRsX0X9pm0Z6SJNN6gBdtXfanwoZ8hooC5gosGFSBGRYHUVPz1asKA/kMRqDRdHrluZ61SpBQ==", "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.7", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { @@ -18108,16 +17559,28 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "license": "MIT" + }, "node_modules/natural-compare": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "license": "MIT" }, "node_modules/natural-compare-lite": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "license": "MIT" }, "node_modules/negotiator": { "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -18125,10 +17588,26 @@ }, "node_modules/neo-async": { "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "license": "MIT" }, + "node_modules/node-abi": { + "version": "3.74.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.74.0.tgz", + "integrity": "sha512-c5XK0MjkGBrQPGYG24GBADZud0NCbznxNx0ZkS+ebUTrmV1qTDxPxSL8zEAPURXSbLRWVexxmP4986BziahL5w==", + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/node-cache": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/node-cache/-/node-cache-5.1.2.tgz", + "integrity": "sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==", "license": "MIT", "dependencies": { "clone": "2.x" @@ -18139,6 +17618,8 @@ }, "node_modules/node-fetch": { "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" @@ -18157,6 +17638,8 @@ }, "node_modules/node-gyp-build": { "version": "3.9.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.9.0.tgz", + "integrity": "sha512-zLcTg6P4AbcHPq465ZMFNXx7XpKKJh+7kkN699NiQWisR2uWYOWNWqRHAmbnmKiL4e9aLSlmy5U7rEMUXV59+A==", "license": "MIT", "bin": { "node-gyp-build": "bin.js", @@ -18166,15 +17649,17 @@ }, "node_modules/node-int64": { "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", "dev": true, "license": "MIT" }, "node_modules/node-mocks-http": { - "version": "1.14.1", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/node-mocks-http/-/node-mocks-http-1.16.2.tgz", + "integrity": "sha512-2Sh6YItRp1oqewZNlck3LaFp5vbyW2u51HX2p1VLxQ9U/bG90XV8JY9O7Nk+HDd6OOn/oV3nA5Tx5k4Rki0qlg==", "license": "MIT", "dependencies": { - "@types/express": "^4.17.21", - "@types/node": "^20.10.6", "accepts": "^1.3.7", "content-disposition": "^0.5.3", "depd": "^1.1.0", @@ -18188,27 +17673,33 @@ }, "engines": { "node": ">=14" + }, + "peerDependencies": { + "@types/express": "^4.17.21 || ^5.0.0", + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/express": { + "optional": true + }, + "@types/node": { + "optional": true + } } }, "node_modules/node-mocks-http/node_modules/depd": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", "license": "MIT", "engines": { "node": ">= 0.6" } }, - "node_modules/node-mocks-http/node_modules/mime": { - "version": "1.6.0", - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/node-notifier": { "version": "10.0.1", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-10.0.1.tgz", + "integrity": "sha512-YX7TSyDukOZ0g+gmzjB6abKu+hTGvO8+8+gIFDsRCU2t8fLV/P2unmt+LGFaIa4y64aX98Qksa97rgz4vMNeLQ==", "dev": true, "license": "MIT", "dependencies": { @@ -18222,6 +17713,8 @@ }, "node_modules/node-notifier/node_modules/uuid": { "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, "license": "MIT", "bin": { @@ -18229,12 +17722,16 @@ } }, "node_modules/node-releases": { - "version": "2.0.14", + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", "dev": true, "license": "MIT" }, "node_modules/node-source-walk": { "version": "5.0.2", + "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-5.0.2.tgz", + "integrity": "sha512-Y4jr/8SRS5hzEdZ7SGuvZGwfORvNsSsNRwDXx5WisiqzsVfeftDvRgfeqWNgZvWSJbgubTRVRYBzK6UO+ErqjA==", "dev": true, "license": "MIT", "dependencies": { @@ -18246,6 +17743,8 @@ }, "node_modules/nopt": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "license": "ISC", "dependencies": { "abbrev": "1" @@ -18259,6 +17758,8 @@ }, "node_modules/normalize-package-data": { "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "license": "BSD-2-Clause", "dependencies": { "hosted-git-info": "^2.1.4", @@ -18269,6 +17770,8 @@ }, "node_modules/normalize-package-data/node_modules/semver": { "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "license": "ISC", "bin": { "semver": "bin/semver" @@ -18276,6 +17779,8 @@ }, "node_modules/normalize-path": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "license": "MIT", "engines": { @@ -18284,6 +17789,8 @@ }, "node_modules/normalize-url": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", + "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", "dev": true, "license": "MIT", "dependencies": { @@ -18297,6 +17804,8 @@ }, "node_modules/npm-run-path": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "license": "MIT", "dependencies": { @@ -18308,6 +17817,9 @@ }, "node_modules/npmlog": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", "license": "ISC", "dependencies": { "are-we-there-yet": "^2.0.0", @@ -18318,6 +17830,8 @@ }, "node_modules/number-is-nan": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", "dev": true, "license": "MIT", "engines": { @@ -18326,10 +17840,14 @@ }, "node_modules/oauth-1.0a": { "version": "2.2.6", + "resolved": "https://registry.npmjs.org/oauth-1.0a/-/oauth-1.0a-2.2.6.tgz", + "integrity": "sha512-6bkxv3N4Gu5lty4viIcIAnq5GbxECviMBeKR3WX/q87SPQ8E8aursPZUtsXDnxCs787af09WPRBLqYrf/lwoYQ==", "license": "MIT" }, "node_modules/object-assign": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -18337,27 +17855,38 @@ }, "node_modules/object-hash": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", "license": "MIT", "engines": { "node": ">= 6" } }, "node_modules/object-inspect": { - "version": "1.13.1", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object-keys": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/object-sizeof": { - "version": "2.6.4", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/object-sizeof/-/object-sizeof-2.6.5.tgz", + "integrity": "sha512-Mu3udRqIsKpneKjIEJ2U/s1KmEgpl+N6cEX1o+dDl2aZ+VW5piHqNgomqAk5YMsDoSkpcA8HnIKx1eqGTKzdfw==", "license": "MIT", "dependencies": { "buffer": "^6.0.3" @@ -18365,6 +17894,8 @@ }, "node_modules/object-sizeof/node_modules/buffer": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -18386,12 +17917,16 @@ } }, "node_modules/object.assign": { - "version": "4.1.5", + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", "object-keys": "^1.1.1" }, "engines": { @@ -18402,24 +17937,29 @@ } }, "node_modules/object.entries": { - "version": "1.1.7", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/object.fromentries": { - "version": "2.0.7", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -18429,22 +17969,29 @@ } }, "node_modules/object.groupby": { - "version": "1.0.1", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/object.values": { - "version": "1.1.7", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -18455,6 +18002,8 @@ }, "node_modules/on-finished": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "license": "MIT", "dependencies": { "ee-first": "1.1.1" @@ -18465,6 +18014,8 @@ }, "node_modules/once": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "license": "ISC", "dependencies": { "wrappy": "1" @@ -18472,13 +18023,16 @@ }, "node_modules/one-time": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", "dependencies": { "fn.name": "1.x.x" } }, "node_modules/onetime": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "license": "MIT", "dependencies": { @@ -18492,24 +18046,30 @@ } }, "node_modules/only": { - "version": "0.0.2" + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/only/-/only-0.0.2.tgz", + "integrity": "sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==" }, "node_modules/openapi-types": { "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==", "dev": true, "license": "MIT", "peer": true }, "node_modules/optionator": { - "version": "0.9.3", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "license": "MIT", "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -18517,6 +18077,8 @@ }, "node_modules/ora": { "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", "dev": true, "license": "MIT", "dependencies": { @@ -18539,6 +18101,8 @@ }, "node_modules/ora/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -18553,6 +18117,8 @@ }, "node_modules/ora/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -18568,6 +18134,8 @@ }, "node_modules/ora/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -18579,11 +18147,15 @@ }, "node_modules/ora/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/ora/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -18592,6 +18164,8 @@ }, "node_modules/ora/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -18603,14 +18177,35 @@ }, "node_modules/os-tmpdir": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/p-cancelable": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", + "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==", "dev": true, "license": "MIT", "engines": { @@ -18619,6 +18214,8 @@ }, "node_modules/p-finally": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", "dev": true, "license": "MIT", "engines": { @@ -18627,6 +18224,8 @@ }, "node_modules/p-is-promise": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha512-zL7VE4JVS2IFSkR2GQKDSPEVxkoH43/p7oEnwpdCndKYJO0HVeRB7fA8TJwuLOTBREtK0ea8eHaxdwcpob5dmg==", "dev": true, "license": "MIT", "engines": { @@ -18635,6 +18234,8 @@ }, "node_modules/p-limit": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" @@ -18648,6 +18249,8 @@ }, "node_modules/p-locate": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "license": "MIT", "dependencies": { "p-limit": "^3.0.2" @@ -18661,6 +18264,8 @@ }, "node_modules/p-timeout": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", + "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", "dev": true, "license": "MIT", "dependencies": { @@ -18672,6 +18277,8 @@ }, "node_modules/p-try": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "license": "MIT", "engines": { "node": ">=6" @@ -18679,6 +18286,8 @@ }, "node_modules/p-wait-for": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-3.2.0.tgz", + "integrity": "sha512-wpgERjNkLrBiFmkMEjuZJEWKKDrNfHCKA1OhyN1wg1FrLkULbviEy6py1AyJUgZ72YWFbZ38FIpnqvVqAlDUwA==", "dev": true, "license": "MIT", "dependencies": { @@ -18693,6 +18302,8 @@ }, "node_modules/p-wait-for/node_modules/p-timeout": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", "dev": true, "license": "MIT", "dependencies": { @@ -18702,8 +18313,17 @@ "node": ">=8" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/parent-module": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "license": "MIT", "dependencies": { "callsites": "^3.0.0" @@ -18714,11 +18334,15 @@ }, "node_modules/parse-github-repo-url": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz", + "integrity": "sha512-bSWyzBKqcSL4RrncTpGsEKoJ7H8a4L3++ifTAbTFeMHyq2wRV+42DGmQcHIrJIvdcacjIOxEuKH/w4tthF17gg==", "dev": true, "license": "MIT" }, "node_modules/parse-json": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.0.0", @@ -18735,6 +18359,8 @@ }, "node_modules/parse-ms": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", + "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==", "dev": true, "license": "MIT", "engines": { @@ -18743,6 +18369,8 @@ }, "node_modules/parse-passwd": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==", "dev": true, "license": "MIT", "engines": { @@ -18751,10 +18379,14 @@ }, "node_modules/parse-static-imports": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/parse-static-imports/-/parse-static-imports-1.1.0.tgz", + "integrity": "sha512-HlxrZcISCblEV0lzXmAHheH/8qEkKgmqkdxyHTPbSqsTUV8GzqmN1L+SSti+VbNPfbBO3bYLPHDiUs2avbAdbA==", "license": "MIT" }, "node_modules/parseurl": { "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -18762,6 +18394,8 @@ }, "node_modules/path-exists": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "license": "MIT", "engines": { "node": ">=8" @@ -18769,6 +18403,8 @@ }, "node_modules/path-is-absolute": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -18776,6 +18412,8 @@ }, "node_modules/path-key": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "license": "MIT", "engines": { "node": ">=8" @@ -18783,30 +18421,33 @@ }, "node_modules/path-parse": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "license": "MIT" }, "node_modules/path-scurry": { - "version": "1.10.1", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", + "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.1.0", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "dev": true, - "license": "ISC", - "engines": { - "node": "14 || >=16.14" - } + "license": "ISC" }, "node_modules/path-to-regexp": { "version": "6.3.0", @@ -18816,18 +18457,23 @@ }, "node_modules/path-type": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/picocolors": { - "version": "1.0.0", - "dev": true, + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "license": "MIT", "engines": { "node": ">=8.6" @@ -18838,6 +18484,8 @@ }, "node_modules/pidtree": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", "dev": true, "license": "MIT", "bin": { @@ -18849,6 +18497,8 @@ }, "node_modules/pify": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true, "license": "MIT", "engines": { @@ -18857,6 +18507,8 @@ }, "node_modules/pinkie": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", "dev": true, "license": "MIT", "engines": { @@ -18865,6 +18517,8 @@ }, "node_modules/pinkie-promise": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", "dev": true, "license": "MIT", "dependencies": { @@ -18876,6 +18530,8 @@ }, "node_modules/pirates": { "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true, "license": "MIT", "engines": { @@ -18884,6 +18540,8 @@ }, "node_modules/pkg-dir": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "license": "MIT", "dependencies": { @@ -18895,6 +18553,8 @@ }, "node_modules/pkg-dir/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -18907,6 +18567,8 @@ }, "node_modules/pkg-dir/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -18918,6 +18580,8 @@ }, "node_modules/pkg-dir/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -18932,6 +18596,8 @@ }, "node_modules/pkg-dir/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -18943,14 +18609,27 @@ }, "node_modules/pluralize": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", "dev": true, "license": "MIT", "engines": { "node": ">=4" } }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/postcss": { - "version": "8.4.33", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", + "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", "dev": true, "funding": [ { @@ -18968,9 +18647,9 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -18978,6 +18657,8 @@ }, "node_modules/postcss-values-parser": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-6.0.2.tgz", + "integrity": "sha512-YLJpK0N1brcNJrs9WatuJFtHaV9q5aAOj+S4DI5S7jgHlRfm0PIbDCAFRYMQD5SHq7Fy6xsDhyutgS0QOAs0qw==", "dev": true, "license": "MPL-2.0", "dependencies": { @@ -18994,11 +18675,15 @@ }, "node_modules/postcss-values-parser/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/pprof": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/pprof/-/pprof-4.0.0.tgz", + "integrity": "sha512-Yhfk7Y0G1MYsy97oXxmSG5nvbM1sCz9EALiNhW/isAv5Xf7svzP+1RfGeBlS6mLSgRJvgSLh6Mi5DaisQuPttw==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -19017,11 +18702,15 @@ } }, "node_modules/pprof-format": { - "version": "2.0.7", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pprof-format/-/pprof-format-2.1.0.tgz", + "integrity": "sha512-0+G5bHH0RNr8E5hoZo/zJYsL92MhkZjwrHp3O2IxmY8RJL9ooKeuZ8Tm0ZNBw5sGZ9TiM71sthTjWoR2Vf5/xw==", "license": "MIT" }, "node_modules/pprof/node_modules/source-map": { "version": "0.8.0-beta.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", "license": "BSD-3-Clause", "dependencies": { "whatwg-url": "^7.0.0" @@ -19032,6 +18721,8 @@ }, "node_modules/pprof/node_modules/tr46": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", "license": "MIT", "dependencies": { "punycode": "^2.1.0" @@ -19039,10 +18730,14 @@ }, "node_modules/pprof/node_modules/webidl-conversions": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", "license": "BSD-2-Clause" }, "node_modules/pprof/node_modules/whatwg-url": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", "license": "MIT", "dependencies": { "lodash.sortby": "^4.7.0", @@ -19050,8 +18745,36 @@ "webidl-conversions": "^4.0.2" } }, + "node_modules/prebuild-install": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/precinct": { "version": "8.3.1", + "resolved": "https://registry.npmjs.org/precinct/-/precinct-8.3.1.tgz", + "integrity": "sha512-pVppfMWLp2wF68rwHqBIpPBYY8Kd12lDhk8LVQzOwqllifVR15qNFyod43YLyFpurKRZQKnE7E4pofAagDOm2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -19078,6 +18801,8 @@ }, "node_modules/precinct/node_modules/@typescript-eslint/types": { "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", + "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", "dev": true, "license": "MIT", "engines": { @@ -19090,6 +18815,8 @@ }, "node_modules/precinct/node_modules/@typescript-eslint/typescript-estree": { "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", + "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -19116,6 +18843,8 @@ }, "node_modules/precinct/node_modules/@typescript-eslint/visitor-keys": { "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", + "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", "dev": true, "license": "MIT", "dependencies": { @@ -19132,6 +18861,8 @@ }, "node_modules/precinct/node_modules/ast-module-types": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-3.0.0.tgz", + "integrity": "sha512-CMxMCOCS+4D+DkOQfuZf+vLrSEmY/7xtORwdxs4wtcC1wVgvk2MqFFTwQCFhvWsI4KPU9lcWXPI8DgRiz+xetQ==", "dev": true, "license": "MIT", "engines": { @@ -19140,11 +18871,15 @@ }, "node_modules/precinct/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/precinct/node_modules/detective-amd": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-3.1.2.tgz", + "integrity": "sha512-jffU26dyqJ37JHR/o44La6CxtrDf3Rt9tvd2IbImJYxWKTMdBjctp37qoZ6ZcY80RHg+kzWz4bXn39e4P7cctQ==", "dev": true, "license": "MIT", "dependencies": { @@ -19162,6 +18897,8 @@ }, "node_modules/precinct/node_modules/detective-cjs": { "version": "3.1.3", + "resolved": "https://registry.npmjs.org/detective-cjs/-/detective-cjs-3.1.3.tgz", + "integrity": "sha512-ljs7P0Yj9MK64B7G0eNl0ThWSYjhAaSYy+fQcpzaKalYl/UoQBOzOeLCSFEY1qEBhziZ3w7l46KG/nH+s+L7BQ==", "dev": true, "license": "MIT", "dependencies": { @@ -19174,6 +18911,8 @@ }, "node_modules/precinct/node_modules/detective-es6": { "version": "2.2.2", + "resolved": "https://registry.npmjs.org/detective-es6/-/detective-es6-2.2.2.tgz", + "integrity": "sha512-eZUKCUsbHm8xoeoCM0z6JFwvDfJ5Ww5HANo+jPR7AzkFpW9Mun3t/TqIF2jjeWa2TFbAiGaWESykf2OQp3oeMw==", "dev": true, "license": "MIT", "dependencies": { @@ -19185,6 +18924,8 @@ }, "node_modules/precinct/node_modules/detective-postcss": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-4.0.0.tgz", + "integrity": "sha512-Fwc/g9VcrowODIAeKRWZfVA/EufxYL7XfuqJQFroBKGikKX83d2G7NFw6kDlSYGG3LNQIyVa+eWv1mqre+v4+A==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -19199,6 +18940,8 @@ }, "node_modules/precinct/node_modules/detective-sass": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/detective-sass/-/detective-sass-3.0.2.tgz", + "integrity": "sha512-DNVYbaSlmti/eztFGSfBw4nZvwsTaVXEQ4NsT/uFckxhJrNRFUh24d76KzoCC3aarvpZP9m8sC2L1XbLej4F7g==", "dev": true, "license": "MIT", "dependencies": { @@ -19211,6 +18954,8 @@ }, "node_modules/precinct/node_modules/detective-scss": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detective-scss/-/detective-scss-2.0.2.tgz", + "integrity": "sha512-hDWnWh/l0tht/7JQltumpVea/inmkBaanJUcXRB9kEEXVwVUMuZd6z7eusQ6GcBFrfifu3pX/XPyD7StjbAiBg==", "dev": true, "license": "MIT", "dependencies": { @@ -19223,11 +18968,15 @@ }, "node_modules/precinct/node_modules/detective-stylus": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-1.0.3.tgz", + "integrity": "sha512-4/bfIU5kqjwugymoxLXXLltzQNeQfxGoLm2eIaqtnkWxqbhap9puDVpJPVDx96hnptdERzS5Cy6p9N8/08A69Q==", "dev": true, "license": "MIT" }, "node_modules/precinct/node_modules/detective-typescript": { "version": "7.0.2", + "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-7.0.2.tgz", + "integrity": "sha512-unqovnhxzvkCz3m1/W4QW4qGsvXCU06aU2BAm8tkza+xLnp9SOFnob2QsTxUv5PdnQKfDvWcv9YeOeFckWejwA==", "dev": true, "license": "MIT", "dependencies": { @@ -19242,11 +18991,15 @@ }, "node_modules/precinct/node_modules/detective-typescript/node_modules/ast-module-types": { "version": "2.7.1", + "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-2.7.1.tgz", + "integrity": "sha512-Rnnx/4Dus6fn7fTqdeLEAn5vUll5w7/vts0RN608yFa6si/rDOUonlIIiwugHBFWjylHjxm9owoSZn71KwG4gw==", "dev": true, "license": "MIT" }, "node_modules/precinct/node_modules/eslint-visitor-keys": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -19255,6 +19008,8 @@ }, "node_modules/precinct/node_modules/get-amd-module-type": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-amd-module-type/-/get-amd-module-type-3.0.2.tgz", + "integrity": "sha512-PcuKwB8ouJnKuAPn6Hk3UtdfKoUV3zXRqVEvj8XGIXqjWfgd1j7QGdXy5Z9OdQfzVt1Sk29HVe/P+X74ccOuqw==", "dev": true, "license": "MIT", "dependencies": { @@ -19267,6 +19022,8 @@ }, "node_modules/precinct/node_modules/node-source-walk": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-4.3.0.tgz", + "integrity": "sha512-8Q1hXew6ETzqKRAs3jjLioSxNfT1cx74ooiF8RlAONwVMcfq+UdzLC2eB5qcPldUxaE5w3ytLkrmV1TGddhZTA==", "dev": true, "license": "MIT", "dependencies": { @@ -19278,6 +19035,8 @@ }, "node_modules/precinct/node_modules/postcss-values-parser": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz", + "integrity": "sha512-2tLuBsA6P4rYTNKCXYG/71C7j1pU6pK503suYOmn4xYrQIzW+opD+7FAFNuGSdZC/3Qfy334QbeMu7MEb8gOxg==", "dev": true, "license": "MIT", "dependencies": { @@ -19291,6 +19050,8 @@ }, "node_modules/precinct/node_modules/typescript": { "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", "dev": true, "license": "Apache-2.0", "bin": { @@ -19303,6 +19064,8 @@ }, "node_modules/prelude-ls": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -19310,6 +19073,8 @@ }, "node_modules/prepend-http": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==", "dev": true, "license": "MIT", "engines": { @@ -19317,7 +19082,9 @@ } }, "node_modules/prettier": { - "version": "3.2.4", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", + "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", "dev": true, "license": "MIT", "bin": { @@ -19332,6 +19099,8 @@ }, "node_modules/prettier-linter-helpers": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", "dev": true, "license": "MIT", "dependencies": { @@ -19343,6 +19112,8 @@ }, "node_modules/pretty-bytes": { "version": "5.6.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", + "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", "dev": true, "license": "MIT", "engines": { @@ -19354,6 +19125,8 @@ }, "node_modules/pretty-format": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -19367,6 +19140,8 @@ }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "license": "MIT", "engines": { @@ -19378,6 +19153,8 @@ }, "node_modules/pretty-ms": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz", + "integrity": "sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -19392,11 +19169,15 @@ }, "node_modules/process-nextick-args": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true, "license": "MIT" }, "node_modules/progress": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "license": "MIT", "engines": { "node": ">=0.4.0" @@ -19404,6 +19185,8 @@ }, "node_modules/prom-client": { "version": "14.2.0", + "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.2.0.tgz", + "integrity": "sha512-sF308EhTenb/pDRPakm+WgiN+VdM/T1RaHj1x+MvAuT8UiQP8JmOEbxVqtkbfR4LrvOg5n7ic01kRBDGXjYikA==", "license": "Apache-2.0", "dependencies": { "tdigest": "^0.1.1" @@ -19414,6 +19197,8 @@ }, "node_modules/prompts": { "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -19426,6 +19211,8 @@ }, "node_modules/protobufjs": { "version": "7.2.6", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", + "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { @@ -19448,10 +19235,14 @@ }, "node_modules/proxy-from-env": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "license": "MIT" }, "node_modules/pump": { - "version": "3.0.0", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", @@ -19460,13 +19251,17 @@ }, "node_modules/punycode": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/pure-rand": { - "version": "6.0.4", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", "dev": true, "funding": [ { @@ -19482,6 +19277,9 @@ }, "node_modules/q": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", + "deprecated": "You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.\n\n(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)", "dev": true, "license": "MIT", "engines": { @@ -19490,10 +19288,12 @@ } }, "node_modules/qs": { - "version": "6.11.2", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.1.0" }, "engines": { "node": ">=0.6" @@ -19504,6 +19304,8 @@ }, "node_modules/query-string": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", "dev": true, "license": "MIT", "dependencies": { @@ -19517,6 +19319,8 @@ }, "node_modules/queue-microtask": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "funding": [ { "type": "github", @@ -19535,6 +19339,8 @@ }, "node_modules/quick-lru": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", "dev": true, "license": "MIT", "engines": { @@ -19543,16 +19349,22 @@ }, "node_modules/quote-unquote": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/quote-unquote/-/quote-unquote-1.0.0.tgz", + "integrity": "sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==", "dev": true, "license": "MIT" }, "node_modules/ramda": { "version": "0.27.1", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.27.1.tgz", + "integrity": "sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw==", "dev": true, "license": "MIT" }, "node_modules/range-parser": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -19560,6 +19372,8 @@ }, "node_modules/raw-body": { "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -19573,7 +19387,8 @@ }, "node_modules/rc": { "version": "1.2.8", - "dev": true, + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "dependencies": { "deep-extend": "^0.6.0", @@ -19587,19 +19402,24 @@ }, "node_modules/rc/node_modules/strip-json-comments": { "version": "2.0.1", - "dev": true, + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/react-is": { - "version": "18.2.0", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true, "license": "MIT" }, "node_modules/read-pkg": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", "dev": true, "license": "MIT", "dependencies": { @@ -19613,6 +19433,8 @@ }, "node_modules/read-pkg-up": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw==", "dev": true, "license": "MIT", "dependencies": { @@ -19625,6 +19447,8 @@ }, "node_modules/read-pkg-up/node_modules/find-up": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -19636,6 +19460,8 @@ }, "node_modules/read-pkg-up/node_modules/locate-path": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "dev": true, "license": "MIT", "dependencies": { @@ -19648,6 +19474,8 @@ }, "node_modules/read-pkg-up/node_modules/p-limit": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "license": "MIT", "dependencies": { @@ -19659,6 +19487,8 @@ }, "node_modules/read-pkg-up/node_modules/p-locate": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "dev": true, "license": "MIT", "dependencies": { @@ -19670,6 +19500,8 @@ }, "node_modules/read-pkg-up/node_modules/p-try": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "dev": true, "license": "MIT", "engines": { @@ -19678,6 +19510,8 @@ }, "node_modules/read-pkg-up/node_modules/path-exists": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true, "license": "MIT", "engines": { @@ -19686,6 +19520,8 @@ }, "node_modules/read-pkg/node_modules/path-type": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "dev": true, "license": "MIT", "dependencies": { @@ -19697,6 +19533,8 @@ }, "node_modules/read-pkg/node_modules/pify": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", "dev": true, "license": "MIT", "engines": { @@ -19705,6 +19543,8 @@ }, "node_modules/readable-stream": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, "license": "MIT", "dependencies": { @@ -19719,11 +19559,15 @@ }, "node_modules/readable-stream/node_modules/safe-buffer": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, "license": "MIT" }, "node_modules/redent": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", "dev": true, "license": "MIT", "dependencies": { @@ -19736,6 +19580,8 @@ }, "node_modules/redis-errors": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", "license": "MIT", "engines": { "node": ">=4" @@ -19743,6 +19589,8 @@ }, "node_modules/redis-parser": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", "license": "MIT", "dependencies": { "redis-errors": "^1.0.0" @@ -19751,12 +19599,38 @@ "node": ">=4" } }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regenerator-runtime": { "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", "license": "MIT" }, "node_modules/regexp-tree": { "version": "0.1.27", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", + "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", "dev": true, "license": "MIT", "bin": { @@ -19764,12 +19638,17 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.5.1", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "set-function-name": "^2.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -19780,6 +19659,8 @@ }, "node_modules/regjsparser": { "version": "0.9.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", + "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -19791,6 +19672,8 @@ }, "node_modules/regjsparser/node_modules/jsesc": { "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", "dev": true, "bin": { "jsesc": "bin/jsesc" @@ -19798,6 +19681,8 @@ }, "node_modules/repeating": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha512-ZqtSMuVybkISo2OWvqvm7iHSWngvdaW3IpsT9/uP8v4gMi591LY6h35wdOfvQdWCKFWZWm2Y1Opp4kV7vQKT6A==", "dev": true, "license": "MIT", "dependencies": { @@ -19809,6 +19694,8 @@ }, "node_modules/require-directory": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, "license": "MIT", "engines": { @@ -19817,6 +19704,8 @@ }, "node_modules/require-from-string": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -19824,11 +19713,15 @@ }, "node_modules/require-main-filename": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true, "license": "ISC" }, "node_modules/requirejs": { "version": "2.3.7", + "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.7.tgz", + "integrity": "sha512-DouTG8T1WanGok6Qjg2SXuCMzszOo0eHeH9hDZ5Y4x8Je+9JB38HdTLT4/VA8OaUhBa0JPVHJ0pyBkM1z+pDsw==", "dev": true, "license": "MIT", "bin": { @@ -19841,6 +19734,8 @@ }, "node_modules/requirejs-config-file": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/requirejs-config-file/-/requirejs-config-file-4.0.0.tgz", + "integrity": "sha512-jnIre8cbWOyvr8a5F2KuqBnY+SDA4NXr/hzEZJG79Mxm2WiFQz2dzhC8ibtPJS7zkmBEl1mxSwp5HhC1W4qpxw==", "dev": true, "license": "MIT", "dependencies": { @@ -19852,22 +19747,29 @@ } }, "node_modules/resolve": { - "version": "1.22.8", + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", "license": "MIT", "dependencies": { - "is-core-module": "^2.13.0", + "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-cwd": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, "license": "MIT", "dependencies": { @@ -19879,6 +19781,8 @@ }, "node_modules/resolve-dependency-path": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-dependency-path/-/resolve-dependency-path-2.0.0.tgz", + "integrity": "sha512-DIgu+0Dv+6v2XwRaNWnumKu7GPufBBOr5I1gRPJHkvghrfCGOooJODFvgFimX/KRxk9j0whD2MnKHzM1jYvk9w==", "dev": true, "license": "MIT", "engines": { @@ -19887,6 +19791,8 @@ }, "node_modules/resolve-dir": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", "dev": true, "license": "MIT", "dependencies": { @@ -19899,6 +19805,8 @@ }, "node_modules/resolve-from": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "license": "MIT", "engines": { @@ -19907,6 +19815,8 @@ }, "node_modules/resolve-global": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-global/-/resolve-global-1.0.0.tgz", + "integrity": "sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==", "dev": true, "license": "MIT", "dependencies": { @@ -19917,7 +19827,9 @@ } }, "node_modules/resolve.exports": { - "version": "2.0.2", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", "dev": true, "license": "MIT", "engines": { @@ -19926,6 +19838,8 @@ }, "node_modules/responselike": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==", "dev": true, "license": "MIT", "dependencies": { @@ -19934,6 +19848,8 @@ }, "node_modules/restore-cursor": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "license": "MIT", "dependencies": { @@ -19945,7 +19861,9 @@ } }, "node_modules/reusify": { - "version": "1.0.4", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "license": "MIT", "engines": { "iojs": ">=1.0.0", @@ -19953,12 +19871,17 @@ } }, "node_modules/rfdc": { - "version": "1.3.0", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", "dev": true, "license": "MIT" }, "node_modules/right-pad": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/right-pad/-/right-pad-1.0.1.tgz", + "integrity": "sha512-bYBjgxmkvTAfgIYy328fmkwhp39v8lwVgWhhrzxPV3yHtcSqyYKe9/XOhvW48UFjATg3VuJbpsp5822ACNvkmw==", + "deprecated": "Please use String.prototype.padEnd() over this package.", "dev": true, "license": "MIT", "engines": { @@ -19967,6 +19890,9 @@ }, "node_modules/rimraf": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "license": "ISC", "dependencies": { "glob": "^7.1.3" @@ -19980,6 +19906,9 @@ }, "node_modules/rimraf/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -19997,7 +19926,9 @@ } }, "node_modules/roarr": { - "version": "7.21.0", + "version": "7.21.1", + "resolved": "https://registry.npmjs.org/roarr/-/roarr-7.21.1.tgz", + "integrity": "sha512-3niqt5bXFY1InKU8HKWqqYTYjtrBaxBMnXELXCXUYgtNYGUtZM5rB46HIC430AyacL95iEniGf7RgqsesykLmQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -20011,6 +19942,8 @@ }, "node_modules/rs-jsonpath": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/rs-jsonpath/-/rs-jsonpath-1.1.2.tgz", + "integrity": "sha512-IQzlqtVyZniK7aOtpKGrv7BvkamSvLJkIhRGoKKDQLppNJe94BVHqpxNRjw/2042nGjtC3vyfCWyHe+3DlWgWA==", "license": "MIT", "dependencies": { "esprima": "1.2.2", @@ -20020,6 +19953,8 @@ }, "node_modules/rs-jsonpath/node_modules/esprima": { "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", + "integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -20030,6 +19965,8 @@ }, "node_modules/run-async": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true, "license": "MIT", "engines": { @@ -20038,6 +19975,8 @@ }, "node_modules/run-parallel": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "funding": [ { "type": "github", @@ -20058,7 +19997,9 @@ } }, "node_modules/rxjs": { - "version": "7.8.1", + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -20066,12 +20007,15 @@ } }, "node_modules/safe-array-concat": { - "version": "1.0.1", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "has-symbols": "^1.0.3", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", "isarray": "^2.0.5" }, "engines": { @@ -20083,10 +20027,14 @@ }, "node_modules/safe-array-concat/node_modules/isarray": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "license": "MIT" }, "node_modules/safe-buffer": { "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -20103,8 +20051,32 @@ ], "license": "MIT" }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-push-apply/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" + }, "node_modules/safe-regex": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz", + "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==", "dev": true, "license": "MIT", "dependencies": { @@ -20112,19 +20084,26 @@ } }, "node_modules/safe-regex-test": { - "version": "1.0.0", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "is-regex": "^1.1.4" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/safe-stable-stringify": { - "version": "2.4.3", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", "license": "MIT", "engines": { "node": ">=10" @@ -20132,10 +20111,14 @@ }, "node_modules/safer-buffer": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "license": "MIT" }, "node_modules/sass-lookup": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/sass-lookup/-/sass-lookup-3.0.0.tgz", + "integrity": "sha512-TTsus8CfFRn1N44bvdEai1no6PqdmDiQUiqW5DlpmtT+tYnIt1tXtDIph5KA1efC+LmioJXSnCtUVpcK9gaKIg==", "dev": true, "license": "MIT", "dependencies": { @@ -20150,15 +20133,16 @@ }, "node_modules/sass-lookup/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/semver": { - "version": "7.5.4", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -20168,11 +20152,15 @@ }, "node_modules/semver-compare": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", "dev": true, "license": "MIT" }, "node_modules/semver-regex": { "version": "3.1.4", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz", + "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==", "dev": true, "license": "MIT", "engines": { @@ -20182,132 +20170,293 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "license": "ISC", + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", "dependencies": { - "yallist": "^4.0.0" + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" }, "engines": { - "node": ">=10" + "node": ">= 0.4" } }, - "node_modules/semver/node_modules/yallist": { - "version": "4.0.0", + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-value": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-4.1.0.tgz", + "integrity": "sha512-zTEg4HL0RwVrqcWs3ztF+x1vkxfm0lP+MQQFPiMJTKVceBwEV0A569Ou8l9IYQG8jOZdMVI1hGsc0tmeD2o/Lw==", + "funding": [ + "https://github.com/sponsors/jonschlinkert", + "https://paypal.me/jonathanschlinkert", + "https://jonschlinkert.dev/sponsor" + ], + "license": "MIT", + "dependencies": { + "is-plain-object": "^2.0.4", + "is-primitive": "^3.0.1" + }, + "engines": { + "node": ">=11.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "license": "ISC" }, - "node_modules/set-blocking": { + "node_modules/sha256": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sha256/-/sha256-0.2.0.tgz", + "integrity": "sha512-kTWMJUaez5iiT9CcMv8jSq6kMhw3ST0uRdcIWl3D77s6AsLXNXRp3heeqqfu5+Dyfu4hwpQnMzhqHh8iNQxw0w==", + "dependencies": { + "convert-hex": "~0.1.0", + "convert-string": "~0.1.0" + } + }, + "node_modules/shebang-command": { "version": "2.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } }, - "node_modules/set-function-length": { - "version": "1.1.1", + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shellwords": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "dev": true, + "license": "MIT" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "license": "MIT", "dependencies": { - "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/set-function-name": { - "version": "2.0.1", + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", "license": "MIT", "dependencies": { - "define-data-property": "^1.0.1", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.0" + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/set-value": { - "version": "4.1.0", + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", "funding": [ - "https://github.com/sponsors/jonschlinkert", - "https://paypal.me/jonathanschlinkert", - "https://jonschlinkert.dev/sponsor" + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } ], "license": "MIT", "dependencies": { - "is-plain-object": "^2.0.4", - "is-primitive": "^3.0.1" - }, - "engines": { - "node": ">=11.0" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "license": "ISC" - }, - "node_modules/sha256": { - "version": "0.2.0", - "dependencies": { - "convert-hex": "~0.1.0", - "convert-string": "~0.1.0" + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" } }, - "node_modules/shebang-command": { - "version": "2.0.0", + "node_modules/simple-get/node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", "license": "MIT", "dependencies": { - "shebang-regex": "^3.0.0" + "mimic-response": "^3.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/shebang-regex": { - "version": "3.0.0", + "node_modules/simple-get/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", "license": "MIT", "engines": { - "node": ">=8" - } - }, - "node_modules/shellwords": { - "version": "0.1.1", - "dev": true, - "license": "MIT" - }, - "node_modules/side-channel": { - "version": "1.0.4", - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/signal-exit": { - "version": "3.0.7", - "license": "ISC" - }, "node_modules/simple-swizzle": { "version": "0.2.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", "dependencies": { "is-arrayish": "^0.3.1" } }, "node_modules/simple-swizzle/node_modules/is-arrayish": { "version": "0.3.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, "node_modules/sisteransi": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", "dev": true, "license": "MIT" }, "node_modules/slash": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "license": "MIT", "engines": { "node": ">=8" @@ -20315,6 +20464,8 @@ }, "node_modules/slice-ansi": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", "dev": true, "license": "MIT", "dependencies": { @@ -20330,6 +20481,8 @@ }, "node_modules/slice-ansi/node_modules/ansi-styles": { "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "license": "MIT", "engines": { @@ -20341,6 +20494,8 @@ }, "node_modules/sort-keys": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==", "dev": true, "license": "MIT", "dependencies": { @@ -20352,13 +20507,17 @@ }, "node_modules/source-map": { "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "license": "BSD-3-Clause", "engines": { "node": ">= 8" } }, "node_modules/source-map-js": { - "version": "1.0.2", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -20367,6 +20526,8 @@ }, "node_modules/source-map-support": { "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, "license": "MIT", "dependencies": { @@ -20376,6 +20537,8 @@ }, "node_modules/source-map-support/node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -20384,6 +20547,8 @@ }, "node_modules/spdx-correct": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", "license": "Apache-2.0", "dependencies": { "spdx-expression-parse": "^3.0.0", @@ -20391,11 +20556,15 @@ } }, "node_modules/spdx-exceptions": { - "version": "2.3.0", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", "license": "CC-BY-3.0" }, "node_modules/spdx-expression-parse": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "license": "MIT", "dependencies": { "spdx-exceptions": "^2.1.0", @@ -20403,11 +20572,15 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.16", + "version": "3.0.21", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz", + "integrity": "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==", "license": "CC0-1.0" }, "node_modules/split": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", "license": "MIT", "dependencies": { "through": "2" @@ -20418,6 +20591,8 @@ }, "node_modules/split2": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", "dev": true, "license": "ISC", "dependencies": { @@ -20426,6 +20601,8 @@ }, "node_modules/split2/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -20439,11 +20616,15 @@ }, "node_modules/sprintf-js": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true, "license": "BSD-3-Clause" }, "node_modules/sqlstring": { "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -20451,6 +20632,8 @@ }, "node_modules/stack-generator": { "version": "2.0.10", + "resolved": "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.10.tgz", + "integrity": "sha512-mwnua/hkqM6pF4k8SnmZ2zfETsRUpWXREfA/goT8SLCV4iOFa4bzOX2nDipWAZFPTjLvQB82f5yaodMVhK0yJQ==", "license": "MIT", "dependencies": { "stackframe": "^1.3.4" @@ -20458,13 +20641,16 @@ }, "node_modules/stack-trace": { "version": "0.0.10", - "license": "MIT", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", "engines": { "node": "*" } }, "node_modules/stack-utils": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", "dev": true, "license": "MIT", "dependencies": { @@ -20476,6 +20662,8 @@ }, "node_modules/stack-utils/node_modules/escape-string-regexp": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true, "license": "MIT", "engines": { @@ -20484,10 +20672,14 @@ }, "node_modules/stackframe": { "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", "license": "MIT" }, "node_modules/stacktrace-parser": { - "version": "0.1.10", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.11.tgz", + "integrity": "sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg==", "license": "MIT", "dependencies": { "type-fest": "^0.7.1" @@ -20498,6 +20690,8 @@ }, "node_modules/stacktrace-parser/node_modules/type-fest": { "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=8" @@ -20505,10 +20699,14 @@ }, "node_modules/standard-as-callback": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", + "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==", "license": "MIT" }, "node_modules/standard-version": { "version": "9.5.0", + "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-9.5.0.tgz", + "integrity": "sha512-3zWJ/mmZQsOaO+fOlsa0+QK90pwhNd042qEcw6hKFNoLFs7peGyvPffpEBbK/DSGPbyOvli0mUIFv5A4qTjh2Q==", "dev": true, "license": "ISC", "dependencies": { @@ -20536,6 +20734,8 @@ }, "node_modules/standard-version/node_modules/cliui": { "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "license": "ISC", "dependencies": { @@ -20546,6 +20746,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog": { "version": "3.1.25", + "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.25.tgz", + "integrity": "sha512-ryhi3fd1mKf3fSjbLXOfK2D06YwKNic1nC9mWqybBHdObPd8KJ2vjaXZfYj1U23t+V8T8n0d7gwnc9XbIdFbyQ==", "dev": true, "license": "MIT", "dependencies": { @@ -20567,6 +20769,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-angular": { "version": "5.0.13", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz", + "integrity": "sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==", "dev": true, "license": "ISC", "dependencies": { @@ -20579,6 +20783,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-conventionalcommits": { "version": "4.6.3", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.3.tgz", + "integrity": "sha512-LTTQV4fwOM4oLPad317V/QNQ1FY4Hju5qeBIM1uTHbrnCE+Eg4CdRZ3gO2pUeR+tzWdp80M2j3qFFEDWVqOV4g==", "dev": true, "license": "ISC", "dependencies": { @@ -20592,6 +20798,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-core": { "version": "4.2.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz", + "integrity": "sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg==", "dev": true, "license": "MIT", "dependencies": { @@ -20616,6 +20824,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-core/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -20624,6 +20834,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-jquery": { "version": "3.0.11", + "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.11.tgz", + "integrity": "sha512-x8AWz5/Td55F7+o/9LQ6cQIPwrCjfJQ5Zmfqi8thwUEKHstEn4kTIofXub7plf1xvFA2TqhZlq7fy5OmV6BOMw==", "dev": true, "license": "ISC", "dependencies": { @@ -20635,6 +20847,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-writer": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz", + "integrity": "sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ==", "dev": true, "license": "MIT", "dependencies": { @@ -20657,6 +20871,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-writer/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -20665,6 +20881,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-writer/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -20673,6 +20891,8 @@ }, "node_modules/standard-version/node_modules/conventional-commits-parser": { "version": "3.2.4", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz", + "integrity": "sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -20692,6 +20912,8 @@ }, "node_modules/standard-version/node_modules/conventional-commits-parser/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -20700,6 +20922,8 @@ }, "node_modules/standard-version/node_modules/get-pkg-repo": { "version": "4.2.1", + "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-4.2.1.tgz", + "integrity": "sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA==", "dev": true, "license": "MIT", "dependencies": { @@ -20717,6 +20941,8 @@ }, "node_modules/standard-version/node_modules/git-semver-tags": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz", + "integrity": "sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==", "dev": true, "license": "MIT", "dependencies": { @@ -20732,6 +20958,8 @@ }, "node_modules/standard-version/node_modules/git-semver-tags/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -20740,6 +20968,8 @@ }, "node_modules/standard-version/node_modules/hosted-git-info": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", "dev": true, "license": "ISC", "dependencies": { @@ -20751,6 +20981,8 @@ }, "node_modules/standard-version/node_modules/lru-cache": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "license": "ISC", "dependencies": { @@ -20762,6 +20994,8 @@ }, "node_modules/standard-version/node_modules/normalize-package-data": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -20776,6 +21010,8 @@ }, "node_modules/standard-version/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -20789,11 +21025,15 @@ }, "node_modules/standard-version/node_modules/yallist": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true, "license": "ISC" }, "node_modules/standard-version/node_modules/yargs": { "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "license": "MIT", "dependencies": { @@ -20811,6 +21051,8 @@ }, "node_modules/static-eval": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", + "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", "license": "MIT", "dependencies": { "escodegen": "^1.8.1" @@ -20818,6 +21060,8 @@ }, "node_modules/static-eval/node_modules/escodegen": { "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", "license": "BSD-2-Clause", "dependencies": { "esprima": "^4.0.1", @@ -20838,6 +21082,8 @@ }, "node_modules/static-eval/node_modules/levn": { "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "license": "MIT", "dependencies": { "prelude-ls": "~1.1.2", @@ -20849,6 +21095,8 @@ }, "node_modules/static-eval/node_modules/optionator": { "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "license": "MIT", "dependencies": { "deep-is": "~0.1.3", @@ -20864,12 +21112,16 @@ }, "node_modules/static-eval/node_modules/prelude-ls": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "engines": { "node": ">= 0.8.0" } }, "node_modules/static-eval/node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "license": "BSD-3-Clause", "optional": true, "engines": { @@ -20878,6 +21130,8 @@ }, "node_modules/static-eval/node_modules/type-check": { "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "license": "MIT", "dependencies": { "prelude-ls": "~1.1.2" @@ -20887,19 +21141,19 @@ } }, "node_modules/stats-accumulator": { - "version": "1.1.3", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/stats-accumulator/-/stats-accumulator-1.2.15.tgz", + "integrity": "sha512-9joMhuHyojZEJrZi7mn1zgCQiQSwmAxLrwpwBgKEGlY6zSbDGrikd2sSSpt1KmzqhHSFL8i48iV7O36a1wfEzg==", "dev": true, "license": "MIT", "engines": { "node": ">=0.8" } }, - "node_modules/statsd-client": { - "version": "0.4.7", - "license": "MIT" - }, "node_modules/statuses": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -20907,6 +21161,8 @@ }, "node_modules/stream-browserify": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", "license": "MIT", "dependencies": { "inherits": "~2.0.4", @@ -20915,6 +21171,8 @@ }, "node_modules/stream-browserify/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -20927,6 +21185,8 @@ }, "node_modules/stream-to-array": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/stream-to-array/-/stream-to-array-2.3.0.tgz", + "integrity": "sha512-UsZtOYEn4tWU2RGLOXr/o/xjRBftZRlG3dEWoaHr8j4GuypJ3isitGbVyjQKAuMu+xbiop8q224TjiZWc4XTZA==", "dev": true, "license": "MIT", "dependencies": { @@ -20935,6 +21195,8 @@ }, "node_modules/strict-uri-encode": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==", "dev": true, "license": "MIT", "engines": { @@ -20943,6 +21205,8 @@ }, "node_modules/string_decoder": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" @@ -20950,10 +21214,14 @@ }, "node_modules/string_decoder/node_modules/safe-buffer": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "license": "MIT" }, "node_modules/string-argv": { "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", "dev": true, "license": "MIT", "engines": { @@ -20962,6 +21230,8 @@ }, "node_modules/string-length": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", "dev": true, "license": "MIT", "dependencies": { @@ -20974,6 +21244,8 @@ }, "node_modules/string-width": { "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -20987,6 +21259,8 @@ "node_modules/string-width-cjs": { "name": "string-width", "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", "dependencies": { @@ -21000,6 +21274,8 @@ }, "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "license": "MIT", "engines": { @@ -21008,18 +21284,26 @@ }, "node_modules/string-width/node_modules/is-fullwidth-code-point": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/string.prototype.trim": { - "version": "1.2.8", + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -21029,24 +21313,35 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.7", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.7", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -21054,6 +21349,8 @@ }, "node_modules/stringify-object": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -21067,11 +21364,16 @@ }, "node_modules/stringify-package": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stringify-package/-/stringify-package-1.0.1.tgz", + "integrity": "sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg==", + "deprecated": "This module is not used anymore, and has been replaced by @npmcli/package-json", "dev": true, "license": "ISC" }, "node_modules/strip-ansi": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -21083,6 +21385,8 @@ "node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", "dependencies": { @@ -21094,6 +21398,8 @@ }, "node_modules/strip-bom": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, "license": "MIT", "engines": { @@ -21102,6 +21408,8 @@ }, "node_modules/strip-final-newline": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, "license": "MIT", "engines": { @@ -21110,6 +21418,8 @@ }, "node_modules/strip-indent": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", "dev": true, "license": "MIT", "dependencies": { @@ -21121,6 +21431,8 @@ }, "node_modules/strip-json-comments": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "license": "MIT", "engines": { "node": ">=8" @@ -21130,11 +21442,21 @@ } }, "node_modules/strnum": { - "version": "1.0.5", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz", + "integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], "license": "MIT" }, "node_modules/stylus-lookup": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/stylus-lookup/-/stylus-lookup-3.0.2.tgz", + "integrity": "sha512-oEQGHSjg/AMaWlKe7gqsnYzan8DLcGIHe0dUaFkucZZ14z4zjENRlQMCHT4FNsiWnJf17YN9OvrCfCoi7VvOyg==", "dev": true, "license": "MIT", "dependencies": { @@ -21150,11 +21472,15 @@ }, "node_modules/stylus-lookup/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/subdirs": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/subdirs/-/subdirs-1.0.1.tgz", + "integrity": "sha512-KSbUKpwQIRcb5Th+l4EzxEZYpCwV/g0pQ348EV7CIM5YEEgzz2L1KJD8FCeTckTiE/TKn2u09DCxpdAL6/iFbg==", "license": "MIT", "dependencies": { "es6-promise": "^3.0.2" @@ -21162,6 +21488,9 @@ }, "node_modules/superagent": { "version": "8.1.2", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.1.2.tgz", + "integrity": "sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==", + "deprecated": "Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net", "dev": true, "license": "MIT", "dependencies": { @@ -21180,13 +21509,28 @@ "node": ">=6.4.0 <13 || >=14" } }, + "node_modules/superagent/node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "dev": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/supertest": { - "version": "6.3.3", + "version": "6.3.4", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.3.4.tgz", + "integrity": "sha512-erY3HFDG0dPnhw4U+udPfrzXa4xhSG+n4rxfRuZWCUvjFWwKl+OxWf/7zk50s84/fAAs7vf5QAb9uRa0cCykxw==", "dev": true, "license": "MIT", "dependencies": { "methods": "^1.1.2", - "superagent": "^8.0.5" + "superagent": "^8.1.2" }, "engines": { "node": ">=6.4.0" @@ -21194,6 +21538,8 @@ }, "node_modules/supports-color": { "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "license": "MIT", "dependencies": { "has-flag": "^3.0.0" @@ -21204,6 +21550,8 @@ }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -21214,6 +21562,8 @@ }, "node_modules/swagger-cli": { "version": "4.0.4", + "resolved": "https://registry.npmjs.org/swagger-cli/-/swagger-cli-4.0.4.tgz", + "integrity": "sha512-Cp8YYuLny3RJFQ4CvOBTaqmOOgYsem52dPx1xM5S4EUWFblIh2Q8atppMZvXKUr1e9xH5RwipYpmdUzdPcxWcA==", "dev": true, "license": "MIT", "dependencies": { @@ -21227,10 +21577,11 @@ } }, "node_modules/synckit": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.1.tgz", - "integrity": "sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==", + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", "dev": true, + "license": "MIT", "dependencies": { "@pkgr/core": "^0.1.0", "tslib": "^2.6.2" @@ -21244,6 +21595,8 @@ }, "node_modules/tapable": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, "license": "MIT", "engines": { @@ -21252,6 +21605,8 @@ }, "node_modules/tar": { "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "license": "ISC", "dependencies": { "chownr": "^2.0.0", @@ -21265,8 +21620,58 @@ "node": ">=10" } }, + "node_modules/tar-fs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.2.tgz", + "integrity": "sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-fs/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar-stream/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/tar/node_modules/minipass": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "license": "ISC", "engines": { "node": ">=8" @@ -21274,10 +21679,14 @@ }, "node_modules/tar/node_modules/yallist": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "license": "ISC" }, "node_modules/tdigest": { "version": "0.1.2", + "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.2.tgz", + "integrity": "sha512-+G0LLgjjo9BZX2MfdvPfH+MKLCrxlXSYec5DaPYP1fe6Iyhf0/fSmJ0bFiZ1F8BT6cGXl2LpltQptzjXKWEkKA==", "license": "MIT", "dependencies": { "bintrees": "1.0.2" @@ -21285,6 +21694,8 @@ }, "node_modules/test-exclude": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "license": "ISC", "dependencies": { @@ -21298,6 +21709,9 @@ }, "node_modules/test-exclude/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -21317,6 +21731,8 @@ }, "node_modules/text-extensions": { "version": "1.9.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", + "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", "dev": true, "license": "MIT", "engines": { @@ -21325,18 +21741,25 @@ }, "node_modules/text-hex": { "version": "1.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" }, "node_modules/text-table": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "license": "MIT" }, "node_modules/through": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "license": "MIT" }, "node_modules/through2": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "license": "MIT", "dependencies": { @@ -21346,6 +21769,8 @@ }, "node_modules/timed-out": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==", "dev": true, "license": "MIT", "engines": { @@ -21354,6 +21779,8 @@ }, "node_modules/tmp": { "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "license": "MIT", "dependencies": { @@ -21365,25 +21792,23 @@ }, "node_modules/tmpl": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true, "license": "BSD-3-Clause" }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/to-function": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/to-function/-/to-function-2.0.6.tgz", + "integrity": "sha512-LWfUmW851x5T8+78Nl82CA2j6w0trhoFj4rpS6pFUMgfUMUySDAKPgTvQkUqlWuH3Lihlk5sPyDHSVwmKDSc5Q==", "dependencies": { "component-props": "*" } }, "node_modules/to-regex-range": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -21394,6 +21819,8 @@ }, "node_modules/toidentifier": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "license": "MIT", "engines": { "node": ">=0.6" @@ -21401,10 +21828,14 @@ }, "node_modules/tr46": { "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "license": "MIT" }, "node_modules/trim-newlines": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", "dev": true, "license": "MIT", "engines": { @@ -21413,20 +21844,25 @@ }, "node_modules/triple-beam": { "version": "1.4.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", + "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", "engines": { "node": ">= 14.0.0" } }, "node_modules/truncate-utf8-bytes": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", + "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", "license": "WTFPL", "dependencies": { "utf8-byte-length": "^1.0.1" } }, "node_modules/ts-graphviz": { - "version": "1.8.1", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/ts-graphviz/-/ts-graphviz-1.8.2.tgz", + "integrity": "sha512-5YhbFoHmjxa7pgQLkB07MtGnGJ/yhvjmc9uhsnDBEICME6gkPf83SBwLDQqGDoCa3XzUMWLk1AU2Wn1u1naDtA==", "dev": true, "license": "MIT", "engines": { @@ -21438,10 +21874,11 @@ } }, "node_modules/ts-jest": { - "version": "29.2.5", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", - "integrity": "sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==", + "version": "29.2.6", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.6.tgz", + "integrity": "sha512-yTNZVZqc8lSixm+QGVFcPe6+yj7+TWZwIesuOWvfcn4B9bz5x4NDzVCQQjOs7Hfouu36aEqfEbo9Qpo+gq8dDg==", "dev": true, + "license": "MIT", "dependencies": { "bs-logger": "^0.2.6", "ejs": "^3.1.10", @@ -21450,7 +21887,7 @@ "json5": "^2.2.3", "lodash.memoize": "^4.1.2", "make-error": "^1.3.6", - "semver": "^7.6.3", + "semver": "^7.7.1", "yargs-parser": "^21.1.1" }, "bin": { @@ -21485,20 +21922,10 @@ } } }, - "node_modules/ts-jest/node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/ts-jest/node_modules/yargs-parser": { "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "license": "ISC", "engines": { @@ -21507,6 +21934,8 @@ }, "node_modules/ts-node": { "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "license": "MIT", "dependencies": { @@ -21549,6 +21978,8 @@ }, "node_modules/tsconfig-paths": { "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "license": "MIT", "dependencies": { "@types/json5": "^0.0.29", @@ -21559,6 +21990,8 @@ }, "node_modules/tsconfig-paths/node_modules/json5": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "license": "MIT", "dependencies": { "minimist": "^1.2.0" @@ -21569,18 +22002,23 @@ }, "node_modules/tsconfig-paths/node_modules/strip-bom": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" }, "node_modules/tsscmp": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", + "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==", "license": "MIT", "engines": { "node": ">=0.6.x" @@ -21588,6 +22026,8 @@ }, "node_modules/tsutils": { "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "license": "MIT", "dependencies": { "tslib": "^1.8.1" @@ -21601,10 +22041,26 @@ }, "node_modules/tsutils/node_modules/tslib": { "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "license": "0BSD" }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-check": { "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" @@ -21615,6 +22071,8 @@ }, "node_modules/type-detect": { "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, "license": "MIT", "engines": { @@ -21623,6 +22081,8 @@ }, "node_modules/type-fest": { "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" @@ -21633,6 +22093,8 @@ }, "node_modules/type-is": { "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "license": "MIT", "dependencies": { "media-typer": "0.3.0", @@ -21643,25 +22105,30 @@ } }, "node_modules/typed-array-buffer": { - "version": "1.0.0", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "is-typed-array": "^1.1.10" + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" } }, "node_modules/typed-array-byte-length": { - "version": "1.0.0", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.8", "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" @@ -21671,14 +22138,18 @@ } }, "node_modules/typed-array-byte-offset": { - "version": "1.0.0", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", "license": "MIT", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" }, "engines": { "node": ">= 0.4" @@ -21688,12 +22159,20 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.4", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "is-typed-array": "^1.1.9" + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -21701,11 +22180,15 @@ }, "node_modules/typedarray": { "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "dev": true, "license": "MIT" }, "node_modules/typescript": { - "version": "5.3.3", + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -21716,7 +22199,9 @@ } }, "node_modules/ua-parser-js": { - "version": "1.0.37", + "version": "1.0.40", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.40.tgz", + "integrity": "sha512-z6PJ8Lml+v3ichVojCiB8toQJBuwR42ySM4ezjXIqXK3M0HczmKQ3LF4rhU55PfD99KEEXQG6yb7iOMyvYuHew==", "funding": [ { "type": "opencollective", @@ -21732,12 +22217,17 @@ } ], "license": "MIT", + "bin": { + "ua-parser-js": "script/cli.js" + }, "engines": { "node": "*" } }, "node_modules/uglify-js": { - "version": "3.17.4", + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", "license": "BSD-2-Clause", "optional": true, "bin": { @@ -21748,13 +22238,18 @@ } }, "node_modules/unbox-primitive": { - "version": "1.0.2", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", + "call-bound": "^1.0.3", "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -21762,19 +22257,21 @@ }, "node_modules/underscore": { "version": "1.12.1", - "license": "MIT" - }, - "node_modules/undici-types": { - "version": "5.26.5", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", + "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==", "license": "MIT" }, "node_modules/uniq": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==", "dev": true, "license": "MIT" }, "node_modules/universalify": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "license": "MIT", "engines": { @@ -21783,6 +22280,8 @@ }, "node_modules/unpipe": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -21790,6 +22289,8 @@ }, "node_modules/unset-value": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-2.0.1.tgz", + "integrity": "sha512-2hvrBfjUE00PkqN+q0XP6yRAOGrR06uSiUoIQGZkc7GxvQ9H7v8quUPNtZjMg4uux69i8HWpIjLPUKwCuRGyNg==", "license": "MIT", "dependencies": { "has-value": "^2.0.2", @@ -21801,13 +22302,17 @@ }, "node_modules/unset-value/node_modules/isobject": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/update-browserslist-db": { - "version": "1.0.13", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", "dev": true, "funding": [ { @@ -21825,8 +22330,8 @@ ], "license": "MIT", "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.2.0", + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -21837,6 +22342,8 @@ }, "node_modules/uri-js": { "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" @@ -21844,6 +22351,8 @@ }, "node_modules/url-parse-lax": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==", "dev": true, "license": "MIT", "dependencies": { @@ -21855,6 +22364,8 @@ }, "node_modules/url-to-options": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A==", "dev": true, "license": "MIT", "engines": { @@ -21862,15 +22373,21 @@ } }, "node_modules/utf8-byte-length": { - "version": "1.0.4", - "license": "WTFPL" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", + "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==", + "license": "(WTFPL OR MIT)" }, "node_modules/utf8-length": { "version": "0.0.1", + "resolved": "https://registry.npmjs.org/utf8-length/-/utf8-length-0.0.1.tgz", + "integrity": "sha512-j/XH2ftofBiobnyApxlN/J6j/ixwT89WEjDcjT66d2i0+GIn9RZfzt8lpEXXE4jUe4NsjBSUq70kS2euQ4nnMw==", "license": "MIT" }, "node_modules/util-deprecate": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, "node_modules/uuid": { @@ -21881,17 +22398,22 @@ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true, "license": "MIT" }, "node_modules/v8-to-istanbul": { - "version": "9.2.0", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, "license": "ISC", "dependencies": { @@ -21904,18 +22426,33 @@ } }, "node_modules/valid-url": { - "version": "1.0.9" + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz", + "integrity": "sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA==" }, "node_modules/validate-npm-package-license": { "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "license": "Apache-2.0", "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" } }, + "node_modules/validator": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz", + "integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, "node_modules/vary": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -21923,6 +22460,8 @@ }, "node_modules/vscode-json-languageservice": { "version": "4.2.1", + "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-4.2.1.tgz", + "integrity": "sha512-xGmv9QIWs2H8obGbWg+sIPI/3/pFgj/5OWBhNzs00BkYQ9UaB2F6JJaGB/2/YOZJ3BvLXQTC4Q7muqU25QgAhA==", "dev": true, "license": "MIT", "dependencies": { @@ -21934,27 +22473,37 @@ } }, "node_modules/vscode-languageserver-textdocument": { - "version": "1.0.11", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", "dev": true, "license": "MIT" }, "node_modules/vscode-languageserver-types": { "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", "dev": true, "license": "MIT" }, "node_modules/vscode-nls": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.2.0.tgz", + "integrity": "sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==", "dev": true, "license": "MIT" }, "node_modules/vscode-uri": { - "version": "3.0.8", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz", + "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==", "dev": true, "license": "MIT" }, "node_modules/walkdir": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.4.1.tgz", + "integrity": "sha512-3eBwRyEln6E1MSzcxcVpQIhRG8Q1jLvEqRmCZqS3dsfXEDR/AhOF4d+jHg1qvDCpYaVRZjENPQyrVxAkQqxPgQ==", "dev": true, "license": "MIT", "engines": { @@ -21963,6 +22512,8 @@ }, "node_modules/walker": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -21971,6 +22522,8 @@ }, "node_modules/wcwidth": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "license": "MIT", "dependencies": { "defaults": "^1.0.3" @@ -21978,10 +22531,14 @@ }, "node_modules/webidl-conversions": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "license": "BSD-2-Clause" }, "node_modules/whatwg-url": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "license": "MIT", "dependencies": { "tr46": "~0.0.3", @@ -21990,6 +22547,8 @@ }, "node_modules/which": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -22002,14 +22561,70 @@ } }, "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" + }, + "node_modules/which-collection": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", "license": "MIT", "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -22017,18 +22632,23 @@ }, "node_modules/which-module": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", "dev": true, "license": "ISC" }, "node_modules/which-typed-array": { - "version": "1.1.13", + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz", + "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", "license": "MIT", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -22039,6 +22659,8 @@ }, "node_modules/wide-align": { "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "license": "ISC", "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" @@ -22046,6 +22668,8 @@ }, "node_modules/widest-line": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", "dev": true, "license": "MIT", "dependencies": { @@ -22056,31 +22680,33 @@ } }, "node_modules/winston": { - "version": "3.11.0", - "license": "MIT", + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz", + "integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==", "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", "is-stream": "^2.0.0", - "logform": "^2.4.0", + "logform": "^2.7.0", "one-time": "^1.0.0", "readable-stream": "^3.4.0", "safe-stable-stringify": "^2.3.1", "stack-trace": "0.0.x", "triple-beam": "^1.3.0", - "winston-transport": "^4.5.0" + "winston-transport": "^4.9.0" }, "engines": { "node": ">= 12.0.0" } }, "node_modules/winston-transport": { - "version": "4.6.0", - "license": "MIT", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", + "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", "dependencies": { - "logform": "^2.3.2", - "readable-stream": "^3.6.0", + "logform": "^2.7.0", + "readable-stream": "^3.6.2", "triple-beam": "^1.3.0" }, "engines": { @@ -22089,7 +22715,8 @@ }, "node_modules/winston-transport/node_modules/readable-stream": { "version": "3.6.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -22101,7 +22728,8 @@ }, "node_modules/winston/node_modules/readable-stream": { "version": "3.6.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -22113,6 +22741,8 @@ }, "node_modules/word-wrap": { "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -22120,10 +22750,14 @@ }, "node_modules/wordwrap": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", "license": "MIT" }, "node_modules/wrap-ansi": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "license": "MIT", "dependencies": { @@ -22141,6 +22775,8 @@ "node_modules/wrap-ansi-cjs": { "name": "wrap-ansi", "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "license": "MIT", "dependencies": { @@ -22157,6 +22793,8 @@ }, "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -22171,6 +22809,8 @@ }, "node_modules/wrap-ansi-cjs/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -22182,11 +22822,15 @@ }, "node_modules/wrap-ansi-cjs/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -22201,6 +22845,8 @@ }, "node_modules/wrap-ansi/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -22212,15 +22858,21 @@ }, "node_modules/wrap-ansi/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/wrappy": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, "node_modules/write-file-atomic": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, "license": "ISC", "dependencies": { @@ -22233,6 +22885,8 @@ }, "node_modules/xtend": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true, "license": "MIT", "engines": { @@ -22241,6 +22895,8 @@ }, "node_modules/y18n": { "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, "license": "ISC", "engines": { @@ -22249,11 +22905,15 @@ }, "node_modules/yallist": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true, "license": "ISC" }, "node_modules/yaml": { - "version": "2.4.3", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", "license": "ISC", "bin": { "yaml": "bin.mjs" @@ -22264,6 +22924,8 @@ }, "node_modules/yargs": { "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "license": "MIT", "dependencies": { @@ -22281,6 +22943,8 @@ }, "node_modules/yargs-parser": { "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, "license": "ISC", "engines": { @@ -22289,6 +22953,8 @@ }, "node_modules/yargs/node_modules/yargs-parser": { "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "license": "ISC", "engines": { @@ -22296,7 +22962,9 @@ } }, "node_modules/ylru": { - "version": "1.3.2", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.4.0.tgz", + "integrity": "sha512-2OQsPNEmBCvXuFlIni/a+Rn+R2pHW9INm0BxXJ4hVDA8TirqMj+J/Rp9ItLatT/5pZqWwefVrTQcHpixsxnVlA==", "license": "MIT", "engines": { "node": ">= 4.0.0" @@ -22304,6 +22972,8 @@ }, "node_modules/yn": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, "license": "MIT", "engines": { @@ -22312,6 +22982,8 @@ }, "node_modules/yocto-queue": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "license": "MIT", "engines": { "node": ">=10" @@ -22321,7 +22993,9 @@ } }, "node_modules/zod": { - "version": "3.22.4", + "version": "3.24.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", + "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/package.json b/package.json index b9064fac2c5..95e666e032b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.86.0", + "version": "1.94.0", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { @@ -15,7 +15,7 @@ "main": "GATransform.js", "scripts": { "copy": "find ./src -name '*.yaml' -o -name '*.csv' | cpio -pdm ./dist", - "clean": "rm -rf ./dist", + "clean": "rm -rf ./dist ./dist-test", "setup": "npm ci", "setup:swagger": "swagger-cli bundle swagger/api.yaml --outfile dist/swagger.json --type json", "format": "prettier --write .", @@ -23,22 +23,23 @@ "lint:fix:json": "eslint --ext .json --fix .", "lint": "npm run format && npm run lint:fix", "check:merge": "npm run verify || exit 1; codecov", - "start": "cd dist;exec node ./src/index.js;cd ..", + "start": "cd dist && NODE_OPTIONS='--no-node-snapshot' node ./src/index.js && cd ..", "build:start": "npm run build && npm run start", "build:ci": "tsc -p tsconfig.json", "build:swagger": "npm run build && npm run setup:swagger", + "build:test": "tsc -p tsconfig.test.json", "build": "npm run build:ci && npm run copy", "clean:build": "npm run clean && npm run build", "build:clean": "npm run clean && npm run build", "verify": "eslint . || exit 1; npm run test:js || exit 1", "test:testRouter": "jest testRouter --detectOpenHandles --coverage --notify --watchAll=false", "test:benchmark": "node benchmark/index.js", - "test": "jest -c jest.config.js --detectOpenHandles", + "test": "NODE_OPTIONS='--no-node-snapshot' jest -c jest.config.js --detectOpenHandles", "test:ci": "npm run test -- --coverage --expand --maxWorkers=50%", - "test:js": "jest -c jest.default.config.js --detectOpenHandles", + "test:js": "NODE_OPTIONS='--no-node-snapshot' jest -c jest.default.config.js --detectOpenHandles", "test:js:silent": "export LOG_LEVEL=silent && npm run test:js -- --silent", "test:js:ci": "npm run test:js -- --coverage --expand --maxWorkers=50%", - "test:ts": "jest -c jest.config.typescript.js --detectOpenHandles", + "test:ts": "NODE_OPTIONS='--no-node-snapshot' jest -c jest.config.typescript.js --detectOpenHandles", "test:ts:component:generateNwMocks": "npm run test:ts -- component --generate=true", "test:ts:silent": "export LOG_LEVEL=silent && npm run test:ts -- --silent", "test:ts:ci": "npm run test:ts -- --coverage --expand --maxWorkers=50%", @@ -60,23 +61,24 @@ "@aws-sdk/credential-providers": "^3.391.0", "@aws-sdk/lib-storage": "^3.637.0", "@bugsnag/js": "^7.20.2", - "@datadog/pprof": "^3.1.0", + "@datadog/pprof": "^5.5.1", "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.13", - "@rudderstack/json-template-engine": "^0.18.0", + "@rudderstack/integrations-lib": "^0.2.25", + "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", - "ajv": "^8.12.0", + "ajv": "^8.17.1", "ajv-draft-04": "^1.0.0", "ajv-formats": "^2.1.1", "amazon-dsp-formatter": "^1.0.2", - "axios": "^1.7.3", + "axios": "^1.7.9", "btoa": "^1.2.1", "component-each": "^0.2.6", "crypto-js": "^4.2.0", "dotenv": "^16.0.3", + "fast-xml-parser": "^4.5.1", "flat": "^5.0.2", "form-data": "^4.0.0", "get-value": "^3.0.1", @@ -86,22 +88,21 @@ "ioredis": "^5.3.2", "is": "^3.3.0", "is-ip": "^3.1.0", - "isolated-vm": "4.5.0", + "isolated-vm": "5.0.3", "js-sha1": "^0.6.0", "json-diff": "^1.0.3", "json-size": "^1.0.0", "jsontoxml": "^1.0.1", - "jstoxml": "^5.0.2", - "koa": "^2.15.3", + "koa": "^2.15.4", "koa-bodyparser": "^4.4.0", "koa2-swagger-ui": "^5.7.0", - "libphonenumber-js": "^1.11.12", + "libphonenumber-js": "^1.11.18", "lodash": "^4.17.21", "match-json": "^1.3.5", "md5": "^2.3.0", "modclean": "^3.0.0-beta.1", "moment": "^2.29.4", - "moment-timezone": "^0.5.43", + "moment-timezone": "^0.5.47", "node-cache": "^5.1.2", "node-fetch": "^2.6.12", "oauth-1.0a": "^2.2.6", @@ -114,12 +115,12 @@ "sha256": "^0.2.0", "sqlstring": "^2.3.3", "stacktrace-parser": "^0.1.10", - "statsd-client": "^0.4.7", "truncate-utf8-bytes": "^1.0.2", "ua-parser-js": "^1.0.37", "unset-value": "^2.0.1", "uuid": "^9.0.1", "valid-url": "^1.0.9", + "validator": "^13.12.0", "zod": "^3.22.4" }, "devDependencies": { @@ -135,6 +136,7 @@ "@types/supertest": "^6.0.2", "@typescript-eslint/eslint-plugin": "^5.61.0", "@typescript-eslint/parser": "^5.59.2", + "allure-jest": "^3.0.7", "axios-mock-adapter": "^1.22.0", "benchmark-suite": "^0.1.8", "commander": "^10.0.1", @@ -154,6 +156,8 @@ "http-terminator": "^3.2.0", "husky": "^9.1.6", "jest": "^29.5.0", + "jest-diff": "^29.7.0", + "jest-environment-node": "^29.7.0", "jest-sonar": "^0.2.16", "jest-when": "^3.5.2", "lint-staged": "^13.2.2", diff --git a/sonar-project.properties b/sonar-project.properties index 6c45b0ce39d..284f159cb3d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -18,7 +18,7 @@ sonar.testExecutionReportPaths=reports/sonar/results-report.xml sonar.eslint.reportPaths=reports/eslint.json # Path to sources -sonar.sources=src,benchmark +sonar.sources=src sonar.inclusions=**/*.js sonar.exclusions=**/*.json,**/*.html,**/*.png,**/*.jpg,**/*.gif,**/*.svg,**/*.yml,src/util/libExtractor.js,src/util/url-search-params.min.js,src/util/lodash-es-core.js diff --git a/src/adapters/network.js b/src/adapters/network.js index aeb1cc128b3..13ebc89aadc 100644 --- a/src/adapters/network.js +++ b/src/adapters/network.js @@ -323,7 +323,7 @@ function stringifyQueryParam(value) { * @param {Object} payload * @returns {String} */ -function getFormData(payload) { +function getFormData(payload = {}) { const data = new URLSearchParams(); Object.keys(payload).forEach((key) => { const payloadValStr = stringifyQueryParam(payload[key]); @@ -332,6 +332,22 @@ function getFormData(payload) { return data; } +function extractPayloadForFormat(payload, format) { + switch (format) { + case 'JSON_ARRAY': + return payload?.batch; + case 'JSON': + return payload; + case 'XML': + return payload?.payload; + case 'FORM': + return getFormData(payload); + default: + logger.debug(`Unknown payload format: ${format}`); + return undefined; + } +} + /** * Prepares the proxy request * @param {*} request @@ -340,33 +356,29 @@ function getFormData(payload) { const prepareProxyRequest = (request) => { const { body, method, params, endpoint, headers, destinationConfig: config } = request; const { payload, payloadFormat } = getPayloadData(body); - let data; - - switch (payloadFormat) { - case 'JSON_ARRAY': - data = payload.batch; - // TODO: add headers - break; - case 'JSON': - data = payload; - break; - case 'XML': - data = payload.payload; - break; - case 'FORM': - data = getFormData(payload); - break; - case 'MULTIPART-FORM': - // TODO: - break; - default: - logger.debug(`body format ${payloadFormat} not supported`); - } + const data = extractPayloadForFormat(payload, payloadFormat); // Ref: https://github.com/rudderlabs/rudder-server/blob/master/router/network.go#L164 headers['User-Agent'] = 'RudderLabs'; return removeUndefinedValues({ endpoint, data, params, headers, method, config }); }; +const getHttpWrapperMethod = (requestType) => { + switch (requestType) { + case 'get': + return httpGET; + case 'put': + return httpPUT; + case 'patch': + return httpPATCH; + case 'delete': + return httpDELETE; + case 'constructor': + return httpSend; + default: + return httpPOST; + } +}; + /** * handles http request and sends the response in a simple format that is followed in transformer * @@ -392,27 +404,7 @@ const prepareProxyRequest = (request) => { }) */ const handleHttpRequest = async (requestType = 'post', ...httpArgs) => { - let httpWrapperMethod; - switch (requestType.toLowerCase()) { - case 'get': - httpWrapperMethod = httpGET; - break; - case 'put': - httpWrapperMethod = httpPUT; - break; - case 'patch': - httpWrapperMethod = httpPATCH; - break; - case 'delete': - httpWrapperMethod = httpDELETE; - break; - case 'constructor': - httpWrapperMethod = httpSend; - break; - default: - httpWrapperMethod = httpPOST; - break; - } + const httpWrapperMethod = getHttpWrapperMethod(requestType.toLowerCase()); const httpResponse = await httpWrapperMethod(...httpArgs); const processedResponse = processAxiosResponse(httpResponse); return { httpResponse, processedResponse }; diff --git a/src/adapters/network.test.js b/src/adapters/network.test.js index 7894925ccd6..a4a2787504f 100644 --- a/src/adapters/network.test.js +++ b/src/adapters/network.test.js @@ -1,7 +1,20 @@ const mockLoggerInstance = { info: jest.fn(), }; -const { getFormData, httpPOST, httpGET, httpSend, fireHTTPStats } = require('./network'); +const { + getFormData, + httpPOST, + httpGET, + httpSend, + fireHTTPStats, + proxyRequest, + prepareProxyRequest, + handleHttpRequest, + httpDELETE, + httpPUT, + httpPATCH, + getPayloadData, +} = require('./network'); const { getFuncTestData } = require('../../test/testHelper'); jest.mock('../util/stats', () => ({ timing: jest.fn(), @@ -20,14 +33,28 @@ jest.mock('@rudderstack/integrations-lib', () => { }; }); -jest.mock('axios', () => jest.fn()); +// Mock the axios module +jest.mock('axios', () => { + const mockAxios = jest.fn(); // Mock the default axios function + mockAxios.get = jest.fn(); // Mock axios.get + mockAxios.post = jest.fn(); // Mock axios.post + mockAxios.put = jest.fn(); // Mock axios.put + mockAxios.patch = jest.fn(); // Mock axios.patch + mockAxios.delete = jest.fn(); // Mock axios.delete + + // Mock the axios.create method if needed + mockAxios.create = jest.fn(() => mockAxios); + + return mockAxios; // Return the mocked axios +}); + +const axios = require('axios'); jest.mock('../util/logger', () => ({ ...jest.requireActual('../util/logger'), getMatchedMetadata: jest.fn(), })); -const axios = require('axios'); const loggerUtil = require('../util/logger'); axios.post = jest.fn(); @@ -635,3 +662,338 @@ describe('logging in http methods', () => { expect(mockLoggerInstance.info).toHaveBeenCalledTimes(0); }); }); + +describe('httpDELETE tests', () => { + beforeEach(() => { + mockLoggerInstance.info.mockClear(); + loggerUtil.getMatchedMetadata.mockClear(); + axios.delete.mockClear(); + }); + + test('should call axios.delete with correct parameters and log request/response', async () => { + const statTags = { + metadata: { + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + }, + destType: 'DT', + feature: 'feat', + endpointPath: '/m/n/o', + requestMethod: 'delete', + }; + loggerUtil.getMatchedMetadata.mockReturnValue([statTags.metadata]); + + axios.delete.mockResolvedValueOnce({ + status: 200, + data: { a: 1, b: 2, c: 'abc' }, + headers: { + 'Content-Type': 'application/json', + 'X-Some-Header': 'headsome', + }, + }); + + await expect(httpDELETE('https://some.web.com/m/n/o', {}, statTags)).resolves.not.toThrow( + Error, + ); + expect(loggerUtil.getMatchedMetadata).toHaveBeenCalledTimes(2); + expect(mockLoggerInstance.info).toHaveBeenCalledTimes(2); + + expect(mockLoggerInstance.info).toHaveBeenNthCalledWith(1, ' [DT] /m/n/o request', { + body: undefined, + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + url: 'https://some.web.com/m/n/o', + method: 'delete', + }); + + expect(mockLoggerInstance.info).toHaveBeenNthCalledWith(2, ' [DT] /m/n/o response', { + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + body: { a: 1, b: 2, c: 'abc' }, + status: 200, + headers: { + 'Content-Type': 'application/json', + 'X-Some-Header': 'headsome', + }, + }); + }); +}); + +describe('httpPUT tests', () => { + beforeEach(() => { + mockLoggerInstance.info.mockClear(); + loggerUtil.getMatchedMetadata.mockClear(); + axios.put.mockClear(); + }); + + test('should call axios.put with correct parameters and log request/response', async () => { + const statTags = { + metadata: { + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + }, + destType: 'DT', + feature: 'feat', + endpointPath: '/m/n/o', + requestMethod: 'put', + }; + loggerUtil.getMatchedMetadata.mockReturnValue([statTags.metadata]); + + axios.put.mockResolvedValueOnce({ + status: 200, + data: { a: 1, b: 2, c: 'abc' }, + headers: { + 'Content-Type': 'application/json', + 'X-Some-Header': 'headsome', + }, + }); + + await expect(httpPUT('https://some.web.com/m/n/o', {}, {}, statTags)).resolves.not.toThrow( + Error, + ); + expect(loggerUtil.getMatchedMetadata).toHaveBeenCalledTimes(2); + expect(mockLoggerInstance.info).toHaveBeenCalledTimes(2); + + expect(mockLoggerInstance.info).toHaveBeenNthCalledWith(1, ' [DT] /m/n/o request', { + body: {}, + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + url: 'https://some.web.com/m/n/o', + method: 'put', + }); + + expect(mockLoggerInstance.info).toHaveBeenNthCalledWith(2, ' [DT] /m/n/o response', { + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + body: { a: 1, b: 2, c: 'abc' }, + status: 200, + headers: { + 'Content-Type': 'application/json', + 'X-Some-Header': 'headsome', + }, + }); + }); +}); + +describe('httpPATCH tests', () => { + beforeEach(() => { + mockLoggerInstance.info.mockClear(); + loggerUtil.getMatchedMetadata.mockClear(); + axios.patch.mockClear(); + }); + + test('should call axios.patch with correct parameters and log request/response', async () => { + const statTags = { + metadata: { + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + }, + destType: 'DT', + feature: 'feat', + endpointPath: '/m/n/o', + requestMethod: 'patch', + }; + loggerUtil.getMatchedMetadata.mockReturnValue([statTags.metadata]); + + axios.patch.mockResolvedValueOnce({ + status: 200, + data: { a: 1, b: 2, c: 'abc' }, + headers: { + 'Content-Type': 'application/json', + 'X-Some-Header': 'headsome', + }, + }); + + await expect(httpPATCH('https://some.web.com/m/n/o', {}, {}, statTags)).resolves.not.toThrow( + Error, + ); + expect(loggerUtil.getMatchedMetadata).toHaveBeenCalledTimes(2); + expect(mockLoggerInstance.info).toHaveBeenCalledTimes(2); + + expect(mockLoggerInstance.info).toHaveBeenNthCalledWith(1, ' [DT] /m/n/o request', { + body: {}, + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + url: 'https://some.web.com/m/n/o', + method: 'patch', + }); + + expect(mockLoggerInstance.info).toHaveBeenNthCalledWith(2, ' [DT] /m/n/o response', { + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + body: { a: 1, b: 2, c: 'abc' }, + status: 200, + headers: { + 'Content-Type': 'application/json', + 'X-Some-Header': 'headsome', + }, + }); + }); +}); + +describe('getPayloadData tests', () => { + test('should return payload and payloadFormat for non-empty body', () => { + const body = { + JSON: { key: 'value' }, + XML: null, + FORM: null, + }; + const result = getPayloadData(body); + expect(result).toEqual({ payload: { key: 'value' }, payloadFormat: 'JSON' }); + }); + + test('should return undefined payload and payloadFormat for empty body', () => { + const body = {}; + const result = getPayloadData(body); + expect(result).toEqual({ payload: undefined, payloadFormat: undefined }); + }); +}); + +describe('prepareProxyRequest tests', () => { + test('should prepare proxy request with correct headers and payload', () => { + const request = { + body: { JSON: { key: 'value' } }, + method: 'POST', + params: { param1: 'value1' }, + endpoint: 'https://example.com', + headers: { 'Content-Type': 'application/json' }, + destinationConfig: { key: 'value' }, + }; + const result = prepareProxyRequest(request); + expect(result).toEqual({ + endpoint: 'https://example.com', + data: { key: 'value' }, + params: { param1: 'value1' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + config: { key: 'value' }, + }); + }); +}); + +describe('handleHttpRequest tests', () => { + beforeEach(() => { + axios.post.mockClear(); + axios.get.mockClear(); + axios.put.mockClear(); + axios.patch.mockClear(); + axios.delete.mockClear(); + }); + + test('should handle POST request correctly', async () => { + axios.post.mockResolvedValueOnce({ + status: 200, + data: { key: 'value' }, + }); + + const result = await handleHttpRequest('post', 'https://example.com', { key: 'value' }, {}); + expect(result.httpResponse).toEqual({ + success: true, + response: { status: 200, data: { key: 'value' } }, + }); + expect(result.processedResponse).toBeDefined(); + }); + + test('should handle GET request correctly', async () => { + axios.get.mockResolvedValueOnce({ + status: 200, + data: { key: 'value' }, + }); + + const result = await handleHttpRequest('get', 'https://example.com', {}); + expect(result.httpResponse).toEqual({ + success: true, + response: { status: 200, data: { key: 'value' } }, + }); + expect(result.processedResponse).toBeDefined(); + }); + + test('should handle PUT request correctly', async () => { + axios.put.mockResolvedValueOnce({ + status: 200, + data: { key: 'value' }, + }); + + const result = await handleHttpRequest('put', 'https://example.com', { key: 'value' }, {}); + expect(result.httpResponse).toEqual({ + success: true, + response: { status: 200, data: { key: 'value' } }, + }); + expect(result.processedResponse).toBeDefined(); + }); + + test('should handle PATCH request correctly', async () => { + axios.patch.mockResolvedValueOnce({ + status: 200, + data: { key: 'value' }, + }); + + const result = await handleHttpRequest('patch', 'https://example.com', { key: 'value' }, {}); + expect(result.httpResponse).toEqual({ + success: true, + response: { status: 200, data: { key: 'value' } }, + }); + expect(result.processedResponse).toBeDefined(); + }); + + test('should handle DELETE request correctly', async () => { + axios.delete.mockResolvedValueOnce({ + status: 200, + data: { key: 'value' }, + }); + + const result = await handleHttpRequest('delete', 'https://example.com', {}); + expect(result.httpResponse).toEqual({ + success: true, + response: { status: 200, data: { key: 'value' } }, + }); + expect(result.processedResponse).toBeDefined(); + }); +}); + +describe('proxyRequest tests', () => { + beforeEach(() => { + axios.mockClear(); + }); + + test('should proxy request correctly', async () => { + axios.mockResolvedValueOnce({ + status: 200, + data: { key: 'value' }, + }); + + const request = { + body: { JSON: { key: 'value' } }, + method: 'POST', + params: { param1: 'value1' }, + endpoint: 'https://example.com', + headers: { 'Content-Type': 'application/json' }, + destinationConfig: { key: 'value' }, + metadata: { destType: 'DT' }, + }; + + const result = await proxyRequest(request, 'DT'); + expect(result).toEqual({ + success: true, + response: { status: 200, data: { key: 'value' } }, + }); + }); +}); diff --git a/src/adapters/networkHandlerFactory.js b/src/adapters/networkHandlerFactory.js index de80809a041..7a15e4e18fa 100644 --- a/src/adapters/networkHandlerFactory.js +++ b/src/adapters/networkHandlerFactory.js @@ -26,10 +26,9 @@ SUPPORTED_VERSIONS.forEach((version) => { // dest: handler // }, // generic: GenericNetworkHandler, - // } - handlers[version][dest] = require( - `../${version}/destinations/${dest}/networkHandler`, - ).networkHandler; + // }' + const networkHandler = require(`../${version}/destinations/${dest}/networkHandler`); + handlers[version][dest] = networkHandler.networkHandler || networkHandler.NetworkHandler; } catch { // Do nothing as exception indicates // network handler is not defined for that destination diff --git a/src/cdk/v2/destinations/accoil_analytics/procWorkflow.yaml b/src/cdk/v2/destinations/accoil_analytics/procWorkflow.yaml new file mode 100644 index 00000000000..3d9eb319843 --- /dev/null +++ b/src/cdk/v2/destinations/accoil_analytics/procWorkflow.yaml @@ -0,0 +1,122 @@ +bindings: + - name: EventType + path: ../../../../constants + - path: ../../bindings/jsontemplate + exportAll: true + - name: removeUndefinedAndNullValues + path: ../../../../v0/util + - name: base64Convertor + path: ../../../../v0/util + - path: ./utils + +steps: + - name: validateInput + template: | + $.assert(.message.type, "message type is not present. Aborting message."); + $.assert(.message.type in {{$.EventType.([.TRACK, .PAGE, .SCREEN, .IDENTIFY, .GROUP])}}, + "message type " + .message.type + " is not supported"); + $.assertConfig(.destination.Config.apiKey, "apiKey must be supplied in destination config"); + +# Note our auth does not require a password in basic auth just the string "key:" + - name: prepareContext + template: | + $.context.messageType = .message.type.toLowerCase(); + $.context.payload = { + "type": $.context.messageType + }; + $.context.finalHeaders = { + "Authorization": "Basic " + $.base64Convertor(.destination.Config.apiKey + ":"), + "Content-Type": "application/json" + }; + $.context.endpoint = $.endpointUrl(.destination.Config.apiKey); + + - name: trackPayload + condition: $.context.messageType == {{$.EventType.TRACK}} + template: | + $.context.payload.event = .message.event; + $.context.payload.userId = .message.().({{{{$.getGenericPaths("userIdOnly")}}}}) + $.context.payload.timestamp = .message.().({{{{$.getGenericPaths("timestamp")}}}}) + + - name: pagePayload + condition: $.context.messageType == {{$.EventType.PAGE}} + template: | + $.context.payload.userId = .message.().({{{{$.getGenericPaths("userIdOnly")}}}}); + $.context.payload.name = .message.name; + $.context.payload.timestamp = .message.().({{{{$.getGenericPaths("timestamp")}}}}); + + - name: screenPayload + condition: $.context.messageType == {{$.EventType.SCREEN}} + template: | + $.context.payload.userId = .message.().({{{{$.getGenericPaths("userIdOnly")}}}}); + $.context.payload.name = .message.name; + $.context.payload.timestamp = .message.().({{{{$.getGenericPaths("timestamp")}}}}); + + - name: identifyPayload + condition: $.context.messageType == {{$.EventType.IDENTIFY}} + template: | + $.context.payload.userId = .message.().({{{{$.getGenericPaths("userIdOnly")}}}}); + $.context.payload.traits = .message.traits ?? .message.context.traits; + $.context.payload.timestamp = .message.().({{{{$.getGenericPaths("timestamp")}}}}); + + - name: groupPayload + condition: $.context.messageType == {{$.EventType.GROUP}} + template: | + $.context.payload.userId = .message.().({{{{$.getGenericPaths("userId")}}}}); + $.context.payload.groupId = .message.groupId; + $.context.payload.timestamp = .message.().({{{{$.getGenericPaths("timestamp")}}}}); + $.context.payload.traits = .message.traits; + + - name: validateTimestamp + template: | + $.assert($.context.payload.timestamp, "timestamp is required for all calls") + + - name: validateTrackPayload + condition: $.context.messageType == {{$.EventType.TRACK}} + template: | + $.assert($.context.payload.event, "event is required for track call") + $.assert($.context.payload.userId, "userId is required for track call") + + - name: validatePagePayload + condition: $.context.messageType == {{$.EventType.PAGE}} + template: | + $.assert($.context.payload.name, "name is required for page call") + $.assert($.context.payload.userId, "userId is required for page call") + + - name: validateScreenPayload + condition: $.context.messageType == {{$.EventType.SCREEN}} + template: | + $.assert($.context.payload.name, "name is required for screen call") + $.assert($.context.payload.userId, "userId is required for screen call") + + - name: validateIdentifyPayload + condition: $.context.messageType == {{$.EventType.IDENTIFY}} + template: | + $.assert($.context.payload.userId, "userId is required for identify call") + + - name: validateGroupPayload + condition: $.context.messageType == {{$.EventType.GROUP}} + template: | + $.assert($.context.payload.userId, "userId is required for group call") + $.assert($.context.payload.groupId, "groupId is required for group call") + + - name: cleanPayload + template: | + $.context.payload = $.removeUndefinedAndNullValues($.context.payload); + + - name: buildResponseForProcessTransformation + template: | + $.context.payload.({ + "body": { + "JSON": ., + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": $.context.endpoint, + "headers": $.context.finalHeaders, + "params": {}, + "files": {} + }) \ No newline at end of file diff --git a/src/cdk/v2/destinations/accoil_analytics/rtWorkflow.yaml b/src/cdk/v2/destinations/accoil_analytics/rtWorkflow.yaml new file mode 100644 index 00000000000..88cb78352f2 --- /dev/null +++ b/src/cdk/v2/destinations/accoil_analytics/rtWorkflow.yaml @@ -0,0 +1,33 @@ +bindings: + - name: handleRtTfSingleEventError + path: ../../../../v0/util/index + +steps: + - name: validateInput + template: | + $.assert(Array.isArray(^) && ^.length > 0, "Invalid event array") + + - name: transform + externalWorkflow: + path: ./procWorkflow.yaml + loopOverInput: true + + - name: successfulEvents + template: | + $.outputs.transform#idx.output.({ + "batchedRequest": ., + "batched": false, + "destination": ^[idx].destination, + "metadata": ^[idx].metadata[], + "statusCode": 200 + })[] + + - name: failedEvents + template: | + $.outputs.transform#idx.error.( + $.handleRtTfSingleEventError(^[idx], .originalError ?? ., {}) + )[] + + - name: finalPayload + template: | + [...$.outputs.failedEvents, ...$.outputs.successfulEvents] diff --git a/src/cdk/v2/destinations/accoil_analytics/utils.ts b/src/cdk/v2/destinations/accoil_analytics/utils.ts new file mode 100644 index 00000000000..f59fac2ea26 --- /dev/null +++ b/src/cdk/v2/destinations/accoil_analytics/utils.ts @@ -0,0 +1,6 @@ +const stgRegex = /^stg_/i; + +export const endpointUrl = (apiKey: string): string => { + const staging: boolean = stgRegex.test(apiKey); + return staging ? 'https://instaging.accoil.com/segment' : 'https://in.accoil.com/segment'; +}; diff --git a/src/cdk/v2/destinations/bloomreach/types.ts b/src/cdk/v2/destinations/bloomreach/types.ts new file mode 100644 index 00000000000..4a1125819dc --- /dev/null +++ b/src/cdk/v2/destinations/bloomreach/types.ts @@ -0,0 +1,8 @@ +export type BloomreachDestinationConfig = { + hardID: string; + softID: string; + appSecret: string; + apiKey: string; + apiBaseUrl: string; + projectToken: string; +}; diff --git a/src/cdk/v2/destinations/bloomreach/utils.ts b/src/cdk/v2/destinations/bloomreach/utils.ts index f834fa74e7a..7669ec8990a 100644 --- a/src/cdk/v2/destinations/bloomreach/utils.ts +++ b/src/cdk/v2/destinations/bloomreach/utils.ts @@ -1,5 +1,6 @@ import { isObject, isEmptyObject, getIntegrationsObj } from '../../../../v0/util'; import { RudderMessage, Destination } from '../../../../types'; +import { BloomreachDestinationConfig } from './types'; const getCustomerIDsFromIntegrationObject = (message: RudderMessage): any => { const integrationObj = getIntegrationsObj(message, 'bloomreach' as any) || {}; @@ -21,7 +22,10 @@ const getCustomerIDsFromIntegrationObject = (message: RudderMessage): any => { return customerIDs; }; -export const prepareCustomerIDs = (message: RudderMessage, destination: Destination): any => { +export const prepareCustomerIDs = ( + message: RudderMessage, + destination: Destination, +): any => { const customerIDs = { [destination.Config.hardID]: message.userId, [destination.Config.softID]: message.anonymousId, diff --git a/src/cdk/v2/destinations/bluecore/utils.js b/src/cdk/v2/destinations/bluecore/utils.js index 543b6de745f..e82a1355b51 100644 --- a/src/cdk/v2/destinations/bluecore/utils.js +++ b/src/cdk/v2/destinations/bluecore/utils.js @@ -19,74 +19,83 @@ const { EVENT_NAME_MAPPING, IDENTIFY_EXCLUSION_LIST, TRACK_EXCLUSION_LIST } = re const { EventType } = require('../../../../constants'); const { MAPPING_CONFIG, CONFIG_CATEGORIES } = require('./config'); -/** - * Verifies the correctness of payload for different events. - * - * @param {Object} payload - The payload object containing event information. - * @param {Object} message - The message object containing additional information. - * @throws {InstrumentationError} - Throws an error if required properties are missing. - * @returns {void} - */ -const verifyPayload = (payload, message) => { +const validateCustomerProperties = (payload, eventName) => { + if ( + !isDefinedAndNotNull(payload?.properties?.customer) || + Object.keys(payload.properties.customer).length === 0 + ) { + throw new InstrumentationError( + `[Bluecore] property:: No relevant trait to populate customer information, which is required for ${eventName} action`, + ); + } +}; + +const validateIdentifyAction = (message) => { if ( message.type === EventType.IDENTIFY && isDefinedNotNullNotEmpty(message.traits?.action) && message.traits?.action !== 'identify' ) { throw new InstrumentationError( - "[Bluecore] traits.action must be 'identify' for identify action", + "[Bluecore] traits.action must be 'identify' for identify action", ); } - switch (payload.event) { - case 'search': - if (!payload?.properties?.search_term) { - throw new InstrumentationError( - '[Bluecore] property:: search_query is required for search event', - ); - } - break; - case 'purchase': - if (!isDefinedAndNotNull(payload?.properties?.order_id)) { - throw new InstrumentationError( - '[Bluecore] property:: order_id is required for purchase event', - ); - } - if (!isDefinedAndNotNull(payload?.properties?.total)) { - throw new InstrumentationError( - '[Bluecore] property:: total is required for purchase event', - ); - } - if ( - !isDefinedAndNotNull(payload?.properties?.customer) || - Object.keys(payload.properties.customer).length === 0 - ) { - throw new InstrumentationError( - `[Bluecore] property:: No relevant trait to populate customer information, which is required for ${payload.event} event`, - ); - } - break; - case 'identify': - case 'optin': - case 'unsubscribe': - if (!isDefinedAndNotNullAndNotEmpty(getFieldValueFromMessage(message, 'email'))) { - throw new InstrumentationError( - `[Bluecore] property:: email is required for ${payload.event} action`, - ); - } - if ( - !isDefinedAndNotNull(payload?.properties?.customer) || - Object.keys(payload.properties.customer).length === 0 - ) { - throw new InstrumentationError( - `[Bluecore] property:: No relevant trait to populate customer information, which is required for ${payload.event} action`, - ); - } - break; - default: - break; +}; +const validateSearchEvent = (payload) => { + if (!payload?.properties?.search_term) { + throw new InstrumentationError( + '[Bluecore] property:: search_query is required for search event', + ); } }; +const validatePurchaseEvent = (payload) => { + if (!isDefinedAndNotNull(payload?.properties?.order_id)) { + throw new InstrumentationError('[Bluecore] property:: order_id is required for purchase event'); + } + if (!isDefinedAndNotNull(payload?.properties?.total)) { + throw new InstrumentationError('[Bluecore] property:: total is required for purchase event'); + } + validateCustomerProperties(payload, 'purchase'); +}; + +const validateCustomerEvent = (payload, message) => { + if (!isDefinedAndNotNullAndNotEmpty(getFieldValueFromMessage(message, 'email'))) { + throw new InstrumentationError( + `[Bluecore] property:: email is required for ${payload.event} action`, + ); + } + validateCustomerProperties(payload, payload.event); +}; + +const validateEventSpecificPayload = (payload, message) => { + const eventValidators = { + search: validateSearchEvent, + purchase: validatePurchaseEvent, + identify: validateCustomerEvent, + optin: validateCustomerEvent, + unsubscribe: validateCustomerEvent, + }; + + const validator = eventValidators[payload.event]; + if (validator) { + validator(payload, message); + } +}; + +/** + * Verifies the correctness of payload for different events. + * + * @param {Object} payload - The payload object containing event information. + * @param {Object} message - The message object containing additional information. + * @throws {InstrumentationError} - Throws an error if required properties are missing. + * @returns {void} + */ +const verifyPayload = (payload, message) => { + validateIdentifyAction(message); + validateEventSpecificPayload(payload, message); +}; + /** * Deduces the track event name based on the provided track event name and configuration. * diff --git a/src/cdk/v2/destinations/clicksend/utils.js b/src/cdk/v2/destinations/clicksend/utils.js index d0671df45c5..c6a8c281e3b 100644 --- a/src/cdk/v2/destinations/clicksend/utils.js +++ b/src/cdk/v2/destinations/clicksend/utils.js @@ -4,8 +4,11 @@ const { BatchUtils } = require('@rudderstack/workflow-engine'); const { SMS_SEND_ENDPOINT, MAX_BATCH_SIZE, COMMON_CONTACT_DOMAIN } = require('./config'); const { isDefinedAndNotNullAndNotEmpty, isDefinedAndNotNull } = require('../../../../v0/util'); -const getEndIdentifyPoint = (contactId, contactListId) => - `${COMMON_CONTACT_DOMAIN}/${contactListId}/contacts${isDefinedAndNotNullAndNotEmpty(contactId) ? `/${contactId}` : ''}`; +const getEndIdentifyPoint = (contactId, contactListId) => { + const basePath = `${COMMON_CONTACT_DOMAIN}/${contactListId}/contacts`; + const contactSuffix = isDefinedAndNotNullAndNotEmpty(contactId) ? `/${contactId}` : ''; + return basePath + contactSuffix; +}; const validateIdentifyPayload = (payload) => { if ( @@ -33,13 +36,17 @@ const deduceSchedule = (eventLevelSchedule, timestamp, destConfig) => { if (isDefinedAndNotNull(eventLevelSchedule) && !Number.isNaN(eventLevelSchedule)) { return eventLevelSchedule; } - const { defaultCampaignScheduleUnit = 'minute', defaultCampaignSchedule = 0 } = destConfig; + const { defaultCampaignScheduleUnit = 'minute', defaultCampaignSchedule = '0' } = destConfig; const date = new Date(timestamp); + let defaultCampaignScheduleInt = parseInt(defaultCampaignSchedule, 10); + if (Number.isNaN(defaultCampaignScheduleInt)) { + defaultCampaignScheduleInt = 0; + } if (defaultCampaignScheduleUnit === 'day') { - date.setDate(date.getDate() + defaultCampaignSchedule); + date.setUTCDate(date.getUTCDate() + defaultCampaignScheduleInt); } else if (defaultCampaignScheduleUnit === 'minute') { - date.setMinutes(date.getMinutes() + defaultCampaignSchedule); + date.setUTCMinutes(date.getUTCMinutes() + defaultCampaignScheduleInt); } else { throw new Error("Invalid delta unit. Use 'day' or 'minute'."); } diff --git a/src/cdk/v2/destinations/clicksend/utils.test.js b/src/cdk/v2/destinations/clicksend/utils.test.js index 4999f556788..ef4468b6fe7 100644 --- a/src/cdk/v2/destinations/clicksend/utils.test.js +++ b/src/cdk/v2/destinations/clicksend/utils.test.js @@ -46,7 +46,7 @@ describe('deduceSchedule', () => { it('should return eventLevelSchedule when it is defined, not null, and not empty', () => { const eventLevelSchedule = 1234567890; const timestamp = '2023-10-01T00:00:00Z'; - const destConfig = { defaultCampaignScheduleUnit: 'minute', defaultCampaignSchedule: 5 }; + const destConfig = { defaultCampaignScheduleUnit: 'minute', defaultCampaignSchedule: '5' }; const result = deduceSchedule(eventLevelSchedule, timestamp, destConfig); @@ -57,7 +57,7 @@ describe('deduceSchedule', () => { it('should throw error when defaultCampaignScheduleUnit is invalid', () => { const eventLevelSchedule = null; const timestamp = '2023-10-01T00:00:00Z'; - const destConfig = { defaultCampaignScheduleUnit: 'hour', defaultCampaignSchedule: 5 }; + const destConfig = { defaultCampaignScheduleUnit: 'hour', defaultCampaignSchedule: '5' }; expect(() => { deduceSchedule(eventLevelSchedule, timestamp, destConfig); @@ -68,7 +68,7 @@ describe('deduceSchedule', () => { it('should calculate future timestamp correctly when defaultCampaignScheduleUnit is minute', () => { const eventLevelSchedule = null; const timestamp = '2023-10-01T00:00:00Z'; - const destConfig = { defaultCampaignScheduleUnit: 'minute', defaultCampaignSchedule: 5 }; + const destConfig = { defaultCampaignScheduleUnit: 'minute', defaultCampaignSchedule: '5' }; const result = deduceSchedule(eventLevelSchedule, timestamp, destConfig); @@ -81,7 +81,7 @@ describe('deduceSchedule', () => { it('should calculate future timestamp correctly when defaultCampaignScheduleUnit is day', () => { const eventLevelSchedule = null; const timestamp = '2023-10-01T00:00:00Z'; - const destConfig = { defaultCampaignScheduleUnit: 'day', defaultCampaignSchedule: 1 }; + const destConfig = { defaultCampaignScheduleUnit: 'day', defaultCampaignSchedule: '1' }; const result = deduceSchedule(eventLevelSchedule, timestamp, destConfig); @@ -90,11 +90,36 @@ describe('deduceSchedule', () => { expect(result).toBe(expectedTimestamp); }); + it('should calculate timestamp when defaultCampaignSchedule in some invalid string', () => { + const eventLevelSchedule = null; + const timestamp = '2023-10-01T00:00:00Z'; + const destConfig = { defaultCampaignScheduleUnit: 'day', defaultCampaignSchedule: 'inValid' }; + + const result = deduceSchedule(eventLevelSchedule, timestamp, destConfig); + const expectedTimestamp = new Date('2023-10-01T00:00:00Z').getTime() / 1000; + + expect(result).toBe(expectedTimestamp); + }); + + it('should calculate timestamp when defaultCampaignSchedule has trailing invalid text and/or leading space', () => { + const eventLevelSchedule = null; + const timestamp = '2023-10-01T00:00:00Z'; + const destConfig = { + defaultCampaignScheduleUnit: 'minute', + defaultCampaignSchedule: ' 5Invalid.String ', + }; + + const result = deduceSchedule(eventLevelSchedule, timestamp, destConfig); + const expectedTimestamp = new Date('2023-10-01T00:05:00Z').getTime() / 1000; + + expect(result).toBe(expectedTimestamp); + }); + // returns UNIX timestamp in seconds it('should return UNIX timestamp in seconds', () => { const eventLevelSchedule = null; const timestamp = '2023-10-01T00:00:00Z'; - const destConfig = { defaultCampaignScheduleUnit: 'minute', defaultCampaignSchedule: 5 }; + const destConfig = { defaultCampaignScheduleUnit: 'minute', defaultCampaignSchedule: '5' }; const result = deduceSchedule(eventLevelSchedule, timestamp, destConfig); diff --git a/src/cdk/v2/destinations/emarsys/utils.test.js b/src/cdk/v2/destinations/emarsys/utils.test.js index 72a86a15294..7709466f1c7 100644 --- a/src/cdk/v2/destinations/emarsys/utils.test.js +++ b/src/cdk/v2/destinations/emarsys/utils.test.js @@ -476,7 +476,10 @@ describe('Emarsys utils', () => { keyId, ); - expect(result).toEqual({ isAbortable: true, errorMsg: '{"errorCode":"errorMessage"}' }); + expect(result).toEqual({ + isAbortable: true, + errorMsg: JSON.stringify({ errorCode: 'errorMessage' }), + }); }); // Returns {isAbortable: true, errorMsg} if event is an object with keyId and has a corresponding error in the errors object. @@ -503,7 +506,10 @@ describe('Emarsys utils', () => { keyId, ); - expect(result).toEqual({ isAbortable: true, errorMsg: '{"errorCode":"errorMessage"}' }); + expect(result).toEqual({ + isAbortable: true, + errorMsg: JSON.stringify({ errorCode: 'errorMessage' }), + }); }); }); diff --git a/src/cdk/v2/destinations/gladly/utils.test.js b/src/cdk/v2/destinations/gladly/utils.test.js index 116f150448f..5663d29d1ec 100644 --- a/src/cdk/v2/destinations/gladly/utils.test.js +++ b/src/cdk/v2/destinations/gladly/utils.test.js @@ -12,18 +12,20 @@ const { formatFieldForEventStream, } = require('./utils'); const { base64Convertor } = require('../../../../v0/util'); +const { generateRandomString } = require('@rudderstack/integrations-lib'); describe('Unit test cases for getHeaders function', () => { it('Should return headers', () => { const destination = { Config: { - apiToken: 'token', + apiToken: generateRandomString(), userName: 'user', }, }; + const authInfo = `${destination.Config.userName}:${destination.Config.apiToken}`; const expectedHeaders = { 'Content-Type': 'application/json', - Authorization: `Basic ${base64Convertor('user:token')}`, + Authorization: `Basic ${base64Convertor(authInfo)}`, }; const result = getHeaders(destination); diff --git a/src/cdk/v2/destinations/http/procWorkflow.yaml b/src/cdk/v2/destinations/http/procWorkflow.yaml index 080dcdd80af..1371eded905 100644 --- a/src/cdk/v2/destinations/http/procWorkflow.yaml +++ b/src/cdk/v2/destinations/http/procWorkflow.yaml @@ -30,35 +30,39 @@ steps: - name: deduceBodyFormat template: | - $.context.format = .destination.Config.format ?? 'JSON'; + const format = .destination.Config.format ?? 'JSON'; + $.context.format = $.CONTENT_TYPES_MAP[format]; - name: buildHeaders template: | const configAuthHeaders = $.getAuthHeaders(.destination.Config); const additionalConfigHeaders = $.getCustomMappings(.message, .destination.Config.headers); + const metadataHeaders = $.metadataHeaders($.context.format); $.context.headers = { ...configAuthHeaders, - ...additionalConfigHeaders + ...additionalConfigHeaders, + ...metadataHeaders, } - name: prepareParams template: | - $.context.params = $.getCustomMappings(.message, .destination.Config.queryParams) + const params = $.getCustomMappings(.message, .destination.Config.queryParams); + $.context.params = $.encodeParamsObject(params); - name: deduceEndPoint template: | - $.context.endpoint = $.addPathParams(.message, .destination.Config.apiUrl); + $.context.endpoint = $.prepareEndpoint(.message, .destination.Config.apiUrl, .destination.Config.pathParams); - name: prepareBody template: | - const payload = $.getCustomMappings(.message, .destination.Config.propertiesMapping); - $.context.payload = $.removeUndefinedAndNullValues($.excludeMappedFields(payload, .destination.Config.propertiesMapping)) - $.context.format === "XML" && !$.isEmptyObject($.context.payload) ? $.context.payload = {payload: $.getXMLPayload($.context.payload)}; + const propertiesMapping = .destination.Config.isDefaultMapping ? [{"to": "$", "from": "$"}] : .destination.Config.propertiesMapping; + const payload = $.getCustomMappings(.message, propertiesMapping); + $.context.payload = $.prepareBody(payload, $.context.format, .destination.Config.xmlRootKey); - name: buildResponseForProcessTransformation template: | const response = $.defaultRequestConfig(); - $.context.format === "JSON" ? response.body.JSON = $.context.payload: response.body.XML = $.context.payload; + response.body[$.context.format] = $.context.payload; response.endpoint = $.context.endpoint; response.headers = $.context.headers; response.method = $.context.method; diff --git a/src/cdk/v2/destinations/http/utils.js b/src/cdk/v2/destinations/http/utils.js index 355eb034870..7657a1cd60a 100644 --- a/src/cdk/v2/destinations/http/utils.js +++ b/src/cdk/v2/destinations/http/utils.js @@ -1,15 +1,22 @@ -const { toXML } = require('jstoxml'); +const { XMLBuilder } = require('fast-xml-parser'); const { groupBy } = require('lodash'); const { createHash } = require('crypto'); const { ConfigurationError } = require('@rudderstack/integrations-lib'); const { BatchUtils } = require('@rudderstack/workflow-engine'); +const jsonpath = require('rs-jsonpath'); const { base64Convertor, applyCustomMappings, isEmptyObject, - applyJSONStringTemplate, + removeUndefinedAndNullRecurse, } = require('../../../../v0/util'); +const CONTENT_TYPES_MAP = { + JSON: 'JSON', + XML: 'XML', + FORM: 'FORM', +}; + const getAuthHeaders = (config) => { let headers; switch (config.auth) { @@ -33,56 +40,119 @@ const getAuthHeaders = (config) => { return headers; }; +const enhanceMappings = (mappings) => { + let enhancedMappings = mappings; + if (Array.isArray(mappings)) { + enhancedMappings = mappings.map((mapping) => { + const enhancedMapping = { ...mapping }; + if ( + mapping.hasOwnProperty('from') && + !mapping.from.includes('$') && + !(mapping.from.startsWith("'") && mapping.from.endsWith("'")) + ) { + enhancedMapping.from = `'${mapping.from}'`; + } + return enhancedMapping; + }); + } + return enhancedMappings; +}; + const getCustomMappings = (message, mapping) => { + const enhancedMappings = enhanceMappings(mapping); try { - return applyCustomMappings(message, mapping); + return applyCustomMappings(message, enhancedMappings); } catch (e) { throw new ConfigurationError(`Error in custom mappings: ${e.message}`); } }; -const addPathParams = (message, apiUrl) => { - try { - return applyJSONStringTemplate(message, `\`${apiUrl}\``); - } catch (e) { - throw new ConfigurationError(`Error in api url template: ${e.message}`); +const encodeParamsObject = (params) => { + if (!params || typeof params !== 'object') { + return {}; // Return an empty object if input is null, undefined, or not an object } + return Object.keys(params) + .filter((key) => params[key] !== undefined) + .reduce((acc, key) => { + acc[encodeURIComponent(key)] = encodeURIComponent(params[key]); + return acc; + }, {}); }; -const excludeMappedFields = (payload, mapping) => { - const rawPayload = { ...payload }; - if (mapping) { - mapping.forEach(({ from, to }) => { - // continue when from === to - if (from === to) return; - - // Remove the '$.' prefix and split the remaining string by '.' - const keys = from.replace(/^\$\./, '').split('.'); - let current = rawPayload; - - // Traverse to the parent of the key to be removed - keys.slice(0, -1).forEach((key) => { - if (current?.[key]) { - current = current[key]; - } else { - current = null; - } - }); - - if (current) { - // Remove the 'from' field from input payload - delete current[keys[keys.length - 1]]; - } - }); +const getPathValueFromJsonpath = (message, path) => { + let finalPath = path; + if (path.includes('/')) { + throw new ConfigurationError('Path value cannot contain "/"'); } + if (path.includes('$')) { + try { + [finalPath = null] = jsonpath.query(message, path); + } catch (error) { + throw new ConfigurationError( + `An error occurred while querying the JSON path: ${error.message}`, + ); + } + if (finalPath === null) { + throw new ConfigurationError('Path not found in the object.'); + } + } + return finalPath; +}; - return rawPayload; +const getPathParamsSubString = (message, pathParamsArray) => { + if (pathParamsArray.length === 0) { + return ''; + } + const pathParamsValuesArray = pathParamsArray.map((pathParam) => + encodeURIComponent(getPathValueFromJsonpath(message, pathParam.path)), + ); + return `/${pathParamsValuesArray.join('/')}`; }; -const getXMLPayload = (payload) => - toXML(payload, { - header: true, - }); +const prepareEndpoint = (message, apiUrl, pathParams) => { + if (!Array.isArray(pathParams)) { + return apiUrl; + } + const requestUrl = apiUrl.replace(/\/{1,10}$/, ''); + const pathParamsSubString = getPathParamsSubString(message, pathParams); + return `${requestUrl}${pathParamsSubString}`; +}; + +const sanitizeKey = (key) => + key + .replace(/[^\w.-]/g, '_') // Replace invalid characters with underscores + .replace(/^[^A-Z_a-z]/, '_'); // Ensure key starts with a letter or underscore + +const preprocessJson = (obj) => { + if (typeof obj !== 'object' || obj === null) { + return obj; // Return primitive values as is + } + + if (Array.isArray(obj)) { + return obj.map(preprocessJson); + } + + return Object.entries(obj).reduce((acc, [key, value]) => { + const sanitizedKey = sanitizeKey(key); + acc[sanitizedKey] = preprocessJson(value); + return acc; + }, {}); +}; + +const getXMLPayload = (payload, rootKey = 'root') => { + const builderOptions = { + ignoreAttributes: false, + suppressEmptyNode: true, + }; + + const builder = new XMLBuilder(builderOptions); + const processesPayload = { + [rootKey]: { + ...preprocessJson(payload), + }, + }; + return `${builder.build(processesPayload)}`; +}; const getMergedEvents = (batch) => { const events = []; @@ -94,6 +164,39 @@ const getMergedEvents = (batch) => { return events; }; +const metadataHeaders = (contentType) => { + switch (contentType) { + case CONTENT_TYPES_MAP.XML: + return { 'Content-Type': 'application/xml' }; + case CONTENT_TYPES_MAP.FORM: + return { 'Content-Type': 'application/x-www-form-urlencoded' }; + default: + return { 'Content-Type': 'application/json' }; + } +}; + +function stringifyFirstLevelValues(obj) { + return Object.entries(obj).reduce((acc, [key, value]) => { + acc[key] = typeof value === 'string' ? value : JSON.stringify(value); + return acc; + }, {}); +} + +const prepareBody = (payload, contentType, xmlRootKey) => { + let responseBody; + removeUndefinedAndNullRecurse(payload); + if (contentType === CONTENT_TYPES_MAP.XML && !isEmptyObject(payload)) { + responseBody = { + payload: getXMLPayload(payload, xmlRootKey), + }; + } else if (contentType === CONTENT_TYPES_MAP.FORM && !isEmptyObject(payload)) { + responseBody = stringifyFirstLevelValues(payload); + } else { + responseBody = payload || {}; + } + return responseBody; +}; + const mergeMetadata = (batch) => batch.map((event) => event.metadata[0]); const createHashKey = (endpoint, headers, params) => { @@ -147,10 +250,14 @@ const batchSuccessfulEvents = (events, batchSize) => { }; module.exports = { + CONTENT_TYPES_MAP, getAuthHeaders, + enhanceMappings, getCustomMappings, - addPathParams, - excludeMappedFields, - getXMLPayload, + encodeParamsObject, + prepareEndpoint, + metadataHeaders, + prepareBody, batchSuccessfulEvents, + stringifyFirstLevelValues, }; diff --git a/src/cdk/v2/destinations/http/utils.test.js b/src/cdk/v2/destinations/http/utils.test.js new file mode 100644 index 00000000000..c5562336351 --- /dev/null +++ b/src/cdk/v2/destinations/http/utils.test.js @@ -0,0 +1,173 @@ +const { + enhanceMappings, + encodeParamsObject, + prepareEndpoint, + prepareBody, + stringifyFirstLevelValues, +} = require('./utils'); + +const { XMLBuilder } = require('fast-xml-parser'); +const jsonpath = require('rs-jsonpath'); + +describe('Utils Functions', () => { + describe('encodeParamsObject', () => { + test('should return empty object for invalid inputs', () => { + expect(encodeParamsObject(null)).toEqual({}); + expect(encodeParamsObject(undefined)).toEqual({}); + expect(encodeParamsObject('string')).toEqual({}); + }); + + test('should encode object keys and values', () => { + const params = { key1: 'value1', key2: 'value2 3 4' }; + const expected = { key1: 'value1', key2: 'value2%203%204' }; + expect(encodeParamsObject(params)).toEqual(expected); + }); + }); + + describe('prepareEndpoint', () => { + test('should replace template variables in API URL', () => { + const message = { id: 123 }; + const apiUrl = 'https://api.example.com/resource/'; + expect(prepareEndpoint(message, apiUrl, [])).toBe('https://api.example.com/resource'); + }); + test('should replace template variables in API URL and add path params', () => { + const message = { id: 123, p2: 'P2' }; + const apiUrl = 'https://api.example.com/resource/'; + const pathParams = [ + { + path: 'p1', + }, + { + path: '$.p2', + }, + ]; + expect(prepareEndpoint(message, apiUrl, pathParams)).toBe( + 'https://api.example.com/resource/p1/P2', + ); + }); + test('should add path params after uri encoding', () => { + const message = { id: 123, p2: 'P2%&' }; + const apiUrl = 'https://api.example.com/resource/'; + const pathParams = [ + { + path: 'p1', + }, + { + path: '$.p2', + }, + ]; + expect(prepareEndpoint(message, apiUrl, pathParams)).toBe( + 'https://api.example.com/resource/p1/P2%25%26', + ); + }); + test('should throw error as path contains slash', () => { + const message = { id: 123, p2: 'P2%&' }; + const apiUrl = 'https://api.example.com/resource/${$.id}'; + const pathParams = [ + { + path: 'p1/', + }, + { + path: '$.p2', + }, + ]; + expect(() => prepareEndpoint(message, apiUrl, pathParams)).toThrowError( + 'Path value cannot contain "/"', + ); + }); + }); + + describe('prepareBody', () => { + test('should prepare XML payload when content type is XML', () => { + const payload = { key: 'value' }; + const expectedXML = 'value'; + const result = prepareBody(payload, 'XML', 'root'); + expect(result).toEqual({ payload: expectedXML }); + }); + + test('should prepare FORM-URLENCODED payload when content type is FORM-URLENCODED', () => { + const payload = { + key1: 'value1', + key2: 'value2', + key3: { subKey: 'value3', subkey2: undefined }, + }; + const expectedFORM = { + key1: 'value1', + key2: 'value2', + key3: JSON.stringify({ subKey: 'value3' }), + }; + const result = prepareBody(payload, 'FORM'); + expect(result).toEqual(expectedFORM); + }); + + test('should return original payload without null or undefined values for other content types', () => { + const payload = { + key1: 'value1', + key2: null, + key3: undefined, + key4: 'value4', + key5: { subKey1: undefined, subKey2: 'value5' }, + }; + const expected = { key1: 'value1', key4: 'value4', key5: { subKey2: 'value5' } }; + const result = prepareBody(payload, 'JSON'); + expect(result).toEqual(expected); + }); + }); + + describe('stringifyFirstLevelValues', () => { + test('converts non-string first-level values to strings', () => { + const input = { a: 1, b: true, c: { d: 42 } }; + const expected = { a: '1', b: 'true', c: JSON.stringify({ d: 42 }) }; + expect(stringifyFirstLevelValues(input)).toEqual(expected); + }); + + test('keeps string values unchanged', () => { + const input = { a: 'hello', b: 'world' }; + expect(stringifyFirstLevelValues(input)).toEqual(input); + }); + + test('handles empty objects', () => { + expect(stringifyFirstLevelValues({})).toEqual({}); + }); + }); + + describe('enhanceMappings function', () => { + test("should wrap 'from' property in single quotes if it is not already wrapped and does not contain '$'", () => { + const input = [{ to: 'a', from: 'b' }]; + const output = enhanceMappings(input); + expect(output).toEqual([{ to: 'a', from: "'b'" }]); + }); + + test("should not modify 'from' property if it is already wrapped in single quotes", () => { + const input = [{ to: 'a', from: "'b'" }]; + const output = enhanceMappings(input); + expect(output).toEqual([{ to: 'a', from: "'b'" }]); + }); + + test("should not modify 'from' property if it contains '$'", () => { + const input = [{ to: 'a', from: '$.b' }]; + const output = enhanceMappings(input); + expect(output).toEqual([{ to: 'a', from: '$.b' }]); + }); + + test('should return an empty array if input is an empty array', () => { + const input = []; + const output = enhanceMappings(input); + expect(output).toEqual([]); + }); + + test('should correctly handle multiple mappings in an array', () => { + const input = [ + { to: 'a', from: 'b' }, + { to: 'x', from: "'y'" }, + { to: 'p', from: '$.q' }, + ]; + const output = enhanceMappings(input); + expect(output).toEqual([ + { to: 'a', from: "'b'" }, + { to: 'x', from: "'y'" }, + { to: 'p', from: '$.q' }, + ]); + }); + }); +}); diff --git a/src/cdk/v2/destinations/intercom/utils.test.js b/src/cdk/v2/destinations/intercom/utils.test.js index e2c1fb9a072..7436f426f22 100644 --- a/src/cdk/v2/destinations/intercom/utils.test.js +++ b/src/cdk/v2/destinations/intercom/utils.test.js @@ -1,5 +1,6 @@ const md5 = require('md5'); const axios = require('axios'); +const { generateRandomString } = require('@rudderstack/integrations-lib'); const { getName, getHeaders, @@ -743,7 +744,7 @@ describe('attachUserAndCompany utility test', () => { }; const Config = { sendAnonymousId: false, - apiKey: 'testApiKey', + apiKey: generateRandomString(), }; const expectedResponse = { @@ -755,7 +756,7 @@ describe('attachUserAndCompany utility test', () => { files: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: `Bearer ${Config.apiKey}`, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', diff --git a/src/cdk/v2/destinations/linkedin_ads/config.js b/src/cdk/v2/destinations/linkedin_ads/config.js index 344980e7d0d..4207e8aa8a2 100644 --- a/src/cdk/v2/destinations/linkedin_ads/config.js +++ b/src/cdk/v2/destinations/linkedin_ads/config.js @@ -3,7 +3,7 @@ const { getMappingConfig } = require('../../../../v0/util'); // ref : https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/conversions-api?view=li-lms-2024-02&tabs=http#adding-multiple-conversion-events-in-a-batch const BATCH_ENDPOINT = 'https://api.linkedin.com/rest/conversionEvents'; const API_HEADER_METHOD = 'BATCH_CREATE'; -const API_VERSION = '202402'; // yyyymm format +const API_VERSION = '202409'; // yyyymm format const API_PROTOCOL_VERSION = '2.0.0'; const CONFIG_CATEGORIES = { diff --git a/src/cdk/v2/destinations/linkedin_ads/utils.test.js b/src/cdk/v2/destinations/linkedin_ads/utils.test.js index d66bda47dc1..822a5f479b7 100644 --- a/src/cdk/v2/destinations/linkedin_ads/utils.test.js +++ b/src/cdk/v2/destinations/linkedin_ads/utils.test.js @@ -10,7 +10,11 @@ const { createResponseArray, checkIfPricePresent, } = require('./utils'); -const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib'); +const { + InstrumentationError, + ConfigurationError, + generateRandomString, +} = require('@rudderstack/integrations-lib'); const { API_HEADER_METHOD, API_PROTOCOL_VERSION, API_VERSION } = require('./config'); describe('formatEmail', () => { @@ -180,7 +184,7 @@ describe('generateHeader', () => { // Returns a headers object with Content-Type, X-RestLi-Method, X-Restli-Protocol-Version, LinkedIn-Version, and Authorization keys when passed a valid access token. it('should return a headers object with all keys when passed a valid access token', () => { // Arrange - const accessToken = 'validAccessToken'; + const accessToken = generateRandomString(); // Act const result = generateHeader(accessToken); @@ -198,7 +202,7 @@ describe('generateHeader', () => { // Returns a headers object with default values for all keys when passed an invalid access token. it('should return a headers object with default values for all keys when passed an invalid access token', () => { // Arrange - const accessToken = 'invalidAccessToken'; + const accessToken = generateRandomString(); // Act const result = generateHeader(accessToken); diff --git a/src/cdk/v2/destinations/reddit/rtWorkflow.yaml b/src/cdk/v2/destinations/reddit/rtWorkflow.yaml index fd315b381ab..7d3e1653ca0 100644 --- a/src/cdk/v2/destinations/reddit/rtWorkflow.yaml +++ b/src/cdk/v2/destinations/reddit/rtWorkflow.yaml @@ -39,7 +39,7 @@ steps: const dontBatchTrueEvents = $.outputs.successfulEvents{.metadata.dontBatch}[]; const dontBatchFalseEvents = $.outputs.successfulEvents{!.metadata.dontBatch}[]; const dontBatchTrueEventsChunks = $.chunk(dontBatchTrueEvents, 1); - + let batches = [...$.batchEvents(dontBatchFalseEvents), ...$.batchEventChunks(dontBatchTrueEventsChunks)]; batches@batch.({ "batchedRequest": { diff --git a/src/cdk/v2/destinations/zoho/config.js b/src/cdk/v2/destinations/zoho/config.js index d942d9e369d..0eea0c096fd 100644 --- a/src/cdk/v2/destinations/zoho/config.js +++ b/src/cdk/v2/destinations/zoho/config.js @@ -10,8 +10,8 @@ const DATA_CENTRE_BASE_ENDPOINTS_MAP = { }; const getBaseEndpoint = (dataServer) => DATA_CENTRE_BASE_ENDPOINTS_MAP[dataServer]; -const COMMON_RECORD_ENDPOINT = (dataCenter = 'US') => - `${getBaseEndpoint(dataCenter)}/crm/v6/moduleType`; +const COMMON_RECORD_ENDPOINT = (dataCenter) => + `${getBaseEndpoint(dataCenter || 'US')}/crm/v6/moduleType`; // ref: https://www.zoho.com/crm/developer/docs/api/v6/insert-records.html#:~:text=%2DX%20POST-,System%2Ddefined%20mandatory%20fields%20for%20each%20module,-While%20inserting%20records const MODULE_MANDATORY_FIELD_CONFIG = { diff --git a/src/cdk/v2/destinations/zoho/rtWorkflow.yaml b/src/cdk/v2/destinations/zoho/rtWorkflow.yaml index b50b9502e32..fc4aaafd414 100644 --- a/src/cdk/v2/destinations/zoho/rtWorkflow.yaml +++ b/src/cdk/v2/destinations/zoho/rtWorkflow.yaml @@ -1,7 +1,7 @@ bindings: - name: EventType path: ../../../../constants - - name: processRecordInputs + - name: processRecordInputsWrap path: ./transformRecord - name: handleRtTfSingleEventError path: ../../../../v0/util/index @@ -20,7 +20,7 @@ steps: - name: processRecordEvents template: | - await $.processRecordInputs(^.{.message.type === $.EventType.RECORD}[], ^[0].destination) + await $.processRecordInputsWrap(^.{.message.type === $.EventType.RECORD}[], ^[0].destination) - name: failOtherEvents template: | diff --git a/src/cdk/v2/destinations/zoho/transformRecord.js b/src/cdk/v2/destinations/zoho/transformRecord.js index 8f4586e46b4..1e21f9ad817 100644 --- a/src/cdk/v2/destinations/zoho/transformRecord.js +++ b/src/cdk/v2/destinations/zoho/transformRecord.js @@ -13,6 +13,7 @@ const { handleRtTfSingleEventError, isEmptyObject, defaultDeleteRequestConfig, + isEventSentByVDMV2Flow, } = require('../../../../v0/util'); const zohoConfig = require('./config'); const { @@ -24,6 +25,8 @@ const { calculateTrigger, validateConfigurationIssue, } = require('./utils'); + +const { processRecordInputsV2 } = require('./transformRecordV2'); const { REFRESH_TOKEN } = require('../../../../adapters/networkhandler/authConstants'); // Main response builder function @@ -33,7 +36,7 @@ const responseBuilder = ( identifierType, operationModuleType, commonEndPoint, - action, + isUpsert, metadata, ) => { const { trigger, addDefaultDuplicateCheck, multiSelectFieldLevelDecision } = config; @@ -43,7 +46,7 @@ const responseBuilder = ( Authorization: `Zoho-oauthtoken ${metadata[0].secret.accessToken}`, }; - if (action === 'insert' || action === 'update') { + if (isUpsert) { const payload = { duplicate_check_fields: handleDuplicateCheck( addDefaultDuplicateCheck, @@ -70,7 +73,6 @@ const batchResponseBuilder = ( identifierType, operationModuleType, upsertEndPoint, - action, ) => { const upsertResponseArray = []; const deletionResponseArray = []; @@ -101,7 +103,7 @@ const batchResponseBuilder = ( identifierType, operationModuleType, upsertEndPoint, - action, + true, upsertmetadataChunks.items[0], ), ); @@ -115,7 +117,7 @@ const batchResponseBuilder = ( identifierType, operationModuleType, upsertEndPoint, - action, + false, deletionmetadataChunks.items[0], ), ); @@ -198,10 +200,18 @@ const handleDeletion = async ( input, fields, Config, + operationModuleType, + identifierType, transformedResponseToBeBatched, errorResponseList, ) => { - const searchResponse = await searchRecordId(fields, input.metadata, Config); + const searchResponse = await searchRecordId( + fields, + input.metadata, + Config, + operationModuleType, + identifierType, + ); if (searchResponse.erroneous) { const error = handleSearchError(searchResponse); @@ -226,13 +236,13 @@ const handleDeletion = async ( */ const processInput = async ( input, - action, operationModuleType, + identifierType, Config, transformedResponseToBeBatched, errorResponseList, ) => { - const { fields } = input.message; + const { fields, action } = input.message; if (isEmptyObject(fields)) { const emptyFieldsError = new InstrumentationError('`fields` cannot be empty'); @@ -250,7 +260,15 @@ const processInput = async ( errorResponseList, ); } else { - await handleDeletion(input, fields, Config, transformedResponseToBeBatched, errorResponseList); + await handleDeletion( + input, + fields, + Config, + operationModuleType, + identifierType, + transformedResponseToBeBatched, + errorResponseList, + ); } }; @@ -285,7 +303,6 @@ const processRecordInputs = async (inputs, destination) => { const response = []; const errorResponseList = []; const { Config } = destination; - const { action } = inputs[0].message; const transformedResponseToBeBatched = { upsertData: [], @@ -296,14 +313,14 @@ const processRecordInputs = async (inputs, destination) => { const { operationModuleType, identifierType, upsertEndPoint } = deduceModuleInfo(inputs, Config); - validateConfigurationIssue(Config, operationModuleType, action); + validateConfigurationIssue(Config, operationModuleType); await Promise.all( inputs.map((input) => processInput( input, - action, operationModuleType, + identifierType, Config, transformedResponseToBeBatched, errorResponseList, @@ -322,7 +339,6 @@ const processRecordInputs = async (inputs, destination) => { identifierType, operationModuleType, upsertEndPoint, - action, ); if (upsertResponseArray.length === 0 && deletionResponseArray.length === 0) { @@ -335,4 +351,15 @@ const processRecordInputs = async (inputs, destination) => { return [...response, ...errorResponseList]; }; -module.exports = { processRecordInputs }; +const processRecordInputsWrap = async (inputs, destination) => { + if (!inputs || inputs.length === 0) { + return []; + } + const event = inputs[0]; + if (isEventSentByVDMV2Flow(event)) { + return processRecordInputsV2(inputs, destination); + } + return processRecordInputs(inputs, destination); +}; + +module.exports = { processRecordInputsWrap }; diff --git a/src/cdk/v2/destinations/zoho/transformRecordV2.js b/src/cdk/v2/destinations/zoho/transformRecordV2.js new file mode 100644 index 00000000000..a81b10767da --- /dev/null +++ b/src/cdk/v2/destinations/zoho/transformRecordV2.js @@ -0,0 +1,378 @@ +const { + InstrumentationError, + ConfigurationError, + RetryableError, +} = require('@rudderstack/integrations-lib'); +const { BatchUtils } = require('@rudderstack/workflow-engine'); +const { + defaultPostRequestConfig, + defaultRequestConfig, + getSuccessRespEvents, + removeUndefinedAndNullValues, + handleRtTfSingleEventError, + isEmptyObject, + defaultDeleteRequestConfig, + getHashFromArray, +} = require('../../../../v0/util'); +const zohoConfig = require('./config'); +const { + deduceModuleInfoV2, + validatePresenceOfMandatoryPropertiesV2, + formatMultiSelectFieldsV2, + handleDuplicateCheckV2, + searchRecordIdV2, + calculateTrigger, +} = require('./utils'); +const { REFRESH_TOKEN } = require('../../../../adapters/networkhandler/authConstants'); + +// Main response builder function +const responseBuilder = ( + items, + destConfig, + identifierType, + operationModuleType, + commonEndPoint, + isUpsert, + metadata, +) => { + const { trigger, addDefaultDuplicateCheck, multiSelectFieldLevelDecision } = destConfig; + + const response = defaultRequestConfig(); + response.headers = { + Authorization: `Zoho-oauthtoken ${metadata[0].secret.accessToken}`, + }; + + const multiSelectFieldLevelDecisionAcc = getHashFromArray( + multiSelectFieldLevelDecision, + 'from', + 'to', + false, + ); + + if (isUpsert) { + const payload = { + duplicate_check_fields: handleDuplicateCheckV2( + addDefaultDuplicateCheck, + identifierType, + operationModuleType, + ), + data: items, + $append_values: multiSelectFieldLevelDecisionAcc || {}, + trigger: calculateTrigger(trigger), + }; + response.method = defaultPostRequestConfig.requestMethod; + response.body.JSON = removeUndefinedAndNullValues(payload); + response.endpoint = `${commonEndPoint}/upsert`; + } else { + response.endpoint = `${commonEndPoint}?ids=${items.join(',')}&wf_trigger=${trigger !== 'None'}`; + response.method = defaultDeleteRequestConfig.requestMethod; + } + + return response; +}; +const batchResponseBuilder = ( + transformedResponseToBeBatched, + config, + destConfig, + identifierType, + operationModuleType, + upsertEndPoint, +) => { + const upsertResponseArray = []; + const deletionResponseArray = []; + const { upsertData, deletionData, upsertSuccessMetadata, deletionSuccessMetadata } = + transformedResponseToBeBatched; + + const upsertDataChunks = BatchUtils.chunkArrayBySizeAndLength(upsertData, { + maxItems: zohoConfig.MAX_BATCH_SIZE, + }); + + const deletionDataChunks = BatchUtils.chunkArrayBySizeAndLength(deletionData, { + maxItems: zohoConfig.MAX_BATCH_SIZE, + }); + + const upsertmetadataChunks = BatchUtils.chunkArrayBySizeAndLength(upsertSuccessMetadata, { + maxItems: zohoConfig.MAX_BATCH_SIZE, + }); + + const deletionmetadataChunks = BatchUtils.chunkArrayBySizeAndLength(deletionSuccessMetadata, { + maxItems: zohoConfig.MAX_BATCH_SIZE, + }); + + upsertDataChunks.items.forEach((chunk) => { + upsertResponseArray.push( + responseBuilder( + chunk, + destConfig, + identifierType, + operationModuleType, + upsertEndPoint, + true, + upsertmetadataChunks.items[0], + ), + ); + }); + + deletionDataChunks.items.forEach((chunk) => { + deletionResponseArray.push( + responseBuilder( + chunk, + destConfig, + identifierType, + operationModuleType, + upsertEndPoint, + false, + deletionmetadataChunks.items[0], + ), + ); + }); + + return { + upsertResponseArray, + upsertmetadataChunks, + deletionResponseArray, + deletionmetadataChunks, + }; +}; + +/** + * Handles the upsert operation for a specific module type by validating mandatory properties, + * processing the input fields, and updating the response accordingly. + * + * @param {Object} input - The input data for the upsert operation. + * @param {Object} allFields - The fields to be upserted. + * @param {string} operationModuleType - The type of module operation being performed. + * @param {Object} conConfig - The connection configuration object + * @param {Object} transformedResponseToBeBatched - The response object to be batched. + * @param {Array} errorResponseList - The list to store error responses. + * @returns {Promise} - A promise that resolves once the upsert operation is handled. + */ +const handleUpsert = async ( + input, + allFields, + operationModuleType, + destConfig, + transformedResponseToBeBatched, + errorResponseList, +) => { + const eventErroneous = validatePresenceOfMandatoryPropertiesV2(destConfig.object, allFields); + + if (eventErroneous?.status) { + const error = new ConfigurationError( + `${operationModuleType} object must have the ${eventErroneous.missingField.join('", "')} property(ies).`, + ); + errorResponseList.push(handleRtTfSingleEventError(input, error, {})); + } else { + const formattedFields = formatMultiSelectFieldsV2(destConfig, allFields); + transformedResponseToBeBatched.upsertSuccessMetadata.push(input.metadata); + transformedResponseToBeBatched.upsertData.push(formattedFields); + } +}; + +/** + * Handles search errors in Zoho record search. + * If the search response message code is 'INVALID_TOKEN', returns a RetryableError with a specific message and status code. + * Otherwise, returns a ConfigurationError with a message indicating failure to fetch Zoho ID for a record. + * + * @param {Object} searchResponse - The response object from the search operation. + * @returns {RetryableError|ConfigurationError} - The error object based on the search response. + */ +const handleSearchError = (searchResponse) => { + if (searchResponse.message.code === 'INVALID_TOKEN') { + return new RetryableError( + `[Zoho]:: ${JSON.stringify(searchResponse.message)} during zoho record search`, + 500, + searchResponse.message, + REFRESH_TOKEN, + ); + } + if (searchResponse.message.code === 'INSTRUMENTATION_ERROR') { + return new InstrumentationError( + `failed to fetch zoho id for record for: ${searchResponse.message}`, + ); + } + return new ConfigurationError( + `failed to fetch zoho id for record for ${JSON.stringify(searchResponse.message)}`, + ); +}; + +/** + * Asynchronously handles the deletion operation based on the search response. + * + * @param {Object} input - The input object containing metadata and other details. + * @param {Array} fields - The fields to be used for searching the record. + * @param {Object} Config - The configuration object. + * @param {Object} transformedResponseToBeBatched - The object to store transformed response data to be batched. + * @param {Array} errorResponseList - The list to store error responses. + */ +const handleDeletion = async ( + input, + identifiers, + Config, + destConfig, + transformedResponseToBeBatched, + errorResponseList, +) => { + const searchResponse = await searchRecordIdV2(identifiers, input.metadata, Config, destConfig); + + if (searchResponse.erroneous) { + const error = handleSearchError(searchResponse); + errorResponseList.push(handleRtTfSingleEventError(input, error, {})); + } else { + transformedResponseToBeBatched.deletionData.push(...searchResponse.message); + transformedResponseToBeBatched.deletionSuccessMetadata.push(input.metadata); + } +}; + +/** + * Process the input message based on the specified action. + * If the 'fields' in the input message are empty, an error is generated. + * Determines whether to handle an upsert operation or a deletion operation based on the action. + * + * @param {Object} input - The input message containing the fields. + * @param {string} action - The action to be performed ('insert', 'update', or other). + * @param {string} operationModuleType - The type of operation module. + * @param {Object} Config - The configuration object. + * @param {Object} transformedResponseToBeBatched - The object to store transformed responses. + * @param {Array} errorResponseList - The list to store error responses. + * @param {Object} conConfig - The connection configuration object. + */ +const processInput = async ( + input, + operationModuleType, + Config, + transformedResponseToBeBatched, + errorResponseList, + destConfig, +) => { + const { fields, action, identifiers } = input.message; + const allFields = { ...identifiers, ...fields }; + + if (isEmptyObject(allFields)) { + const emptyFieldsError = new InstrumentationError('`fields` cannot be empty'); + errorResponseList.push(handleRtTfSingleEventError(input, emptyFieldsError, {})); + return; + } + + if (action === 'insert' || action === 'update') { + await handleUpsert( + input, + allFields, + operationModuleType, + destConfig, + transformedResponseToBeBatched, + errorResponseList, + ); + } else { + if (isEmptyObject(identifiers)) { + const error = new InstrumentationError('`identifiers` cannot be empty'); + errorResponseList.push(handleRtTfSingleEventError(input, error, {})); + return; + } + + await handleDeletion( + input, + identifiers, + Config, + destConfig, + transformedResponseToBeBatched, + errorResponseList, + ); + } +}; + +/** + * Appends success responses to the main response array. + * + * @param {Array} response - The main response array to which success responses will be appended. + * @param {Array} responseArray - An array of batched responses. + * @param {Array} metadataChunks - An array containing metadata chunks. + * @param {string} destination - The destination for the success responses. + */ +const appendSuccessResponses = (response, responseArray, metadataChunks, destination) => { + responseArray.forEach((batchedResponse, index) => { + response.push( + getSuccessRespEvents(batchedResponse, metadataChunks.items[index], destination, true), + ); + }); +}; + +/** + * Process multiple record inputs for a destination. + * + * @param {Array} inputs - The array of record inputs to be processed. + * @param {Object} destination - The destination object containing configuration. + * @returns {Array} - An array of responses after processing the record inputs. + */ +const processRecordInputsV2 = async (inputs, destination) => { + if (!inputs || inputs.length === 0) { + return []; + } + if (!destination) { + return []; + } + + const response = []; + const errorResponseList = []; + const { Config } = destination; + const { destination: destConfig } = inputs[0].connection?.config || {}; + if (!destConfig) { + throw new ConfigurationError('Connection destination config is required'); + } + const { object, identifierMappings } = destConfig; + if (!object || !identifierMappings) { + throw new ConfigurationError( + 'Object and identifierMappings are required in destination config', + ); + } + + const transformedResponseToBeBatched = { + upsertData: [], + upsertSuccessMetadata: [], + deletionSuccessMetadata: [], + deletionData: [], + }; + + const { operationModuleType, identifierType, upsertEndPoint } = deduceModuleInfoV2( + Config, + destConfig, + ); + + await Promise.all( + inputs.map((input) => + processInput( + input, + operationModuleType, + Config, + transformedResponseToBeBatched, + errorResponseList, + destConfig, + ), + ), + ); + + const { + upsertResponseArray, + upsertmetadataChunks, + deletionResponseArray, + deletionmetadataChunks, + } = batchResponseBuilder( + transformedResponseToBeBatched, + Config, + destConfig, + identifierType, + operationModuleType, + upsertEndPoint, + ); + + if (upsertResponseArray.length === 0 && deletionResponseArray.length === 0) { + return errorResponseList; + } + + appendSuccessResponses(response, upsertResponseArray, upsertmetadataChunks, destination); + appendSuccessResponses(response, deletionResponseArray, deletionmetadataChunks, destination); + + return [...response, ...errorResponseList]; +}; + +module.exports = { processRecordInputsV2 }; diff --git a/src/cdk/v2/destinations/zoho/transformRecordsV2.test.js b/src/cdk/v2/destinations/zoho/transformRecordsV2.test.js new file mode 100644 index 00000000000..f878755f001 --- /dev/null +++ b/src/cdk/v2/destinations/zoho/transformRecordsV2.test.js @@ -0,0 +1,97 @@ +const { processRecordInputsV2 } = require('./transformRecordV2'); + +describe('processRecordInputsV2', () => { + it('should return an empty array if no inputs are provided', async () => { + const result = await processRecordInputsV2([]); + expect(result).toEqual([]); + }); + + it('should return an empty array if no destination is provided', async () => { + const result = await processRecordInputsV2( + [ + { + id: '1', + metadata: {}, + type: 'record', + }, + ], + null, + ); + expect(result).toEqual([]); + }); + + it('should return an empty array if no destination config is provided', async () => { + const result = await processRecordInputsV2([], { + destination: { + config: {}, + }, + }); + expect(result).toEqual([]); + }); + + it('should return an empty array if no connection is provided', async () => { + await expect( + processRecordInputsV2( + [ + { + id: '1', + metadata: {}, + type: 'record', + }, + ], + { + destination: { + Config: { + Region: 'US', + }, + }, + }, + ), + ).rejects.toThrow('Connection destination config is required'); + }); + + it('should return an empty array if no connection destination config is provided', async () => { + await expect( + processRecordInputsV2( + [ + { + id: '1', + metadata: {}, + type: 'record', + connection: {}, + }, + ], + { + destination: { + Config: { + Region: 'US', + }, + }, + }, + ), + ).rejects.toThrow('Connection destination config is required'); + }); + + it('should return an empty array if no object and identifierMappings are provided in destination config', async () => { + await expect( + processRecordInputsV2( + [ + { + id: '1', + metadata: {}, + type: 'record', + destination: { + config: { region: 'US' }, + }, + connection: { + config: { + destination: {}, + }, + }, + }, + ], + { destination: { config: { region: 'US' } } }, + ), + ).rejects.toThrow('Object and identifierMappings are required in destination config'); + }); +}); diff --git a/src/cdk/v2/destinations/zoho/utils.js b/src/cdk/v2/destinations/zoho/utils.js index 4f5c4e86206..a38103ccc19 100644 --- a/src/cdk/v2/destinations/zoho/utils.js +++ b/src/cdk/v2/destinations/zoho/utils.js @@ -1,48 +1,88 @@ const { - MappedToDestinationKey, getHashFromArray, isDefinedAndNotNull, ConfigurationError, isDefinedAndNotNullAndNotEmpty, + removeUndefinedNullEmptyExclBoolInt, + ZOHO_SDK, } = require('@rudderstack/integrations-lib'); -const get = require('get-value'); +const { isEmpty } = require('lodash'); const { getDestinationExternalIDInfoForRetl, isHttpStatusSuccess } = require('../../../../v0/util'); const zohoConfig = require('./config'); const { handleHttpRequest } = require('../../../../adapters/network'); +const { CommonUtils } = require('../../../../util/common'); const deduceModuleInfo = (inputs, Config) => { - const singleRecordInput = inputs[0].message; - const operationModuleInfo = {}; - const mappedToDestination = get(singleRecordInput, MappedToDestinationKey); - if (mappedToDestination) { - const { objectType, identifierType } = getDestinationExternalIDInfoForRetl( - singleRecordInput, - 'ZOHO', - ); - operationModuleInfo.operationModuleType = objectType; - operationModuleInfo.upsertEndPoint = zohoConfig - .COMMON_RECORD_ENDPOINT(Config.region) - .replace('moduleType', objectType); - operationModuleInfo.identifierType = identifierType; + if (!Array.isArray(inputs) || inputs.length === 0) { + return {}; + } + + const firstRecord = inputs[0].message; + const mappedToDestination = firstRecord?.context?.mappedToDestination; + + if (!mappedToDestination) { + return {}; } - return operationModuleInfo; + + const { objectType, identifierType } = getDestinationExternalIDInfoForRetl(firstRecord, 'ZOHO'); + return { + operationModuleType: objectType, + upsertEndPoint: zohoConfig + .COMMON_RECORD_ENDPOINT(Config.region) + .replace('moduleType', objectType), + identifierType, + }; }; -// eslint-disable-next-line consistent-return +const deduceModuleInfoV2 = (Config, destConfig) => { + const { object, identifierMappings } = destConfig; + const identifierType = identifierMappings.map(({ to }) => to); + return { + operationModuleType: object, + upsertEndPoint: ZOHO_SDK.ZOHO.getBaseRecordUrl({ + dataCenter: Config.region, + moduleName: object, + }), + identifierType, + }; +}; + +// Keeping the original function name and return structure function validatePresenceOfMandatoryProperties(objectName, object) { - if (zohoConfig.MODULE_MANDATORY_FIELD_CONFIG.hasOwnProperty(objectName)) { - const requiredFields = zohoConfig.MODULE_MANDATORY_FIELD_CONFIG[objectName]; - const missingFields = - requiredFields.filter( - (field) => !object.hasOwnProperty(field) || !isDefinedAndNotNullAndNotEmpty(object[field]), - ) || []; - return { status: missingFields.length > 0, missingField: missingFields }; + if (!zohoConfig.MODULE_MANDATORY_FIELD_CONFIG.hasOwnProperty(objectName)) { + return undefined; // Maintaining original undefined return for custom objects } - // No mandatory check performed for custom objects + + const requiredFields = zohoConfig.MODULE_MANDATORY_FIELD_CONFIG[objectName]; + const missingFields = requiredFields.filter( + (field) => !object.hasOwnProperty(field) || !isDefinedAndNotNullAndNotEmpty(object[field]), + ); + + return { + status: missingFields.length > 0, + missingField: missingFields, + }; +} + +function validatePresenceOfMandatoryPropertiesV2(objectName, object) { + const { ZOHO } = ZOHO_SDK; + const moduleWiseMandatoryFields = ZOHO.fetchModuleWiseMandatoryFields(objectName); + if (isEmpty(moduleWiseMandatoryFields)) { + return undefined; + } + // All the required field keys are mapped but we need to check they have values + // We have this gurantee because the creation of the configuration doens't permit user to omit the mandatory fields + const missingFields = moduleWiseMandatoryFields.filter( + (field) => object.hasOwnProperty(field) && !isDefinedAndNotNullAndNotEmpty(object[field]), + ); + + return { + status: missingFields.length > 0, + missingField: missingFields, + }; } const formatMultiSelectFields = (config, fields) => { - // Convert multiSelectFieldLevelDecision array into a hash map for quick lookups const multiSelectFields = getHashFromArray( config.multiSelectFieldLevelDecision, 'from', @@ -50,85 +90,205 @@ const formatMultiSelectFields = (config, fields) => { false, ); - Object.keys(fields).forEach((eachFieldKey) => { - if (multiSelectFields.hasOwnProperty(eachFieldKey)) { - // eslint-disable-next-line no-param-reassign - fields[eachFieldKey] = [fields[eachFieldKey]]; + // Creating a shallow copy to avoid mutations + const formattedFields = { ...fields }; + + Object.keys(formattedFields).forEach((eachFieldKey) => { + if ( + multiSelectFields.hasOwnProperty(eachFieldKey) && + isDefinedAndNotNull(formattedFields[eachFieldKey]) + ) { + formattedFields[eachFieldKey] = [formattedFields[eachFieldKey]]; + } + }); + + return formattedFields; +}; + +const formatMultiSelectFieldsV2 = (destConfig, fields) => { + const multiSelectFields = getHashFromArray( + destConfig.multiSelectFieldLevelDecision, + 'from', + 'to', + false, + ); + // Creating a shallow copy to avoid mutations + const formattedFields = { ...fields }; + Object.keys(formattedFields).forEach((eachFieldKey) => { + if ( + multiSelectFields.hasOwnProperty(eachFieldKey) && + isDefinedAndNotNull(formattedFields[eachFieldKey]) + ) { + formattedFields[eachFieldKey] = [formattedFields[eachFieldKey]]; } }); - return fields; + return formattedFields; }; -// Utility to handle duplicate check const handleDuplicateCheck = (addDefaultDuplicateCheck, identifierType, operationModuleType) => { - let duplicateCheckFields = [identifierType]; + let additionalFields = []; if (addDefaultDuplicateCheck) { const moduleDuplicateCheckField = zohoConfig.MODULE_WISE_DUPLICATE_CHECK_FIELD[operationModuleType]; + additionalFields = isDefinedAndNotNull(moduleDuplicateCheckField) + ? moduleDuplicateCheckField + : ['Name']; + } - if (isDefinedAndNotNull(moduleDuplicateCheckField)) { - duplicateCheckFields = [...moduleDuplicateCheckField]; - duplicateCheckFields.unshift(identifierType); - } else { - duplicateCheckFields.push('Name'); // user chosen duplicate field always carries higher priority - } + return Array.from(new Set([identifierType, ...additionalFields])); +}; + +const handleDuplicateCheckV2 = (addDefaultDuplicateCheck, identifierType, operationModuleType) => { + let additionalFields = []; + + if (addDefaultDuplicateCheck) { + const { ZOHO } = ZOHO_SDK; + additionalFields = ZOHO.fetchModuleWiseDuplicateCheckField(operationModuleType); } - return [...new Set(duplicateCheckFields)]; + return Array.from(new Set([...identifierType, ...additionalFields])); }; -function escapeAndEncode(value) { - return encodeURIComponent(value.replace(/([(),\\])/g, '\\$1')); -} +// Zoho has limitation that where clause should be formatted in a specific way +// ref: https://www.zoho.com/crm/developer/docs/api/v6/COQL-Limitations.html +const groupConditions = (conditions) => { + if (conditions.length === 1) { + return conditions[0]; // No need for grouping with a single condition + } + if (conditions.length === 2) { + return `(${conditions[0]} AND ${conditions[1]})`; // Base case + } + return `(${groupConditions(conditions.slice(0, 2))} AND ${groupConditions(conditions.slice(2))})`; +}; -function transformToURLParams(fields, Config) { - const criteria = Object.entries(fields) - .map(([key, value]) => `(${key}:equals:${escapeAndEncode(value)})`) - .join('and'); +// supported data type in where clause +// ref: https://help.zoho.com/portal/en/kb/creator/developer-guide/forms/add-and-manage-fields/articles/understand-fields#Types_of_fields +// ref: https://www.zoho.com/crm/developer/docs/api/v6/Get-Records-through-COQL-Query.html +const generateWhereClause = (fields) => { + const conditions = Object.keys(removeUndefinedNullEmptyExclBoolInt(fields)).map((key) => { + const value = fields[key]; + if (Array.isArray(value)) { + return `${key} = '${value.join(';')}'`; + } + if (typeof value === 'number') { + return `${key} = ${value}`; + } + return `${key} = '${value}'`; + }); - const dataCenter = Config.region; - const regionBasedEndPoint = zohoConfig.DATA_CENTRE_BASE_ENDPOINTS_MAP[dataCenter]; + return conditions.length > 0 ? `WHERE ${groupConditions(conditions)}` : ''; +}; - return `${regionBasedEndPoint}/crm/v6/Leads/search?criteria=${criteria}`; -} +const generateSqlQuery = (module, fields) => { + // Generate the WHERE clause based on the fields + // Limiting to 25 fields + const entries = Object.entries(fields).slice(0, 25); + const whereClause = generateWhereClause(Object.fromEntries(entries)); + if (whereClause === '') { + return ''; + } + + // Construct the SQL query with specific fields in the SELECT clause + return `SELECT id FROM ${module} ${whereClause}`; +}; + +const sendCOQLRequest = async (region, accessToken, object, selectQuery) => { + try { + if (selectQuery === '') { + return { + erroneous: true, + code: 'INSTRUMENTATION_ERROR', + message: `Identifier values are not provided for ${object}`, + }; + } -// ref : https://www.zoho.com/crm/developer/docs/api/v6/search-records.html -const searchRecordId = async (fields, metadata, Config) => { - const searchURL = transformToURLParams(fields, Config); - const searchResult = await handleHttpRequest( - 'get', - searchURL, - { - headers: { - Authorization: `Zoho-oauthtoken ${metadata.secret.accessToken}`, + const searchURL = `${zohoConfig.DATA_CENTRE_BASE_ENDPOINTS_MAP[region]}/crm/v6/coql`; + const searchResult = await handleHttpRequest( + 'post', + searchURL, + { + select_query: selectQuery, }, - }, - { - destType: 'zoho', - feature: 'deleteRecords', - requestMethod: 'GET', - endpointPath: 'crm/v6/Leads/search?criteria=', - module: 'router', - }, - ); - if (!isHttpStatusSuccess(searchResult.processedResponse.status)) { + { + headers: { + Authorization: `Zoho-oauthtoken ${accessToken}`, + }, + }, + { + destType: 'zoho', + feature: 'deleteRecords', + requestMethod: 'POST', + endpointPath: searchURL, + module: 'router', + }, + ); + + if (!isHttpStatusSuccess(searchResult.processedResponse.status)) { + return { + erroneous: true, + message: searchResult.processedResponse.response, + }; + } + + if ( + searchResult.processedResponse.status === 204 || + !CommonUtils.isNonEmptyArray(searchResult.processedResponse.response?.data) + ) { + return { + erroneous: true, + message: `No ${object} is found with record details`, + }; + } + + return { + erroneous: false, + message: searchResult.processedResponse.response.data.map((record) => record.id), + }; + } catch (error) { + return { + erroneous: true, + message: error.message, + }; + } +}; + +const searchRecordId = async (fields, metadata, Config, operationModuleType, identifierType) => { + try { + const { region } = Config; + + const selectQuery = generateSqlQuery(operationModuleType, { + [identifierType]: fields[identifierType], + }); + const result = await sendCOQLRequest( + region, + metadata.secret.accessToken, + operationModuleType, + selectQuery, + ); + return result; + } catch (error) { return { erroneous: true, - message: searchResult.processedResponse.response, + message: error.message, }; } - if (searchResult.processedResponse.status === 204) { +}; + +const searchRecordIdV2 = async (identifiers, metadata, Config, destConfig) => { + try { + const { region } = Config; + const { object } = destConfig; + + const selectQuery = generateSqlQuery(object, identifiers); + const result = await sendCOQLRequest(region, metadata.secret.accessToken, object, selectQuery); + return result; + } catch (error) { return { erroneous: true, - message: 'No contact is found with record details', + message: error.message, }; } - const recordIds = searchResult.processedResponse.response.data.map((record) => record.id); - return { - erroneous: false, - message: recordIds, - }; }; // ref : https://www.zoho.com/crm/developer/docs/api/v6/upsert-records.html#:~:text=The%20trigger%20input%20can%20be%20workflow%2C%20approval%2C%20or%20blueprint.%20If%20the%20trigger%20is%20not%20mentioned%2C%20the%20workflows%2C%20approvals%20and%20blueprints%20related%20to%20the%20API%20will%20get%20executed.%20Enter%20the%20trigger%20value%20as%20%5B%5D%20to%20not%20execute%20the%20workflows. @@ -142,18 +302,15 @@ const calculateTrigger = (trigger) => { return [trigger]; }; -const validateConfigurationIssue = (Config, operationModuleType, action) => { +const validateConfigurationIssue = (Config, operationModuleType) => { const hashMapMultiselect = getHashFromArray( Config.multiSelectFieldLevelDecision, 'from', 'to', false, ); - if ( - Object.keys(hashMapMultiselect).length > 0 && - Config.module !== operationModuleType && - action !== 'delete' - ) { + + if (Object.keys(hashMapMultiselect).length > 0 && Config.module !== operationModuleType) { throw new ConfigurationError( 'Object Chosen in Visual Data Mapper is not consistent with Module type selected in destination configuration. Aborting Events.', ); @@ -162,11 +319,15 @@ const validateConfigurationIssue = (Config, operationModuleType, action) => { module.exports = { deduceModuleInfo, + deduceModuleInfoV2, validatePresenceOfMandatoryProperties, + validatePresenceOfMandatoryPropertiesV2, formatMultiSelectFields, + formatMultiSelectFieldsV2, handleDuplicateCheck, + handleDuplicateCheckV2, searchRecordId, - transformToURLParams, + searchRecordIdV2, calculateTrigger, validateConfigurationIssue, }; diff --git a/src/cdk/v2/destinations/zoho/utils.test.js b/src/cdk/v2/destinations/zoho/utils.test.js index 5a11794ef57..cf8e5a7ab71 100644 --- a/src/cdk/v2/destinations/zoho/utils.test.js +++ b/src/cdk/v2/destinations/zoho/utils.test.js @@ -1,263 +1,1030 @@ +jest.mock('../../../../adapters/network'); +const { ConfigurationError } = require('@rudderstack/integrations-lib'); +const { handleHttpRequest } = require('../../../../adapters/network'); const { handleDuplicateCheck, deduceModuleInfo, + deduceModuleInfoV2, validatePresenceOfMandatoryProperties, - formatMultiSelectFields, validateConfigurationIssue, + formatMultiSelectFields, + formatMultiSelectFieldsV2, + calculateTrigger, + searchRecordId, + searchRecordIdV2, } = require('./utils'); -const { ConfigurationError } = require('@rudderstack/integrations-lib'); - describe('handleDuplicateCheck', () => { - // Returns identifierType when addDefaultDuplicateCheck is false - it('should return identifierType when addDefaultDuplicateCheck is false', () => { - const identifierType = 'email'; - const addDefaultDuplicateCheck = false; - const operationModuleType = 'Leads'; - const moduleWiseDuplicateCheckField = {}; - - const result = handleDuplicateCheck( - addDefaultDuplicateCheck, - identifierType, - operationModuleType, - moduleWiseDuplicateCheckField, - ); - - expect(result).toEqual([identifierType]); - }); + const testCases = [ + { + name: 'should return identifierType when addDefaultDuplicateCheck is false', + input: { + identifierType: 'email', + addDefaultDuplicateCheck: false, + operationModuleType: 'Leads', + moduleWiseDuplicateCheckField: {}, + }, + expected: ['email'], + }, + { + name: 'handles valid operationModuleType and already included identifierType', + input: { + identifierType: 'Email', + addDefaultDuplicateCheck: true, + operationModuleType: 'Leads', + }, + expected: ['Email'], + }, + { + name: "should return identifierType and 'Name' when addDefaultDuplicateCheck is true and moduleDuplicateCheckField is not defined", + input: { + identifierType: 'id', + addDefaultDuplicateCheck: true, + operationModuleType: 'type3', + }, + expected: ['id', 'Name'], + }, + { + name: 'should handle null values in moduleWiseDuplicateCheckField', + input: { + identifierType: 'Identifier', + addDefaultDuplicateCheck: true, + operationModuleType: 'type1', + }, + expected: ['Identifier', 'Name'], + }, + ]; - it('Handles valid operationModuleType and already included identifierType', () => { - const identifierType = 'Email'; - const addDefaultDuplicateCheck = true; - const operationModuleType = 'Leads'; + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = handleDuplicateCheck( + input.addDefaultDuplicateCheck, + input.identifierType, + input.operationModuleType, + input.moduleWiseDuplicateCheckField, + ); + expect(result).toEqual(expected); + }); + }); +}); - const result = handleDuplicateCheck( - addDefaultDuplicateCheck, - identifierType, - operationModuleType, - ); +describe('formatMultiSelectFields', () => { + const testCases = [ + { + name: 'should convert a field value to an array if a mapping exists in multiSelectFieldLevelDecision', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'tags', to: 'tagsArray' }], + }, + fields: { tags: 'value' }, + }, + expected: { tags: ['value'] }, + }, + { + name: 'should leave fields unchanged if mapping fields exists but null', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'tags', to: 'tagsArray' }], + }, + fields: { tags: null, other: 'val' }, + }, + expected: { tags: null, other: 'val' }, + }, + { + name: 'should leave fields unchanged if no mapping exists', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'categories', to: 'catArray' }], + }, + fields: { tags: 'value', other: 'val' }, + }, + expected: { tags: 'value', other: 'val' }, + }, + ]; - expect(result).toEqual(['Email']); + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = formatMultiSelectFields(input.config, { ...input.fields }); + expect(result).toEqual(expected); + }); }); +}); - // Returns identifierType and 'Name' when addDefaultDuplicateCheck is true and moduleDuplicateCheckField is not defined - it("should return identifierType and 'Name' when addDefaultDuplicateCheck is true and moduleDuplicateCheckField is not defined", () => { - const identifierType = 'id'; - const operationModuleType = 'type3'; - const addDefaultDuplicateCheck = true; - - const result = handleDuplicateCheck( - addDefaultDuplicateCheck, - identifierType, - operationModuleType, - ); +describe('formatMultiSelectFieldsV2', () => { + const testCases = [ + { + name: 'should convert a field value to an array if a mapping exists in multiSelectFieldLevelDecision', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'tags', to: 'true' }], + }, + fields: { tags: 'value' }, + }, + expected: { tags: ['value'] }, + }, + { + name: 'should leave fields unchanged if mapping fields exists but null', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'tags', to: 'true' }], + }, + fields: { tags: null, other: 'val' }, + }, + expected: { tags: null, other: 'val' }, + }, + { + name: 'should leave fields unchanged if no mapping exists', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'categories', to: 'true' }], + }, + fields: { tags: 'value', other: 'val' }, + }, + expected: { tags: 'value', other: 'val' }, + }, + ]; - expect(result).toEqual(['id', 'Name']); + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = formatMultiSelectFieldsV2(input.config, { ...input.fields }); + expect(result).toEqual(expected); + }); }); +}); - // Handles null values in moduleWiseDuplicateCheckField - it('should handle null values in moduleWiseDuplicateCheckField', () => { - const addDefaultDuplicateCheck = true; - const identifierType = 'Identifier'; - const operationModuleType = 'type1'; - - const result = handleDuplicateCheck( - addDefaultDuplicateCheck, - identifierType, - operationModuleType, - ); +describe('calculateTrigger', () => { + const testCases = [ + { + name: 'should return null when trigger is "Default"', + input: 'Default', + expected: null, + }, + { + name: 'should return an empty array when trigger is "None"', + input: 'None', + expected: [], + }, + { + name: 'should return an array containing the trigger for Custom', + input: 'Custom', + expected: ['Custom'], + }, + { + name: 'should return an array containing the trigger for Approval', + input: 'Approval', + expected: ['Approval'], + }, + ]; - expect(result).toEqual(['Identifier', 'Name']); + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + expect(calculateTrigger(input)).toEqual(expected); + }); }); }); -describe('deduceModuleInfo', () => { - const Config = { region: 'US' }; +describe('searchRecordId', () => { + const module = 'Leads'; + const mockFields = { Email: 'test@example.com', Name: 'John Doe' }; + const mockMetadata = { secret: { accessToken: 'mock-token' } }; + const mockConfig = { region: 'US' }; + const mockQuery = "SELECT id FROM Leads WHERE Email = 'test@example.com'"; - it('should return empty object when mappedToDestination is not present', () => { - const inputs = [{}]; - const result = deduceModuleInfo(inputs, Config); - expect(result).toEqual({}); + beforeEach(() => { + jest.clearAllMocks(); }); - it('should return operationModuleInfo when mappedToDestination is present', () => { - const inputs = [ - { - message: { - context: { - externalId: [{ type: 'ZOHO-Leads', id: '12345', identifierType: 'Email' }], - mappedToDestination: true, + const testCases = [ + { + fields: mockFields, + module, + query: mockQuery, + name: 'should handle non-array response data', + identifierType: 'Email', + response: { + processedResponse: { + status: 200, + response: { + data: 'not-an-array', }, }, }, - ]; - - const result = deduceModuleInfo(inputs, Config); - expect(result).toEqual({ - operationModuleType: 'Leads', - upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + expected: { + erroneous: true, + message: 'No Leads is found with record details', + }, + }, + { + fields: mockFields, + query: mockQuery, + module, + name: 'should handle missing response data property', + identifierType: 'Email', + response: { + processedResponse: { + status: 200, + response: {}, + }, + }, + expected: { + erroneous: true, + message: 'No Leads is found with record details', + }, + }, + { + fields: mockFields, + query: mockQuery, + module, + name: 'should handle null response data', + identifierType: 'Email', + response: { + processedResponse: { + status: 200, + response: { + data: null, + }, + }, + }, + expected: { + erroneous: true, + message: 'No Leads is found with record details', + }, + }, + { + fields: mockFields, + query: mockQuery, + module, + name: 'should handle empty array response data', + identifierType: 'Email', + response: { + processedResponse: { + status: 200, + response: { + data: [], + }, + }, + }, + expected: { + erroneous: true, + message: 'No Leads is found with record details', + }, + }, + { + fields: mockFields, + query: mockQuery, + module, + name: 'should handle valid array response data with single record', + identifierType: 'Email', + response: { + processedResponse: { + status: 200, + response: { + data: [{ id: '123' }], + }, + }, + }, + expected: { + erroneous: false, + message: ['123'], + }, + }, + { + fields: mockFields, + query: mockQuery, + module, + name: 'should handle non-success HTTP status code', identifierType: 'Email', + response: { + processedResponse: { + status: 400, + response: 'Bad Request Error', + }, + }, + expected: { + erroneous: true, + message: 'Bad Request Error', + }, + }, + { + fields: mockFields, + query: mockQuery, + module, + name: 'should handle HTTP request error', + identifierType: 'Email', + error: new Error('Network Error'), + expected: { + erroneous: true, + message: 'Network Error', + }, + }, + ]; + + testCases.forEach(({ name, response, error, expected, query, fields, identifierType }) => { + it(name, async () => { + if (error) { + handleHttpRequest.mockRejectedValueOnce(error); + } else { + handleHttpRequest.mockResolvedValueOnce(response); + } + + const result = await searchRecordId(fields, mockMetadata, mockConfig, module, identifierType); + expect(handleHttpRequest).toHaveBeenCalledWith( + 'post', + 'https://www.zohoapis.com/crm/v6/coql', + { + select_query: query, + }, + { + headers: { + Authorization: `Zoho-oauthtoken ${mockMetadata.secret.accessToken}`, + }, + }, + { + destType: 'zoho', + feature: 'deleteRecords', + requestMethod: 'POST', + endpointPath: 'https://www.zohoapis.com/crm/v6/coql', + module: 'router', + }, + ); + + expect(result).toEqual(expected); }); }); - it('should handle different regions in config', () => { - const inputs = [ - { - message: { - context: { - externalId: [{ type: 'ZOHO-Leads', id: '12345', identifierType: 'Email' }], - mappedToDestination: 'true', + const testCases2 = [ + { + fields: { + Email: '', + phone: null, + jobs: [], + }, + query: mockQuery, + module, + identifierType: 'Email', + name: 'should return intrumentation error when identifier value is empty', + response: { + processedResponse: { + status: 200, + response: { + data: [{ id: '123' }], }, }, }, - ]; - const Config = { region: 'EU' }; + expected: { + erroneous: true, + code: 'INSTRUMENTATION_ERROR', + message: 'Identifier values are not provided for Leads', + }, + }, + ]; - const result = deduceModuleInfo(inputs, Config); - expect(result).toEqual({ - operationModuleType: 'Leads', - upsertEndPoint: 'https://www.zohoapis.eu/crm/v6/Leads', - identifierType: 'Email', + testCases2.forEach(({ name, expected, fields, identifierType }) => { + it(name, async () => { + const result = await searchRecordId(fields, mockMetadata, mockConfig, module, identifierType); + expect(result).toEqual(expected); }); }); }); -describe('validatePresenceOfMandatoryProperties', () => { - it('should not throw an error if the object has all required fields', () => { - const objectName = 'Leads'; - const object = { Last_Name: 'Doe' }; - - expect(() => validatePresenceOfMandatoryProperties(objectName, object)).not.toThrow(); - }); - - it('should return missing field if mandatory field contains empty string', () => { - const objectName = 'Leads'; - const object = { Last_Name: '' }; +describe('searchRecordIdV2', () => { + const mockFields = { Email: 'test@example.com' }; + const mockMetadata = { secret: { accessToken: 'mock-token' } }; + const mockConfig = { region: 'US' }; + const mockConConfig = { + destination: { + object: 'Leads', + identifierMappings: [{ to: 'Email', from: 'Email' }], + }, + }; + const mockQuery = "SELECT id FROM Leads WHERE Email = 'test@example.com'"; - const result = validatePresenceOfMandatoryProperties(objectName, object); - - expect(result).toEqual({ missingField: ['Last_Name'], status: true }); + beforeEach(() => { + jest.clearAllMocks(); }); - it('should return missing field if mandatory field contains empty null', () => { - const objectName = 'Leads'; - const object = { Last_Name: null }; - - const result = validatePresenceOfMandatoryProperties(objectName, object); - - expect(result).toEqual({ missingField: ['Last_Name'], status: true }); - }); + const testCases = [ + { + fields: mockFields, + module: mockConConfig.destination.object, + query: mockQuery, + name: 'should handle non-array response data', + response: { + processedResponse: { + status: 200, + response: { + data: 'not-an-array', + }, + }, + }, + expected: { + erroneous: true, + message: 'No Leads is found with record details', + }, + }, + { + fields: mockFields, + query: mockQuery, + module: mockConConfig.destination.object, + name: 'should handle missing response data property', + response: { + processedResponse: { + status: 200, + response: {}, + }, + }, + expected: { + erroneous: true, + message: 'No Leads is found with record details', + }, + }, + { + fields: mockFields, + query: mockQuery, + module: mockConConfig.destination.object, + name: 'should handle null response data', + response: { + processedResponse: { + status: 200, + response: { + data: null, + }, + }, + }, + expected: { + erroneous: true, + message: 'No Leads is found with record details', + }, + }, + { + fields: mockFields, + query: mockQuery, + module: mockConConfig.destination.object, + name: 'should handle empty array response data', + response: { + processedResponse: { + status: 200, + response: { + data: [], + }, + }, + }, + expected: { + erroneous: true, + message: 'No Leads is found with record details', + }, + }, + { + fields: mockFields, + query: mockQuery, + module: mockConConfig.destination.object, + name: 'should handle valid array response data with single record', + response: { + processedResponse: { + status: 200, + response: { + data: [{ id: '123' }], + }, + }, + }, + expected: { + erroneous: false, + message: ['123'], + }, + }, + { + fields: { + Name: 'rid1927ce14265c006ae11555ec6e1cdbbac', + Name1: 'Liam Bailey', + Has_Chargeback: true, + Last_Client_Purchase: '2021-06-15T00:00:00Z', + Purchase_Category: ['category1', 'category2'], + Lifetime_Client_Revenue: 1200, + Name2: 'Olivia Smith', + Has_Chargeback2: false, + Last_Client_Purchase2: '2022-01-10T00:00:00Z', + Purchase_Category2: ['category3', 'category4'], + Lifetime_Client_Revenue2: 800, + Name3: 'Noah Johnson', + Has_Chargeback3: true, + Last_Client_Purchase3: '2023-03-22T00:00:00Z', + Purchase_Category3: ['category5'], + Lifetime_Client_Revenue3: 1500, + Name4: 'Emma Davis', + Has_Chargeback4: false, + Last_Client_Purchase4: '2023-07-01T00:00:00Z', + Purchase_Category4: ['category6', 'category7'], + Lifetime_Client_Revenue4: 900, + Name5: 'James Wilson', + Has_Chargeback5: true, + Last_Client_Purchase5: '2022-11-05T00:00:00Z', + Purchase_Category5: ['category8'], + Lifetime_Client_Revenue5: 1100, + Name6: 'Sophia Miller', + Has_Chargeback6: false, + Last_Client_Purchase6: '2024-01-12T00:00:00Z', + Purchase_Category6: ['category9', 'category10'], + Lifetime_Client_Revenue6: 1300, + }, + module: mockConConfig.destination.object, + query: + "SELECT id FROM Leads WHERE ((Name = 'rid1927ce14265c006ae11555ec6e1cdbbac' AND Name1 = 'Liam Bailey') AND ((Has_Chargeback = 'true' AND Last_Client_Purchase = '2021-06-15T00:00:00Z') AND ((Purchase_Category = 'category1;category2' AND Lifetime_Client_Revenue = 1200) AND ((Name2 = 'Olivia Smith' AND Has_Chargeback2 = 'false') AND ((Last_Client_Purchase2 = '2022-01-10T00:00:00Z' AND Purchase_Category2 = 'category3;category4') AND ((Lifetime_Client_Revenue2 = 800 AND Name3 = 'Noah Johnson') AND ((Has_Chargeback3 = 'true' AND Last_Client_Purchase3 = '2023-03-22T00:00:00Z') AND ((Purchase_Category3 = 'category5' AND Lifetime_Client_Revenue3 = 1500) AND ((Name4 = 'Emma Davis' AND Has_Chargeback4 = 'false') AND ((Last_Client_Purchase4 = '2023-07-01T00:00:00Z' AND Purchase_Category4 = 'category6;category7') AND ((Lifetime_Client_Revenue4 = 900 AND Name5 = 'James Wilson') AND ((Has_Chargeback5 = 'true' AND Last_Client_Purchase5 = '2022-11-05T00:00:00Z') AND Purchase_Category5 = 'category8'))))))))))))", + name: 'should handle valid array response data with multiple records', + response: { + processedResponse: { + status: 200, + response: { + data: [{ id: '123' }, { id: '456' }], + }, + }, + }, + expected: { + erroneous: false, + message: ['123', '456'], + }, + }, + { + fields: mockFields, + query: mockQuery, + module: mockConConfig.destination.object, + name: 'should handle non-success HTTP status code', + response: { + processedResponse: { + status: 400, + response: 'Bad Request Error', + }, + }, + expected: { + erroneous: true, + message: 'Bad Request Error', + }, + }, + { + fields: mockFields, + query: mockQuery, + module: mockConConfig.destination.object, + name: 'should handle HTTP request error', + error: new Error('Network Error'), + expected: { + erroneous: true, + message: 'Network Error', + }, + }, + ]; - it('should not throw an error if the objectName is not in MODULE_MANDATORY_FIELD_CONFIG', () => { - const objectName = 'CustomObject'; - const object = { Some_Field: 'Some Value' }; + testCases.forEach(({ name, response, error, expected, query, fields }) => { + it(name, async () => { + if (error) { + handleHttpRequest.mockRejectedValueOnce(error); + } else { + handleHttpRequest.mockResolvedValueOnce(response); + } - expect(() => validatePresenceOfMandatoryProperties(objectName, object)).not.toThrow(); - }); + const result = await searchRecordIdV2( + fields, + mockMetadata, + mockConfig, + mockConConfig.destination, + ); + expect(handleHttpRequest).toHaveBeenCalledWith( + 'post', + 'https://www.zohoapis.com/crm/v6/coql', + { + select_query: query, + }, + { + headers: { + Authorization: `Zoho-oauthtoken ${mockMetadata.secret.accessToken}`, + }, + }, + { + destType: 'zoho', + feature: 'deleteRecords', + requestMethod: 'POST', + endpointPath: 'https://www.zohoapis.com/crm/v6/coql', + module: 'router', + }, + ); - it('should throw an error if the object is missing multiple required fields', () => { - const objectName = 'Deals'; - const object = { Deal_Name: 'Big Deal' }; - const output = validatePresenceOfMandatoryProperties(objectName, object); - expect(output).toEqual({ - missingField: ['Stage', 'Pipeline'], - status: true, + expect(result).toEqual(expected); }); }); - it('should not throw an error if the object has all required fields for Deals', () => { - const objectName = 'Deals'; - const object = { Deal_Name: 'Big Deal', Stage: 'Negotiation', Pipeline: 'Sales' }; + const testCases2 = [ + { + fields: { + Email: '', + phone: null, + jobs: [], + }, + query: mockQuery, + module: mockConConfig.destination.object, + name: 'should return intrumentation error when identifier value is empty', + response: { + processedResponse: { + status: 200, + response: { + data: [{ id: '123' }], + }, + }, + }, + expected: { + erroneous: true, + code: 'INSTRUMENTATION_ERROR', + message: 'Identifier values are not provided for Leads', + }, + }, + ]; - expect(() => validatePresenceOfMandatoryProperties(objectName, object)).not.toThrow(); + testCases2.forEach(({ name, expected, fields }) => { + it(name, async () => { + const result = await searchRecordIdV2( + fields, + mockMetadata, + mockConfig, + mockConConfig.destination, + ); + expect(result).toEqual(expected); + }); }); }); -describe('validateConfigurationIssue', () => { - test('should throw ConfigurationError when hashMapMultiselect is not empty, Config.module is different from operationModuleType, and action is not delete', () => { - const Config = { - multiSelectFieldLevelDecision: [{ from: 'field1', to: 'true' }], - module: 'moduleA', - }; - const operationModuleType = 'moduleB'; - const action = 'create'; - - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).toThrow( - ConfigurationError, - ); - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).toThrow( - 'Object Chosen in Visual Data Mapper is not consistent with Module type selected in destination configuration. Aborting Events.', - ); - }); - - test('should not throw an error when hashMapMultiselect is not empty, Config.module is the same as operationModuleType, and action is not delete', () => { - const Config = { - multiSelectFieldLevelDecision: [{ from: 'field1', to: 'true' }], - module: 'moduleA', - }; - const operationModuleType = 'moduleA'; - const action = 'create'; - - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).not.toThrow(); - }); - - test('should not throw an error when hashMapMultiselect is empty, Config.module is different from operationModuleType, and action is not delete', () => { - const Config = { - multiSelectFieldLevelDecision: [], - module: 'moduleA', - }; - const operationModuleType = 'moduleB'; - const action = 'create'; +describe('deduceModuleInfo', () => { + const testCases = [ + { + name: 'should return empty object when mappedToDestination is not present', + input: { + inputs: [{}], + config: { region: 'US' }, + }, + expected: {}, + }, + { + name: 'should return operationModuleInfo when mappedToDestination is present', + input: { + inputs: [ + { + message: { + context: { + externalId: [{ type: 'ZOHO-Leads', id: '12345', identifierType: 'Email' }], + mappedToDestination: true, + }, + }, + }, + ], + config: { region: 'US' }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + identifierType: 'Email', + }, + }, + { + name: 'should handle different regions in config', + input: { + inputs: [ + { + message: { + context: { + externalId: [{ type: 'ZOHO-Leads', id: '12345', identifierType: 'Email' }], + mappedToDestination: 'true', + }, + }, + }, + ], + config: { region: 'EU' }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.eu/crm/v6/Leads', + identifierType: 'Email', + }, + }, + { + name: 'should handle null input', + input: { + inputs: null, + config: {}, + }, + expected: {}, + }, + { + name: 'should handle undefined input', + input: { + inputs: undefined, + config: {}, + }, + expected: {}, + }, + { + name: 'should handle non-array input', + input: { + inputs: 'not an array', + config: {}, + }, + expected: {}, + }, + { + name: 'should handle empty array', + input: { + inputs: [], + config: {}, + }, + expected: {}, + }, + { + name: 'should use default US region when config.region is null', + input: { + inputs: [ + { + message: { + context: { + externalId: [{ type: 'ZOHO-Leads', id: '12345', identifierType: 'Email' }], + mappedToDestination: true, + }, + }, + }, + ], + config: { region: null }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + identifierType: 'Email', + }, + }, + { + name: 'should use default US region when config.region is undefined', + input: { + inputs: [ + { + message: { + context: { + externalId: [{ type: 'ZOHO-Leads', id: '12345', identifierType: 'Email' }], + mappedToDestination: true, + }, + }, + }, + ], + config: {}, // region is undefined + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + identifierType: 'Email', + }, + }, + ]; - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).not.toThrow(); + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = deduceModuleInfo(input.inputs, input.config); + expect(result).toEqual(expected); + }); }); +}); - test('should not throw an error when hashMapMultiselect is empty, Config.module is the same as operationModuleType, and action is not delete', () => { - const Config = { - multiSelectFieldLevelDecision: [], - module: 'moduleA', - }; - const operationModuleType = 'moduleA'; - const action = 'create'; +describe('deduceModuleInfoV2', () => { + const testCases = [ + { + name: 'should return operationModuleInfo, upsertEndPoint and identifierType when conConfig is present', + input: { + config: { region: 'US' }, + destination: { + object: 'Leads', + identifierMappings: [{ to: 'Email', from: 'Email' }], + }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + identifierType: ['Email'], + }, + }, + { + name: 'should handle different regions in config', + input: { + config: { region: 'EU' }, + destination: { + object: 'Leads', + identifierMappings: [{ to: 'Email', from: 'Email' }], + }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.eu/crm/v6/Leads', + identifierType: ['Email'], + }, + }, + { + name: 'should use default US region when config.region is null', + input: { + config: {}, + destination: { + object: 'Leads', + identifierMappings: [{ to: 'Email', from: 'Email' }], + }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + identifierType: ['Email'], + }, + }, + { + name: 'should use default US region when config.region is undefined', + input: { + config: {}, // region is undefined + destination: { + object: 'Leads', + identifierMappings: [{ to: 'Email', from: 'Email' }], + }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + identifierType: ['Email'], + }, + }, + ]; - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).not.toThrow(); + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = deduceModuleInfoV2(input.config, input.destination); + expect(result).toEqual(expected); + }); }); +}); - test('should not throw an error when multiSelectFieldLevelDecision has entries without from key', () => { - const Config = { - multiSelectFieldLevelDecision: [{ to: 'true' }], - module: 'moduleA', - }; - const operationModuleType = 'moduleB'; - const action = 'create'; - - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).not.toThrow(); - }); +describe('validatePresenceOfMandatoryProperties', () => { + const testCases = [ + { + name: 'should not throw an error if the object has all required fields', + input: { + objectName: 'Leads', + object: { Last_Name: 'Doe' }, + }, + expected: { missingField: [], status: false }, + expectError: false, + }, + { + name: 'should return missing field if mandatory field contains empty string', + input: { + objectName: 'Leads', + object: { Last_Name: '' }, + }, + expected: { missingField: ['Last_Name'], status: true }, + expectError: false, + }, + { + name: 'should return missing field if mandatory field contains empty null', + input: { + objectName: 'Leads', + object: { Last_Name: null }, + }, + expected: { missingField: ['Last_Name'], status: true }, + expectError: false, + }, + { + name: 'should not throw an error if the objectName is not in MODULE_MANDATORY_FIELD_CONFIG', + input: { + objectName: 'CustomObject', + object: { Some_Field: 'Some Value' }, + }, + expected: undefined, + expectError: false, + }, + { + name: 'should return multiple missing fields for Deals', + input: { + objectName: 'Deals', + object: { Deal_Name: 'Big Deal' }, + }, + expected: { + missingField: ['Stage', 'Pipeline'], + status: true, + }, + expectError: false, + }, + { + name: 'should not throw an error if the object has all required fields for Deals', + input: { + objectName: 'Deals', + object: { Deal_Name: 'Big Deal', Stage: 'Negotiation', Pipeline: 'Sales' }, + }, + expected: { missingField: [], status: false }, + expectError: false, + }, + ]; - test('should throw ConfigurationError when multiSelectFieldLevelDecision has mixed case from keys, Config.module is different from operationModuleType, and action is not delete', () => { - const Config = { - multiSelectFieldLevelDecision: [ - { from: 'FIELD1', to: 'true' }, - { from: 'field2', to: 'false' }, - ], - module: 'moduleA', - }; - const operationModuleType = 'moduleB'; - const action = 'create'; - - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).toThrow( - ConfigurationError, - ); + testCases.forEach(({ name, input, expected, expectError }) => { + it(name, () => { + if (expectError) { + expect(() => + validatePresenceOfMandatoryProperties(input.objectName, input.object), + ).toThrow(); + } else { + const result = validatePresenceOfMandatoryProperties(input.objectName, input.object); + expect(result).toEqual(expected); + } + }); }); +}); - test('should not throw an error when hashMapMultiselect is not empty, Config.module is different from operationModuleType, and action is delete', () => { - const Config = { - multiSelectFieldLevelDecision: [{ from: 'field1', to: 'true' }], - module: 'moduleA', - }; - const operationModuleType = 'moduleB'; - const action = 'delete'; +describe('validateConfigurationIssue', () => { + const testCases = [ + { + name: 'should throw ConfigurationError when hashMapMultiselect is not empty, Config.module is different from operationModuleType, and action is not delete', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'field1', to: 'true' }], + module: 'moduleA', + }, + operationModuleType: 'moduleB', + }, + expectError: true, + errorType: ConfigurationError, + errorMessage: + 'Object Chosen in Visual Data Mapper is not consistent with Module type selected in destination configuration. Aborting Events.', + }, + { + name: 'should not throw an error when hashMapMultiselect is not empty, Config.module is the same as operationModuleType', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'field1', to: 'true' }], + module: 'moduleA', + }, + operationModuleType: 'moduleA', + }, + expectError: false, + }, + { + name: 'should not throw an error when hashMapMultiselect is empty, Config.module is different from operationModuleType', + input: { + config: { + multiSelectFieldLevelDecision: [], + module: 'moduleA', + }, + operationModuleType: 'moduleB', + }, + expectError: false, + }, + { + name: 'should not throw an error when hashMapMultiselect is empty, Config.module is the same as operationModuleType', + input: { + config: { + multiSelectFieldLevelDecision: [], + module: 'moduleA', + }, + operationModuleType: 'moduleA', + }, + expectError: false, + }, + { + name: 'should not throw an error when multiSelectFieldLevelDecision has entries without from key', + input: { + config: { + multiSelectFieldLevelDecision: [{ to: 'true' }], + module: 'moduleA', + }, + operationModuleType: 'moduleB', + }, + expectError: false, + }, + { + name: 'should throw ConfigurationError when multiSelectFieldLevelDecision has mixed case from keys, Config.module is different from operationModuleType', + input: { + config: { + multiSelectFieldLevelDecision: [ + { from: 'FIELD1', to: 'true' }, + { from: 'field2', to: 'false' }, + ], + module: 'moduleA', + }, + operationModuleType: 'moduleB', + }, + expectError: true, + errorType: ConfigurationError, + errorMessage: + 'Object Chosen in Visual Data Mapper is not consistent with Module type selected in destination configuration. Aborting Events.', + }, + ]; - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).not.toThrow(); + testCases.forEach(({ name, input, expectError, errorType, errorMessage }) => { + it(name, () => { + if (expectError) { + expect(() => validateConfigurationIssue(input.config, input.operationModuleType)).toThrow( + errorType, + ); + expect(() => validateConfigurationIssue(input.config, input.operationModuleType)).toThrow( + errorMessage, + ); + } else { + expect(() => + validateConfigurationIssue(input.config, input.operationModuleType), + ).not.toThrow(); + } + }); }); }); diff --git a/src/constants/destinationCanonicalNames.js b/src/constants/destinationCanonicalNames.js index e9b7dc136b9..819ada2aa1b 100644 --- a/src/constants/destinationCanonicalNames.js +++ b/src/constants/destinationCanonicalNames.js @@ -187,6 +187,7 @@ const DestCanonicalNames = { wunderkind: ['wunderkind', 'Wunderkind', 'WUNDERKIND'], cordial: ['cordial', 'Cordial', 'CORDIAL'], clevertap: ['clevertap', 'Clevertap', 'CleverTap', 'CLEVERTAP'], + airship: ['airship', 'Airship', 'AIRSHIP'], }; module.exports = { DestHandlerMap, DestCanonicalNames }; diff --git a/src/constants/index.js b/src/constants/index.js index f8ca53a94c9..05a258ee646 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -55,6 +55,10 @@ const HTTP_CUSTOM_STATUS_CODES = { FILTERED: 298, }; +const ErrorMessages = { + JSONParseError: 'Malformed JSON in request body', +}; + module.exports = { EventType, GENERIC_TRUE_VALUES, @@ -64,4 +68,5 @@ module.exports = { TraitsMapping, WhiteListedTraits, HTTP_CUSTOM_STATUS_CODES, + ErrorMessages, }; diff --git a/src/controllers/__tests__/delivery.test.ts b/src/controllers/__tests__/delivery.test.ts index 0f91913f9d0..b5e37e1d589 100644 --- a/src/controllers/__tests__/delivery.test.ts +++ b/src/controllers/__tests__/delivery.test.ts @@ -18,7 +18,7 @@ beforeAll(async () => { }), ); applicationRoutes(app); - server = app.listen(9090); + server = app.listen(); }); afterAll(async () => { diff --git a/src/controllers/__tests__/destination.test.ts b/src/controllers/__tests__/destination.test.ts index 3c49a9a0aff..105f16b8560 100644 --- a/src/controllers/__tests__/destination.test.ts +++ b/src/controllers/__tests__/destination.test.ts @@ -19,7 +19,7 @@ beforeAll(async () => { }), ); applicationRoutes(app); - server = app.listen(9090); + server = app.listen(); }); afterAll(async () => { diff --git a/src/controllers/__tests__/regulation.test.ts b/src/controllers/__tests__/regulation.test.ts index 55cd8f2d376..42e45d9e138 100644 --- a/src/controllers/__tests__/regulation.test.ts +++ b/src/controllers/__tests__/regulation.test.ts @@ -18,7 +18,7 @@ beforeAll(async () => { }), ); applicationRoutes(app); - server = app.listen(9090); + server = app.listen(); }); afterAll(async () => { @@ -64,7 +64,7 @@ describe('Regulation controller tests', () => { const response = await request(server) .post('/deleteUsers') .set('Accept', 'application/json') - .set('x-rudder-dest-info', '{"a": "test"}') + .set('x-rudder-dest-info', JSON.stringify({ a: 'test' })) .send(getDeletionData()); expect(response.status).toEqual(400); @@ -94,7 +94,7 @@ describe('Regulation controller tests', () => { const response = await request(server) .post('/deleteUsers') .set('Accept', 'application/json') - .set('x-rudder-dest-info', '{"a": "test"}') + .set('x-rudder-dest-info', JSON.stringify({ a: 'test' })) .send(getDeletionData()); expect(response.status).toEqual(500); diff --git a/src/controllers/__tests__/source.test.ts b/src/controllers/__tests__/source.test.ts index 72bee83282e..dead14c3829 100644 --- a/src/controllers/__tests__/source.test.ts +++ b/src/controllers/__tests__/source.test.ts @@ -20,7 +20,7 @@ beforeAll(async () => { }), ); applicationRoutes(app); - server = app.listen(9090); + server = app.listen(); }); afterAll(async () => { @@ -41,8 +41,8 @@ const getData = () => { const getV2Data = () => { return [ - { request: { body: '{"a": "b"}' }, source: { id: 1 } }, - { request: { body: '{"a": "b"}' }, source: { id: 1 } }, + { request: { body: JSON.stringify({ a: 'b' }) }, source: { id: 1 } }, + { request: { body: JSON.stringify({ a: 'b' }) }, source: { id: 1 } }, ]; }; diff --git a/src/controllers/bulkUpload.ts b/src/controllers/bulkUpload.ts deleted file mode 100644 index cb0bcfed3c0..00000000000 --- a/src/controllers/bulkUpload.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* eslint-disable global-require, import/no-dynamic-require, @typescript-eslint/no-unused-vars */ -import { client as errNotificationClient } from '../util/errorNotifier'; -import { - getDestFileUploadHandler, - getJobStatusHandler, - getPollStatusHandler, -} from '../util/fetchDestinationHandlers'; -import { CatchErr, ContextBodySimple } from '../util/types'; -import logger from '../logger'; -// TODO: To be refactored and redisgned - -const ERROR_MESSAGE_PROCESSOR_STRING = 'Error occurred while processing payload.'; - -const getCommonMetadata = (ctx) => - // TODO: Parse information such as - // cluster, namespace, etc information - // from the request - ({ - namespace: 'Unknown', - cluster: 'Unknown', - }); - -const getReqMetadata = (ctx) => { - try { - const reqBody = ctx.request.body; - return { destType: reqBody?.destType, importId: reqBody?.importId }; - } catch (error) { - // Do nothing - } - return {}; -}; - -export const fileUpload = async (ctx) => { - logger.debug('Native(Bulk-Upload): Request to transformer:: /fileUpload route', ctx.request.body); - const getReqMetadataFileUpload = () => { - try { - const reqBody = ctx.request.body; - return { destType: reqBody?.destType }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const { destType }: ContextBodySimple = ctx.request.body; - const destFileUploadHandler = getDestFileUploadHandler('v0', destType.toLowerCase()); - - if (!destFileUploadHandler || !destFileUploadHandler.processFileData) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - let response; - try { - response = await destFileUploadHandler.processFileData(ctx.request.body); - } catch (error: CatchErr) { - response = { - statusCode: error?.response?.status || error?.status || 400, - error: error.message || ERROR_MESSAGE_PROCESSOR_STRING, - metadata: error.response ? error.response.metadata : null, - }; - errNotificationClient.notify(error, 'File Upload', { - ...response, - ...getCommonMetadata(ctx), - ...getReqMetadata(ctx), - }); - } - ctx.body = response; - logger.debug('Native(Bulk-Upload): Response from transformer:: /fileUpload route', ctx.body); - return ctx.body; -}; - -export const pollStatus = async (ctx) => { - logger.debug('Native(Bulk-Upload): Request to transformer:: /pollStatus route', ctx.request.body); - - const { destType }: ContextBodySimple = ctx.request.body; - const destFileUploadHandler = getPollStatusHandler('v0', destType.toLowerCase()); - let response; - if (!destFileUploadHandler || !destFileUploadHandler.processPolling) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - try { - response = await destFileUploadHandler.processPolling(ctx.request.body); - } catch (error: CatchErr) { - response = { - statusCode: error.response?.status || 400, - error: error.message || ERROR_MESSAGE_PROCESSOR_STRING, - }; - errNotificationClient.notify(error, 'Poll Status', { - ...response, - ...getCommonMetadata(ctx), - ...getReqMetadata(ctx), - }); - } - ctx.body = response; - logger.debug('Native(Bulk-Upload): Request from transformer:: /pollStatus route', ctx.body); - return ctx.body; -}; - -export const getWarnJobStatus = async (ctx) => { - logger.debug( - 'Native(Bulk-Upload): Request to transformer:: /getWarningJobs route', - ctx.request.body, - ); - - const { destType }: ContextBodySimple = ctx.request.body; - const destFileUploadHandler = getJobStatusHandler('v0', destType.toLowerCase()); - - if (!destFileUploadHandler || !destFileUploadHandler.processJobStatus) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - let response; - try { - response = await destFileUploadHandler.processJobStatus(ctx.request.body, 'warn'); - } catch (error: CatchErr) { - response = { - statusCode: error.response ? error.response.status : 400, - error: error.message || ERROR_MESSAGE_PROCESSOR_STRING, - }; - errNotificationClient.notify(error, 'Job Status', { - ...response, - ...getCommonMetadata(ctx), - ...getReqMetadata(ctx), - }); - } - ctx.body = response; - logger.debug('Native(Bulk-Upload): Request from transformer:: /getWarningJobs route', ctx.body); - return ctx.body; -}; - -export const getFailedJobStatus = async (ctx) => { - logger.debug( - 'Native(Bulk-Upload): Request to transformer:: /getFailedJobs route', - ctx.request.body, - ); - - const { destType }: ContextBodySimple = ctx.request.body; - const destFileUploadHandler = getJobStatusHandler('v0', destType.toLowerCase()); - - if (!destFileUploadHandler || !destFileUploadHandler.processJobStatus) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - let response; - try { - response = await destFileUploadHandler.processJobStatus(ctx.request.body, 'fail'); - } catch (error: CatchErr) { - response = { - statusCode: error.response ? error.response.status : 400, - error: error.message || ERROR_MESSAGE_PROCESSOR_STRING, - }; - errNotificationClient.notify(error, 'Job Status', { - ...response, - ...getCommonMetadata(ctx), - ...getReqMetadata(ctx), - }); - } - ctx.body = response; - logger.debug('Native(Bulk-Upload): Request from transformer:: /getFailedJobs route', ctx.body); - return ctx.body; -}; diff --git a/src/controllers/destination.ts b/src/controllers/destination.ts index 1b9d19c5afe..bc82afe9dc8 100644 --- a/src/controllers/destination.ts +++ b/src/controllers/destination.ts @@ -8,7 +8,7 @@ import { ProcessorTransformationResponse, RouterTransformationRequest, RouterTransformationResponse, -} from '../types/index'; +} from '../types'; import { DynamicConfigParser } from '../util/dynamicConfigParser'; import stats from '../util/stats'; import { getIntegrationVersion } from '../util/utils'; @@ -47,7 +47,7 @@ export class DestinationController { version, requestMetadata, ); - } catch (error: any) { + } catch (error: unknown) { resplist = events.map((ev) => { const metaTO = integrationService.getTags( destination, @@ -57,7 +57,7 @@ export class DestinationController { ); metaTO.metadata = ev.metadata; const errResp = DestinationPostTransformationService.handleProcessorTransformFailureEvents( - error, + error as Error, metaTO, ); return errResp; @@ -79,6 +79,7 @@ export class DestinationController { const routerRequest = ctx.request.body as RouterTransformationRequest; const destination = routerRequest.destType; let events = routerRequest.input; + const errorRespEvents = checkInvalidRtTfEvents(events); if (errorRespEvents.length > 0) { errorRespEvents[0].metadata = [ @@ -86,6 +87,7 @@ export class DestinationController { destType: destination, }, ]; + logger.debug( `[${destination}] Invalid router transform payload structure: ${JSON.stringify(events)}`, ); @@ -93,38 +95,45 @@ export class DestinationController { ControllerUtility.postProcess(ctx); return ctx; } + const metaTags = MiscService.getMetaTags(events[0].metadata); stats.histogram('dest_transform_input_events', events.length, { destination, version: 'v0', ...metaTags, }); + const integrationService = ServiceSelector.getDestinationService(events); let resplist: RouterTransformationResponse[]; + try { - events = DestinationPreTransformationService.preProcess(events, ctx); - const timestampCorrectEvents = ControllerUtility.handleTimestampInEvents(events); + const processedEvents = DestinationPreTransformationService.preProcess(events, ctx); + + const timestampCorrectEvents = ControllerUtility.handleTimestampInEvents(processedEvents); + events = DynamicConfigParser.process(timestampCorrectEvents); + resplist = await integrationService.doRouterTransformation( events, destination, getIntegrationVersion(), requestMetadata, ); - } catch (error: any) { + } catch (error: unknown) { const metaTO = integrationService.getTags( destination, - events[0].metadata?.destinationId, - events[0].metadata?.workspaceId, + events[0]?.metadata?.destinationId, + events[0]?.metadata?.workspaceId, tags.FEATURES.ROUTER, ); metaTO.metadatas = events.map((ev) => ev.metadata); const errResp = DestinationPostTransformationService.handleRouterTransformFailureEvents( - error, + error as Error, metaTO, ); resplist = [errResp]; } + ctx.body = { output: resplist }; ControllerUtility.postProcess(ctx); stats.histogram('dest_transform_output_events', resplist.length, { @@ -140,11 +149,14 @@ export class DestinationController { const requestMetadata = MiscService.getRequestMetadata(ctx); const routerRequest = ctx.request.body as RouterTransformationRequest; const destination = routerRequest.destType; - let events = routerRequest.input; + const events = routerRequest.input; + const integrationService = ServiceSelector.getDestinationService(events); try { - events = DestinationPreTransformationService.preProcess(events, ctx); - const timestampCorrectEvents = ControllerUtility.handleTimestampInEvents(events); + const processedEvents = DestinationPreTransformationService.preProcess(events, ctx); + + const timestampCorrectEvents = ControllerUtility.handleTimestampInEvents(processedEvents); + const resplist = integrationService.doBatchTransformation( timestampCorrectEvents, destination, @@ -152,16 +164,16 @@ export class DestinationController { requestMetadata, ); ctx.body = resplist; - } catch (error: any) { + } catch (error: unknown) { const metaTO = integrationService.getTags( destination, - events[0].metadata.destinationId, - events[0].metadata.workspaceId, + events[0]?.metadata?.destinationId, + events[0]?.metadata?.workspaceId, tags.FEATURES.BATCH, ); metaTO.metadatas = events.map((ev) => ev.metadata); const errResp = DestinationPostTransformationService.handleBatchTransformFailureEvents( - error, + error as Error, metaTO, ); ctx.body = [errResp]; diff --git a/src/controllers/obs.delivery.js b/src/controllers/obs.delivery.js deleted file mode 100644 index 8e99650af64..00000000000 --- a/src/controllers/obs.delivery.js +++ /dev/null @@ -1,130 +0,0 @@ -/** - * -------------------------------------- - * -------------------------------------- - * ---------TO BE DEPRECATED------------- - * -------------------------------------- - * -------------------------------------- - */ - -const match = require('match-json'); -const jsonDiff = require('json-diff'); -const networkHandlerFactory = require('../adapters/networkHandlerFactory'); -const { getPayloadData } = require('../adapters/network'); -const { generateErrorObject } = require('../v0/util'); -const logger = require('../logger'); -const tags = require('../v0/util/tags'); -const stats = require('../util/stats'); - -const DestProxyController = { - /** - * Handler for testing the destination proxy - * @param {*} destination Destination name - * @param {*} ctx - * @returns - */ - async handleProxyTestRequest(destination, ctx) { - const { - deliveryPayload: routerDeliveryPayload, - destinationRequestPayload: routerDestReqPayload, - } = ctx.request.body; - let response; - try { - const destNetworkHandler = networkHandlerFactory.getNetworkHandler(destination); - - const proxyDestReqPayload = destNetworkHandler.prepareProxy(routerDeliveryPayload); - response = { - destinationRequestPayload: proxyDestReqPayload, - }; - - // Special handling required as Go and JavaScript encodes - // URL parameters differently - const { payloadFormat } = getPayloadData(routerDeliveryPayload.body); - if (payloadFormat === 'FORM') { - // This is to make sure we encode `~` in the data coming from the router. - // The data coming from the router is already a query parameter string - const routerDataVal = new URLSearchParams(routerDestReqPayload.data); - routerDestReqPayload.data = routerDataVal; - - const proxyDataVal = new URLSearchParams(); - proxyDestReqPayload.data.forEach((value, key) => { - const encodeAsterisk = (x) => x.replace(/\*/g, '%2A'); - // Router encodes `*` as well - proxyDataVal.append(encodeAsterisk(key), encodeAsterisk(value)); - }); - proxyDestReqPayload.data = proxyDataVal; - } - - // Compare the destination request payloads from router and proxy - if (!match(routerDestReqPayload, proxyDestReqPayload)) { - stats.counter('proxy_test_payload_mismatch', 1, { - destination, - }); - - logger.error(`[TransformerProxyTest] Destination request payload mismatch!`); - logger.error( - `[TransformerProxyTest] Delivery payload (router): ${JSON.stringify( - routerDeliveryPayload, - )}`, - ); - logger.error( - `[TransformerProxyTest] Destination request payload (router): ${JSON.stringify( - routerDestReqPayload, - )}`, - ); - logger.error( - `[TransformerProxyTest] Destination request payload (proxy): ${JSON.stringify( - proxyDestReqPayload, - )} `, - ); - - // Compute output difference - const outputDiff = jsonDiff.diffString(routerDestReqPayload, proxyDestReqPayload); - logger.error( - `[TransformerProxyTest] Destination request payload difference: ${outputDiff}`, - ); - response = { - outputDiff, - ...response, - }; - } else { - stats.counter('proxy_test_payload_match', 1, { - destination, - }); - } - } catch (err) { - stats.counter('proxy_test_error', 1, { - destination, - }); - - response = generateErrorObject( - err, - { - [tags.TAG_NAMES.DEST_TYPE]: destination.toUpperCase(), - [tags.TAG_NAMES.MODULE]: tags.MODULES.DESTINATION, - [tags.TAG_NAMES.FEATURE]: tags.FEATURES.DATA_DELIVERY, - }, - false, - ); - response.message = `[TransformerProxyTest] Error occurred while testing proxy for destination ("${destination}"): "${err.message}"`; - logger.error(response.message); - logger.error(err); - logger.error( - `[TransformerProxyTest] Delivery payload (router): ${JSON.stringify( - routerDeliveryPayload, - )}`, - ); - logger.error( - `[TransformerProxyTest] Destination request payload (router): ${JSON.stringify( - routerDestReqPayload, - )}`, - ); - } - - // Always return success as router doesn't care - ctx.status = 200; - ctx.body = { output: response }; - return ctx.body; - }, -}; - -module.exports = { DestProxyController }; diff --git a/src/controllers/source.ts b/src/controllers/source.ts index 3d9fa4f4a45..ab5a5bbf7af 100644 --- a/src/controllers/source.ts +++ b/src/controllers/source.ts @@ -24,6 +24,11 @@ export class SourceController { version, events, ); + logger.debug('Native(Source-Transform):: Controller Input Adapter::', { + implementationVersion, + inputVersion: version, + source, + }); const resplist = await integrationService.sourceTransformRoutine( input, diff --git a/src/controllers/util/conversionStrategies/strategyV2ToV0.ts b/src/controllers/util/conversionStrategies/strategyV2ToV0.ts index 1145cf97632..2c91d82e403 100644 --- a/src/controllers/util/conversionStrategies/strategyV2ToV0.ts +++ b/src/controllers/util/conversionStrategies/strategyV2ToV0.ts @@ -1,17 +1,32 @@ +import { TransformationError } from '@rudderstack/integrations-lib'; import { SourceInputConversionResult, SourceInputV2 } from '../../../types'; import { VersionConversionStrategy } from './abstractions'; +import { ErrorMessages } from '../../../constants'; export class StrategyV2ToV0 extends VersionConversionStrategy> { convert(sourceEvents: SourceInputV2[]): SourceInputConversionResult>[] { - return sourceEvents.map((sourceEvent) => { - try { - const v0Event = JSON.parse(sourceEvent.request.body); - return { output: v0Event }; - } catch (err) { - const conversionError = - err instanceof Error ? err : new Error('error converting v2 to v0 spec'); - return { conversionError }; - } - }); + return sourceEvents.map((sourceEvent) => this.convertSingleEvent(sourceEvent)); + } + + private convertSingleEvent( + sourceEvent: SourceInputV2, + ): SourceInputConversionResult> { + try { + const v0Event = this.parseRequestBody(sourceEvent.request.body); + return { output: v0Event }; + } catch (err) { + const conversionError = + err instanceof TransformationError ? err : new Error('error converting v2 to v0 spec'); + + return { conversionError }; + } + } + + private parseRequestBody(body: string): NonNullable { + try { + return JSON.parse(body); + } catch (err) { + throw new TransformationError(ErrorMessages.JSONParseError); + } } } diff --git a/src/controllers/util/conversionStrategies/strategyV2ToV1.ts b/src/controllers/util/conversionStrategies/strategyV2ToV1.ts index 52cade0d9d3..068bc4ce63a 100644 --- a/src/controllers/util/conversionStrategies/strategyV2ToV1.ts +++ b/src/controllers/util/conversionStrategies/strategyV2ToV1.ts @@ -1,17 +1,31 @@ +import { TransformationError } from '@rudderstack/integrations-lib'; import { SourceInput, SourceInputConversionResult, SourceInputV2 } from '../../../types'; import { VersionConversionStrategy } from './abstractions'; export class StrategyV2ToV1 extends VersionConversionStrategy { convert(sourceEvents: SourceInputV2[]): SourceInputConversionResult[] { - return sourceEvents.map((sourceEvent) => { - try { - const v1Event = { event: JSON.parse(sourceEvent.request.body), source: sourceEvent.source }; - return { output: v1Event }; - } catch (err) { - const conversionError = - err instanceof Error ? err : new Error('error converting v2 to v1 spec'); - return { conversionError }; - } - }); + return sourceEvents.map((sourceEvent) => this.convertSingleEvent(sourceEvent)); + } + + private convertSingleEvent(sourceEvent: SourceInputV2): SourceInputConversionResult { + try { + const v1Event = { + event: this.parseRequestBody(sourceEvent.request.body), + source: sourceEvent.source, + }; + return { output: v1Event }; + } catch (err) { + const conversionError = + err instanceof TransformationError ? err : new Error('error converting v2 to v1 spec'); + return { conversionError }; + } + } + + private parseRequestBody(body: string): NonNullable { + try { + return JSON.parse(body); + } catch (err) { + throw new TransformationError('Malformed JSON in request body'); + } } } diff --git a/src/controllers/util/index.test.ts b/src/controllers/util/index.test.ts index 4559bccc523..65f42ed56bc 100644 --- a/src/controllers/util/index.test.ts +++ b/src/controllers/util/index.test.ts @@ -1,8 +1,12 @@ +import { TransformationError } from '@rudderstack/integrations-lib'; +import { ErrorMessages } from '../../constants'; import { + Connection, Destination, Metadata, ProcessorTransformationRequest, RouterTransformationRequestData, + RudderMessage, } from '../../types'; import { ControllerUtility } from './index'; import lodash from 'lodash'; @@ -30,13 +34,20 @@ describe('adaptInputToVersion', () => { expect(result).toEqual(expected); }); it('should return the input unchanged when the implementation version and request version are the same i.e. v0', () => { - const sourceType = 'pipedream'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v0']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v0'; const input = [ { key1: 'val1', key2: 'val2' }, { key1: 'val1', key2: 'val2' }, { key1: 'val1', key2: 'val2' }, ]; + + // Mock return value for getSourceVersionsMap + const expected = { implementationVersion: 'v0', input: [ @@ -50,8 +61,13 @@ describe('adaptInputToVersion', () => { expect(result).toEqual(expected); }); + it('should return the input unchanged when the implementation version and request version are the same i.e. v1', () => { - const sourceType = 'webhook'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v1']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v1'; const input = [ { @@ -67,6 +83,7 @@ describe('adaptInputToVersion', () => { source: { id: 'source_id', config: { configField1: 'configVal1' } }, }, ]; + const expected = { implementationVersion: 'v1', input: [ @@ -95,8 +112,13 @@ describe('adaptInputToVersion', () => { expect(result).toEqual(expected); }); + it('should convert input from v0 to v1 when the request version is v0 and the implementation version is v1', () => { - const sourceType = 'webhook'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v1']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v0'; const input = [ { key1: 'val1', key2: 'val2' }, @@ -118,7 +140,11 @@ describe('adaptInputToVersion', () => { }); it('should convert input from v1 to v0 format when the request version is v1 and the implementation version is v0', () => { - const sourceType = 'pipedream'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v0']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v1'; const input = [ { @@ -149,7 +175,11 @@ describe('adaptInputToVersion', () => { }); it('should convert input from v2 to v0 format when the request version is v2 and the implementation version is v0', () => { - const sourceType = 'pipedream'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v0']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v2'; const input = [ @@ -159,7 +189,7 @@ describe('adaptInputToVersion', () => { url: 'http://example.com', proto: 'HTTP/2', headers: { headerkey: ['headervalue'] }, - body: '{"key": "value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -170,7 +200,7 @@ describe('adaptInputToVersion', () => { url: 'http://example.com', proto: 'HTTP/2', headers: { headerkey: ['headervalue'] }, - body: '{"key": "value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -181,7 +211,7 @@ describe('adaptInputToVersion', () => { url: 'http://example.com', proto: 'HTTP/2', headers: { headerkey: ['headervalue'] }, - body: '{"key": "value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -202,7 +232,11 @@ describe('adaptInputToVersion', () => { }); it('should fail trying to convert input from v2 to v0 format when the request version is v2 and the implementation version is v0', () => { - const sourceType = 'pipedream'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v0']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v2'; const input = [ @@ -222,7 +256,7 @@ describe('adaptInputToVersion', () => { implementationVersion: 'v0', input: [ { - conversionError: new SyntaxError('Unexpected end of JSON input'), + conversionError: new TransformationError(ErrorMessages.JSONParseError), }, ], }; @@ -233,7 +267,11 @@ describe('adaptInputToVersion', () => { }); it('should convert input from v2 to v1 format when the request version is v2 and the implementation version is v1', () => { - const sourceType = 'webhook'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v1']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v2'; const input = [ @@ -243,7 +281,7 @@ describe('adaptInputToVersion', () => { url: 'http://example.com', proto: 'HTTP/2', headers: { headerkey: ['headervalue'] }, - body: '{"key": "value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -254,7 +292,7 @@ describe('adaptInputToVersion', () => { url: 'http://example.com', proto: 'HTTP/2', headers: { headerkey: ['headervalue'] }, - body: '{"key": "value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -265,7 +303,7 @@ describe('adaptInputToVersion', () => { url: 'http://example.com', proto: 'HTTP/2', headers: { headerkey: ['headervalue'] }, - body: '{"key": "value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -301,7 +339,11 @@ describe('adaptInputToVersion', () => { }); it('should fail trying to convert input from v2 to v1 format when the request version is v2 and the implementation version is v1', () => { - const sourceType = 'webhook'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v1']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v2'; const input = [ @@ -321,7 +363,7 @@ describe('adaptInputToVersion', () => { implementationVersion: 'v1', input: [ { - conversionError: new SyntaxError('Unexpected end of JSON input'), + conversionError: new TransformationError(ErrorMessages.JSONParseError), }, ], }; @@ -333,7 +375,11 @@ describe('adaptInputToVersion', () => { // Should return an empty array when the input is an empty array it('should return an empty array when the input is an empty array', () => { - const sourceType = 'pipedream'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v0']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v1'; const input = []; const expected = { implementationVersion: 'v0', input: [] }; @@ -347,7 +393,6 @@ describe('adaptInputToVersion', () => { const sourceType = 'someSourceType'; const requestVersion = 'v1'; - // Mock return value for getSourceVersionsMap jest .spyOn(ControllerUtility as any, 'getSourceVersionsMap') .mockReturnValue(new Map([['someSourceType', 'v2']])); @@ -373,7 +418,7 @@ describe('adaptInputToVersion', () => { { output: { request: { - body: '{"key":"value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -382,7 +427,7 @@ describe('adaptInputToVersion', () => { { output: { request: { - body: '{"key":"value"}', + body: JSON.stringify({ key: 'value' }), }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, }, @@ -451,7 +496,7 @@ type timestampTestCases = { inputEvents: Array; }; -const metadata: Metadata = { +const metadata = { sourceId: '27O0bmEEx3GgfmEhZHUcPwJQVWC', workspaceId: '27O0bhB6p5ehfOWeeZlOSsSDTLg', namespace: '', @@ -482,7 +527,7 @@ const metadata: Metadata = { sourceDefinitionId: '1b6gJdqOPOCadT3cddw8eidV591', destinationDefinitionId: '', transformationId: '', -}; +} as unknown as Metadata; const destination: Destination = { ID: 'string', @@ -499,7 +544,7 @@ const destination: Destination = { Transformations: [], }; -const message = { +const message: RudderMessage = { anonymousId: '2073230', event: 'Test', messageId: 'e3a51e9a-6313-4389-ae73-07e487c8d9d0', @@ -522,11 +567,11 @@ function getDestination(overrides: Destination): Destination { return lodash.merge({}, destination, overrides); } -function getMessage(overrides: object): object { +function getMessage(overrides: object): RudderMessage { return lodash.merge({}, message, overrides); } -function getMessageWithShallowMerge(overrides: object): object { +function getMessageWithShallowMerge(overrides: object): RudderMessage { return lodash.assign({}, message, overrides); } diff --git a/src/controllers/util/index.ts b/src/controllers/util/index.ts index ab2a0f5dc3a..a25b59ee3cf 100644 --- a/src/controllers/util/index.ts +++ b/src/controllers/util/index.ts @@ -29,15 +29,25 @@ export class ControllerUtility { [EventType.TRACK]: [`properties.${RETL_TIMESTAMP}`, ...genericFieldMap.timestamp], }; + private static getSourceDirPath(version: string): string { + if (version === 'v2') { + return path.resolve(__dirname, '../../sources'); + } + return path.resolve(__dirname, `../../${version}/sources`); + } + private static getSourceVersionsMap(): Map { if (this.sourceVersionMap?.size > 0) { return this.sourceVersionMap; } - const versions = ['v0', 'v1']; + + const versions = ['v0', 'v1', 'v2']; + versions.forEach((version) => { - const files = fs.readdirSync(path.resolve(__dirname, `../../${version}/sources`), { + const files = fs.readdirSync(this.getSourceDirPath(version), { withFileTypes: true, }); + const sources = files.filter((file) => file.isDirectory()).map((folder) => folder.name); sources.forEach((source) => { this.sourceVersionMap.set(source, version); diff --git a/src/features.ts b/src/features.ts index fb91ae28833..cc4f0e541db 100644 --- a/src/features.ts +++ b/src/features.ts @@ -94,6 +94,8 @@ const defaultFeaturesConfig: FeaturesConfig = { INTERCOM_V2: true, LINKEDIN_AUDIENCE: true, TOPSORT: true, + CUSTOMERIO_AUDIENCE: true, + ACCOIL_ANALYTICS: true, }, regulations: [ 'BRAZE', diff --git a/src/helpers/__tests__/serviceSelector.test.ts b/src/helpers/__tests__/serviceSelector.test.ts index 0dab906f7ab..e0efff91ec7 100644 --- a/src/helpers/__tests__/serviceSelector.test.ts +++ b/src/helpers/__tests__/serviceSelector.test.ts @@ -51,7 +51,7 @@ describe('ServiceSelector Service', () => { }, }, }, - ] as ProcessorTransformationRequest[]; + ] as unknown as ProcessorTransformationRequest[]; expect(ServiceSelector['getPrimaryDestinationService'](events)).toBeInstanceOf( CDKV2DestinationService, ); diff --git a/src/legacy/delivery.js b/src/legacy/delivery.js deleted file mode 100644 index 8f7b0928154..00000000000 --- a/src/legacy/delivery.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * -------------------------------------- - * -------------------------------------- - * ---------TO BE DEPRICIATED------------ - * -------------------------------------- - * -------------------------------------- - */ - -const path = require('path'); -const KoaRouter = require('@koa/router'); -const { DestProxyController } = require('../controllers/obs.delivery'); -const { getIntegrations } = require('../routes/utils'); -const { SUPPORTED_VERSIONS, API_VERSION } = require('../routes/utils/constants'); - -const router = new KoaRouter(); - -SUPPORTED_VERSIONS.forEach((version) => { - const destinations = getIntegrations(path.resolve(__dirname, `../${version}/destinations`)); - destinations.forEach((destination) => { - router.post(`/${version}/destinations/${destination}/proxyTest`, async (ctx) => { - ctx.set('apiVersion', API_VERSION); - await DestProxyController.handleProxyTestRequest(destination, ctx); - }); - }); -}); - -module.exports = router.routes(); diff --git a/src/legacy/router.js b/src/legacy/router.js deleted file mode 100644 index b57f4db4228..00000000000 --- a/src/legacy/router.js +++ /dev/null @@ -1,1275 +0,0 @@ -// ============================================================================= -// DEPRECATION NOTICE: THIS FILE IS GETTING DEPRECATED AND WILL BE REMOVED IN FUTURE RELEASE -// ============================================================================= -/* eslint-disable import/no-dynamic-require */ -/* eslint-disable global-require */ -const Router = require('@koa/router'); -const lodash = require('lodash'); -const fs = require('fs'); -const path = require('path'); -const { PlatformError, getErrorRespEvents } = require('@rudderstack/integrations-lib'); -const logger = require('../logger'); -const stats = require('../util/stats'); -const { SUPPORTED_VERSIONS, API_VERSION } = require('../routes/utils/constants'); -const { client: errNotificationClient } = require('../util/errorNotifier'); -const tags = require('../v0/util/tags'); - -const { - isNonFuncObject, - getMetadata, - generateErrorObject, - checkAndCorrectUserId, -} = require('../v0/util'); -const { processDynamicConfig } = require('../util/dynamicConfig'); -const { DestHandlerMap } = require('../constants/destinationCanonicalNames'); -const { userTransformHandler } = require('../routerUtils'); -const networkHandlerFactory = require('../adapters/networkHandlerFactory'); -const destProxyRoutes = require('./delivery'); -const eventValidator = require('../util/eventValidation'); -const { getIntegrations } = require('../routes/utils'); -const { setupUserTransformHandler, validateCode } = require('../util/customTransformer'); -const { - RespStatusError, - RetryRequestError, - sendViolationMetrics, - constructValidationErrors, -} = require('../util/utils'); -const { extractLibraries } = require('../util/customTransformer'); -const { getCompatibleStatusCode } = require('../adapters/utils/networkUtils'); -const { oncehubTransformer } = require("../util/oncehub-custom-transformer"); - -const transformerMode = process.env.TRANSFORMER_MODE; - -const startDestTransformer = transformerMode === 'destination' || !transformerMode; -const startSourceTransformer = transformerMode === 'source' || !transformerMode; -const transformerProxy = process.env.TRANSFORMER_PROXY || true; -const proxyTestModeEnabled = - process.env.TRANSFORMER_PROXY_TEST_ENABLED?.toLowerCase() === 'true' || false; -const transformerTestModeEnabled = process.env.TRANSFORMER_TEST_MODE - ? process.env.TRANSFORMER_TEST_MODE.toLowerCase() === 'true' - : false; - -const router = new Router(); - -const PAYLOAD_PROC_ERR_MSG = 'Error occurred while processing payload'; - -/** - * @deprecated this function is deprecated and will be removed in future release - */ -const getDestHandler = (version, dest) => { - if (Object.prototype.hasOwnProperty.call(DestHandlerMap, dest)) { - return require(`../${version}/destinations/${DestHandlerMap[dest]}/transform`); - } - return require(`../${version}/destinations/${dest}/transform`); -}; - -const getDestFileUploadHandler = (version, dest) => - require(`../${version}/destinations/${dest}/fileUpload`); - -const getPollStatusHandler = (version, dest) => require(`../${version}/destinations/${dest}/poll`); - -const getJobStatusHandler = (version, dest) => - require(`../${version}/destinations/${dest}/fetchJobStatus`); - -const getDeletionUserHandler = (version, dest) => - require(`../${version}/destinations/${dest}/deleteUsers`); - -const getSourceHandler = (version, source) => require(`../${version}/sources/${source}/transform`); - -let areFunctionsEnabled = -1; -const functionsEnabled = () => { - if (areFunctionsEnabled === -1) { - areFunctionsEnabled = process.env.ENABLE_FUNCTIONS === 'false' ? 0 : 1; - } - return areFunctionsEnabled === 1; -}; - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getCommonMetadata(ctx) { - // TODO: Parse information such as - // cluster, namespace, etc information - // from the request - return { - namespace: 'Unknown', - cluster: 'Unknown', - }; -} - -/** - * Enriches the transformed event with more information - * - userId stringification - * - * @param {Object} transformedEvent - single transformed event - * @returns transformedEvent after enrichment - */ -const enrichTransformedEvent = (transformedEvent) => ({ - ...transformedEvent, - userId: checkAndCorrectUserId(transformedEvent.statusCode, transformedEvent?.userId), -}); - -/** - * @deprecated this function is deprecated and will be removed in future release - */ -function handleV0Destination(destHandler, inputArr) { - return destHandler(...inputArr); -} -/** - * @deprecated this function is deprecated and will be removed in future release - */ -async function handleDest(ctx, version, destination) { - const getReqMetadata = (event) => { - try { - return { - destType: destination, - destinationId: event?.destination?.ID, - destName: event?.destination?.Name, - metadata: event?.metadata, - }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const events = ctx.request.body; - if (!Array.isArray(events) || events.length === 0) { - throw new PlatformError('Event is missing or in inappropriate format'); - } - const reqParams = ctx.request.query; - logger.debug(`[DT] Input events: ${JSON.stringify(events)}`); - - const metaTags = - events && events.length > 0 && events[0].metadata ? getMetadata(events[0].metadata) : {}; - stats.histogram('dest_transform_input_events', events.length, { - destination, - version, - ...metaTags, - }); - const executeStartTime = new Date(); - let destHandler = null; - const respList = await Promise.all( - events.map(async (event) => { - try { - // look for traits under every object in file v0\util\data\GenericFieldMapping.json like - // "traits": ["traits", "context.traits"] - let parsedEvent = oncehubTransformer(destination,event); - parsedEvent.request = { query: reqParams }; - parsedEvent = processDynamicConfig(parsedEvent); - let respEvents; - if (destHandler === null) { - destHandler = getDestHandler(version, destination); - } - respEvents = await handleV0Destination(destHandler.process, [parsedEvent]); - - if (respEvents) { - if (!Array.isArray(respEvents)) { - respEvents = [respEvents]; - } - return respEvents.map((ev) => ({ - output: enrichTransformedEvent(ev), - metadata: destHandler?.processMetadata - ? destHandler.processMetadata({ - metadata: event.metadata, - inputEvent: parsedEvent, - outputEvent: ev, - }) - : event.metadata, - statusCode: 200, - })); - } - return undefined; - } catch (error) { - logger.error(error); - - const implementation = tags.IMPLEMENTATIONS.NATIVE; - const errCtx = 'Processor Transformation'; - - const errObj = generateErrorObject(error, { - [tags.TAG_NAMES.DEST_TYPE]: destination.toUpperCase(), - [tags.TAG_NAMES.MODULE]: tags.MODULES.DESTINATION, - [tags.TAG_NAMES.IMPLEMENTATION]: implementation, - [tags.TAG_NAMES.FEATURE]: tags.FEATURES.PROCESSOR, - [tags.TAG_NAMES.DESTINATION_ID]: event.metadata?.destinationId, - [tags.TAG_NAMES.WORKSPACE_ID]: event.metadata?.workspaceId, - }); - - const resp = { - metadata: event.metadata, - destination: event.destination, - statusCode: errObj.status, - error: errObj.message, - statTags: errObj.statTags, - }; - - errNotificationClient.notify(error, errCtx, { - ...resp, - ...getCommonMetadata(ctx), - ...getReqMetadata(event), - }); - return resp; - } - }), - ); - stats.timing('cdk_events_latency', executeStartTime, { - destination, - ...metaTags, - }); - logger.debug(`[DT] Output events: ${JSON.stringify(respList)}`); - stats.histogram('dest_transform_output_events', respList.length, { - destination, - version, - ...metaTags, - }); - ctx.body = respList.flat(); - return ctx.body; -} - -async function handleValidation(ctx) { - const requestStartTime = new Date(); - const events = ctx.request.body; - const requestSize = Number(ctx.request.get('content-length')); - const reqParams = ctx.request.query; - const respList = []; - const metaTags = events[0].metadata ? getMetadata(events[0].metadata) : {}; - let ctxStatusCode = 200; - // eslint-disable-next-line no-restricted-syntax - for (const event of events) { - const eventStartTime = new Date(); - try { - const parsedEvent = event; - parsedEvent.request = { query: reqParams }; - // eslint-disable-next-line no-await-in-loop - const hv = await eventValidator.handleValidation(parsedEvent); - sendViolationMetrics(hv.validationErrors, hv.dropEvent, metaTags); - if (hv.dropEvent) { - respList.push({ - output: event.message, - metadata: event.metadata, - statusCode: 400, - validationErrors: hv.validationErrors, - error: JSON.stringify(constructValidationErrors(hv.validationErrors)), - }); - stats.counter('hv_violation_type', 1, { - violationType: hv.violationType, - ...metaTags, - }); - } else { - respList.push({ - output: event.message, - metadata: event.metadata, - statusCode: 200, - validationErrors: hv.validationErrors, - error: JSON.stringify(constructValidationErrors(hv.validationErrors)), - }); - stats.counter('hv_propagated_events', 1, { - ...metaTags, - }); - } - } catch (error) { - const errMessage = `Error occurred while validating : ${error}`; - logger.error(errMessage); - let status = 200; - if (error instanceof RetryRequestError) { - ctxStatusCode = error.statusCode; - } - if (error instanceof RespStatusError) { - status = error.statusCode; - } - respList.push({ - output: event.message, - metadata: event.metadata, - statusCode: status, - validationErrors: [], - error: errMessage, - }); - stats.counter('hv_errors', 1, { - ...metaTags, - }); - } finally { - stats.timing('hv_event_latency', eventStartTime, { - ...metaTags, - }); - } - } - ctx.body = respList; - ctx.status = ctxStatusCode; - ctx.set('apiVersion', API_VERSION); - - stats.counter('hv_events_count', events.length, { - ...metaTags, - }); - stats.histogram('hv_request_size', requestSize, { - ...metaTags, - }); - stats.timing('hv_request_latency', requestStartTime, { - ...metaTags, - }); -} - -async function isValidRouterDest(event, destType) { - try { - const routerDestHandler = getDestHandler('v0', destType); - return routerDestHandler?.processRouterDest !== undefined; - } catch (error) { - return false; - } -} -/** - * @deprecated this function is deprecated and will be removed in future release - */ -async function routerHandleDest(ctx) { - const getReqMetadata = () => { - try { - return { - destType: ctx.request?.body?.destType, - }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const respEvents = []; - let destType; - let defTags; - try { - const { input } = ctx.request.body; - destType = ctx.request.body.destType; - defTags = { - [tags.TAG_NAMES.DEST_TYPE]: destType.toUpperCase(), - [tags.TAG_NAMES.MODULE]: tags.MODULES.DESTINATION, - [tags.TAG_NAMES.FEATURE]: tags.FEATURES.ROUTER, - [tags.TAG_NAMES.IMPLEMENTATION]: tags.IMPLEMENTATIONS.NATIVE, - }; - - const routerDestHandler = getDestHandler('v0', destType); - const isValidRTDest = await isValidRouterDest(input[0], destType); - if (!isValidRTDest) { - ctx.status = 404; - ctx.body = `${destType} doesn't support router transform`; - return null; - } - const allDestEvents = lodash.groupBy(input, (event) => event.destination.ID); - await Promise.all( - Object.values(allDestEvents).map(async (destInputArray) => { - const newDestInputArray = processDynamicConfig(destInputArray, 'router'); - const listOutput = await handleV0Destination(routerDestHandler.processRouterDest, [ - newDestInputArray, - { ...getCommonMetadata(ctx), ...getReqMetadata() }, - ]); - const hasProcMetadataForRouter = routerDestHandler.processMetadataForRouter; - // enriching transformed event - listOutput.forEach((listOut) => { - const { batchedRequest } = listOut; - if (Array.isArray(batchedRequest)) { - // eslint-disable-next-line no-param-reassign - listOut.batchedRequest = batchedRequest.map((batReq) => enrichTransformedEvent(batReq)); - } else if (batchedRequest && typeof batchedRequest === 'object') { - // eslint-disable-next-line no-param-reassign - listOut.batchedRequest = enrichTransformedEvent(batchedRequest); - } - - if (hasProcMetadataForRouter) { - // eslint-disable-next-line no-param-reassign - listOut.metadata = routerDestHandler.processMetadataForRouter(listOut); - } - }); - respEvents.push(...listOutput); - }), - ); - - // Add default stat tags - respEvents - .filter( - (resp) => - 'error' in resp && lodash.isObject(resp.statTags) && !lodash.isEmpty(resp.statTags), - ) - .forEach((resp) => { - // eslint-disable-next-line no-param-reassign - resp.statTags = { - ...resp.statTags, - ...defTags, - [tags.TAG_NAMES.DESTINATION_ID]: resp.metadata[0]?.destinationId, - [tags.TAG_NAMES.WORKSPACE_ID]: resp.metadata[0]?.workspaceId, - }; - }); - } catch (error) { - logger.error(error); - - const errObj = generateErrorObject(error, defTags); - - const resp = { - statusCode: errObj.status, - error: errObj.message, - statTags: errObj.statTags, - }; - - // Add support to perform refreshToken action for OAuth destinations - if (error?.authErrorCategory) { - resp.authErrorCategory = error.authErrorCategory; - } - - errNotificationClient.notify(error, 'Router Transformation', { - ...resp, - ...getCommonMetadata(ctx), - ...getReqMetadata(), - }); - - respEvents.push(resp); - } - ctx.body = { output: respEvents }; - return ctx.body; -} - -if (startDestTransformer) { - SUPPORTED_VERSIONS.forEach((version) => { - const destinations = getIntegrations(path.resolve(__dirname, `../${version}/destinations`)); - destinations.forEach((destination) => { - // eg. v0/destinations/ga - router.post(`/${version}/destinations/${destination}`, async (ctx) => { - const startTime = new Date(); - await handleDest(ctx, version, destination); - ctx.set('apiVersion', API_VERSION); - // Assuming that events are from one single source - - const metaTags = - ctx.request.body && ctx.request.body.length > 0 && ctx.request.body[0].metadata - ? getMetadata(ctx.request.body[0].metadata) - : {}; - - stats.timing('dest_transform_request_latency', startTime, { - destination, - version, - ...metaTags, - }); - stats.increment('dest_transform_requests', { - destination, - version, - ...metaTags, - }); - }); - // eg. v0/ga. will be deprecated in favor of v0/destinations/ga format - router.post(`/${version}/${destination}`, async (ctx) => { - const startTime = new Date(); - await handleDest(ctx, version, destination); - ctx.set('apiVersion', API_VERSION); - // Assuming that events are from one single source - - const metaTags = - ctx.request.body && ctx.request.body.length > 0 && ctx.request.body[0].metadata - ? getMetadata(ctx.request.body[0].metadata) - : {}; - - stats.timing('dest_transform_request_latency', startTime, { - destination, - ...metaTags, - }); - stats.increment('dest_transform_requests', { - destination, - version, - ...metaTags, - }); - }); - router.post('/routerTransform', async (ctx) => { - ctx.set('apiVersion', API_VERSION); - await routerHandleDest(ctx); - }); - }); - }); - - if (functionsEnabled()) { - router.post('/extractLibs', async (ctx) => { - try { - const { - code, - versionId, - validateImports = false, - additionalLibraries = [], - language = 'javascript', - testMode = false, - } = ctx.request.body; - - if (!code) { - throw new Error('Invalid request. Code is missing'); - } - - const obj = await extractLibraries( - code, - versionId, - validateImports, - additionalLibraries, - language, - testMode || versionId === 'testVersionId', - ); - ctx.body = obj; - } catch (err) { - ctx.status = 400; - ctx.body = { error: err.error || err.message }; - } - }); - - // eslint-disable-next-line sonarjs/cognitive-complexity - router.post('/customTransform', async (ctx) => { - const startTime = new Date(); - const events = ctx.request.body; - const { processSessions } = ctx.query; - logger.debug(`[CT] Input events: ${JSON.stringify(events)}`); - stats.histogram('user_transform_input_events', events.length, { - processSessions, - }); - let groupedEvents; - if (processSessions) { - groupedEvents = lodash.groupBy(events, (event) => { - // to have the backward-compatibility and being extra careful. We need to remove this (message.anonymousId) in next release. - const rudderId = event.metadata.rudderId || event.message.anonymousId; - return `${event.destination.ID}_${event.metadata.sourceId}_${rudderId}`; - }); - } else { - groupedEvents = lodash.groupBy( - events, - (event) => `${event.metadata.destinationId}_${event.metadata.sourceId}`, - ); - } - stats.counter('user_transform_function_group_size', Object.entries(groupedEvents).length, {}); - - let ctxStatusCode = 200; - const transformedEvents = []; - let librariesVersionIDs = []; - if (events[0].libraries) { - librariesVersionIDs = events[0].libraries.map((library) => library.VersionID); - } - await Promise.all( - Object.entries(groupedEvents).map(async ([dest, destEvents]) => { - logger.debug(`dest: ${dest}`); - const transformationVersionId = - destEvents[0] && - destEvents[0].destination && - destEvents[0].destination.Transformations && - destEvents[0].destination.Transformations[0] && - destEvents[0].destination.Transformations[0].VersionID; - const messageIds = destEvents.map((ev) => ev.metadata && ev.metadata.messageId); - const commonMetadata = { - sourceId: destEvents[0].metadata && destEvents[0].metadata.sourceId, - destinationId: destEvents[0].metadata && destEvents[0].metadata.destinationId, - destinationType: destEvents[0].metadata && destEvents[0].metadata.destinationType, - messageIds, - }; - - const metaTags = - destEvents.length > 0 && destEvents[0].metadata - ? getMetadata(destEvents[0].metadata) - : {}; - if (transformationVersionId) { - let destTransformedEvents; - try { - destTransformedEvents = await userTransformHandler()( - destEvents, - transformationVersionId, - librariesVersionIDs, - ); - transformedEvents.push( - ...destTransformedEvents.map((ev) => { - if (ev.error) { - return { - statusCode: 400, - error: ev.error, - metadata: lodash.isEmpty(ev.metadata) ? commonMetadata : ev.metadata, - }; - } - if (!isNonFuncObject(ev.transformedEvent)) { - return { - statusCode: 400, - error: `returned event in events from user transformation is not an object. transformationVersionId:${transformationVersionId} and returned event: ${JSON.stringify( - ev.transformedEvent, - )}`, - metadata: lodash.isEmpty(ev.metadata) ? commonMetadata : ev.metadata, - }; - } - return { - output: ev.transformedEvent, - metadata: lodash.isEmpty(ev.metadata) ? commonMetadata : ev.metadata, - statusCode: 200, - }; - }), - ); - } catch (error) { - logger.error(error); - let status = 400; - const errorString = error.toString(); - if (error instanceof RetryRequestError) { - ctxStatusCode = error.statusCode; - } - if (error instanceof RespStatusError) { - status = error.statusCode; - } - destTransformedEvents = destEvents.map((e) => ({ - statusCode: status, - metadata: e.metadata, - error: errorString, - })); - transformedEvents.push(...destTransformedEvents); - stats.counter('user_transform_errors', destEvents.length, { - transformationVersionId, - processSessions, - ...metaTags, - }); - } - } else { - const errorMessage = 'Transformation VersionID not found'; - logger.error(`[CT] ${errorMessage}`); - transformedEvents.push({ - statusCode: 400, - error: errorMessage, - metadata: commonMetadata, - }); - stats.counter('user_transform_errors', destEvents.length, { - transformationVersionId, - processSessions, - ...metaTags, - }); - } - }), - ); - logger.debug(`[CT] Output events: ${JSON.stringify(transformedEvents)}`); - ctx.body = transformedEvents; - ctx.status = ctxStatusCode; - ctx.set('apiVersion', API_VERSION); - - stats.timingSummary('user_transform_request_latency_summary', startTime, {}); - stats.increment('user_transform_requests', {}); - stats.histogram('user_transform_output_events', transformedEvents.length, {}); - }); - } -} - -if (transformerTestModeEnabled) { - router.post('/transformation/test', async (ctx) => { - try { - const { events, trRevCode, libraryVersionIDs = [] } = ctx.request.body; - if (!trRevCode || !trRevCode.code || !trRevCode.codeVersion) { - throw new Error('Invalid Request. Missing parameters in transformation code block'); - } - if (!events || events.length === 0) { - throw new Error('Invalid request. Missing events'); - } - - logger.debug(`[CT] Test Input Events: ${JSON.stringify(events)}`); - trRevCode.versionId = 'testVersionId'; - const res = await userTransformHandler()( - events, - trRevCode.versionId, - libraryVersionIDs, - trRevCode, - true, - ); - logger.debug(`[CT] Test Output Events: ${JSON.stringify(res.transformedEvents)}`); - ctx.body = res; - } catch (error) { - ctx.status = error.statusCode || 400; - ctx.body = { error: error.message }; - } - }); - - router.post('/transformationLibrary/test', async (ctx) => { - try { - const { code, language = 'javascript' } = ctx.request.body; - - if (!code) { - throw new Error('Invalid request. Missing code'); - } - - const res = await validateCode(code, language); - ctx.body = res; - } catch (error) { - ctx.body = { error: error.message }; - ctx.status = 400; - } - }); - /* *params - * code: transfromation code - * language - * name - */ - router.post('/transformation/sethandle', async (ctx) => { - try { - const { trRevCode, libraryVersionIDs = [] } = ctx.request.body; - const { code, versionId, language, testName } = trRevCode || {}; - if (!code || !language || !testName || (language === 'pythonfaas' && !versionId)) { - throw new Error('Invalid Request. Missing parameters in transformation code block'); - } - - logger.debug(`[CT] Setting up a transformation ${testName}`); - if (!trRevCode.versionId) { - trRevCode.versionId = 'testVersionId'; - } - if (!trRevCode.workspaceId) { - trRevCode.workspaceId = 'workspaceId'; - } - const res = await setupUserTransformHandler(libraryVersionIDs, trRevCode); - logger.debug(`[CT] Finished setting up transformation: ${testName}`); - ctx.body = res; - } catch (error) { - ctx.status = 400; - ctx.body = { error: error.message }; - } - }); -} - -async function handleSource(ctx, version, source) { - const getReqMetadata = () => { - try { - return { srcType: source }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const sourceHandler = getSourceHandler(version, source); - const events = ctx.request.body; - logger.debug(`[ST] Input source events: ${JSON.stringify(events)}`); - stats.counter('source_transform_input_events', events.length, { - source, - version, - }); - const respList = []; - await Promise.all( - events.map(async (event) => { - try { - const respEvents = await sourceHandler.process(event); - - // We send response back to the source - // through outputToSource. This is not sent to gateway - if (Object.prototype.hasOwnProperty.call(respEvents, 'outputToSource')) { - respList.push(respEvents); - return; - } - - if (Array.isArray(respEvents)) { - respList.push({ output: { batch: respEvents } }); - } else { - respList.push({ output: { batch: [respEvents] } }); - } - } catch (error) { - logger.error(error); - - // TODO: Update the data contact for source transformation - // and then send the following additional information - // const errObj = generateErrorObject(error, { - // [tags.TAG_NAMES.SRC_TYPE]: source.toUpperCase(), - // [tags.TAG_NAMES.MODULE]: tags.MODULES.SOURCE, - // [tags.TAG_NAMES.IMPLEMENTATION]: tags.IMPLEMENTATIONS.NATIVE, - // [tags.TAG_NAMES.FEATURE]: tags.FEATURES.PROCESSOR - // [tags.TAG_NAMES.SOURCE_ID]: TBD - // }); - - // const resp = { - // statusCode: errObj.status, - // error: errObj.message, - // statTags: errObj.statTags - // }; - - const resp = { - statusCode: 400, - error: error.message || PAYLOAD_PROC_ERR_MSG, - }; - - respList.push(resp); - - stats.counter('source_transform_errors', events.length, { - source, - version, - }); - errNotificationClient.notify(error, 'Source Transformation', { - ...resp, - ...getCommonMetadata(ctx), - ...getReqMetadata(), - }); - } - }), - ); - logger.debug(`[ST] Output source events: ${JSON.stringify(respList)}`); - stats.increment('source_transform_output_events', respList.length, { - source, - version, - }); - ctx.body = respList; - ctx.set('apiVersion', API_VERSION); -} - -if (startSourceTransformer) { - SUPPORTED_VERSIONS.forEach((version) => { - const sources = getIntegrations(path.resolve(__dirname, `../${version}/sources`)); - sources.forEach((source) => { - // eg. v0/sources/customerio - router.post(`/${version}/sources/${source}`, async (ctx) => { - const startTime = new Date(); - await handleSource(ctx, version, source); - - stats.timing('source_transform_request_latency', startTime, { - source, - version, - }); - stats.increment('source_transform_requests', { source, version }); - }); - }); - }); -} -/** - * @deprecated this function is deprecated and will be removed in future release - */ -async function handleProxyRequest(destination, ctx) { - const getReqMetadata = () => { - try { - return { destType: destination }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const { metadata, ...destinationRequest } = ctx.request.body; - const destNetworkHandler = networkHandlerFactory.getNetworkHandler(destination); - let response; - try { - stats.counter('tf_proxy_dest_req_count', 1, { - destination, - }); - const startTime = new Date(); - const rawProxyResponse = await destNetworkHandler.proxy(destinationRequest); - - stats.timing('transformer_proxy_time', startTime, { - destination, - }); - stats.counter('tf_proxy_dest_resp_count', 1, { - destination, - success: rawProxyResponse.success, - }); - - const processedProxyResponse = destNetworkHandler.processAxiosResponse(rawProxyResponse); - stats.counter('tf_proxy_proc_ax_response_count', 1, { - destination, - }); - response = destNetworkHandler.responseHandler( - { ...processedProxyResponse, rudderJobMetadata: metadata }, - destination, - ); - stats.counter('tf_proxy_resp_handler_count', 1, { - destination, - }); - } catch (err) { - logger.error('Error occurred while completing proxy request:'); - logger.error(err); - - const errObj = generateErrorObject( - err, - { - [tags.TAG_NAMES.DEST_TYPE]: destination.toUpperCase(), - [tags.TAG_NAMES.MODULE]: tags.MODULES.DESTINATION, - [tags.TAG_NAMES.IMPLEMENTATION]: tags.IMPLEMENTATIONS.NATIVE, - [tags.TAG_NAMES.FEATURE]: tags.FEATURES.DATA_DELIVERY, - [tags.TAG_NAMES.DESTINATION_ID]: metadata?.destinationId, - [tags.TAG_NAMES.WORKSPACE_ID]: metadata?.workspaceId, - }, - false, - ); - - response = { - status: errObj.status, - ...(errObj.authErrorCategory && { - authErrorCategory: errObj.authErrorCategory, - }), - destinationResponse: errObj.destinationResponse, - message: errObj.message, - statTags: errObj.statTags, - }; - - stats.counter('tf_proxy_err_count', 1, { - destination, - }); - - errNotificationClient.notify(err, 'Data Delivery', { - ...response, - ...getCommonMetadata(ctx), - ...getReqMetadata(), - }); - } - ctx.body = { output: response }; - // Sending `204` status(obtained from destination) is not working as expected - // Since this is success scenario, we'll be forcefully sending `200` status-code to server - ctx.status = getCompatibleStatusCode(response.status); - return ctx.body; -} - -if (transformerProxy) { - SUPPORTED_VERSIONS.forEach((version) => { - const destinations = getIntegrations(path.resolve(__dirname, `../${version}/destinations`)); - destinations.forEach((destination) => { - router.post(`/${version}/destinations/${destination}/proxy`, async (ctx) => { - const startTime = new Date(); - ctx.set('apiVersion', API_VERSION); - await handleProxyRequest(destination, ctx); - - stats.timing('transformer_total_proxy_latency', startTime, { - destination, - version, - }); - }); - }); - }); -} - -if (proxyTestModeEnabled) { - router.use(destProxyRoutes); -} - -router.get('/version', (ctx) => { - ctx.body = process.env.npm_package_version || 'Version Info not found'; -}); - -router.get('/transformerBuildVersion', (ctx) => { - ctx.body = process.env.transformer_build_version || 'Version Info not found'; -}); - -router.get('/health', (ctx) => { - const { git_commit_sha: gitCommitSha, transformer_build_version: imageVersion } = process.env; - ctx.body = { - service: 'UP', - ...(imageVersion && { version: imageVersion }), - ...(gitCommitSha && { gitCommitSha }), - }; -}); - -router.get('/features', (ctx) => { - const obj = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'features.json'), 'utf8')); - ctx.body = JSON.stringify(obj); -}); -/** - * @deprecated this function is deprecated and will be removed in future release - */ -const batchHandler = (ctx) => { - const getReqMetadata = (destEvents) => { - try { - const reqBody = ctx.request.body; - const firstEvent = destEvents[0]; - return { - destType: reqBody?.destType, - destinationId: firstEvent?.destination?.ID, - destName: firstEvent?.destination?.Name, - metadata: firstEvent?.metadata, - }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const { destType, input } = ctx.request.body; - const destHandler = getDestHandler('v0', destType); - if (!destHandler || !destHandler.batch) { - ctx.status = 404; - ctx.body = `${destType} doesn't support batching`; - return null; - } - const allDestEvents = lodash.groupBy(input, (event) => event.destination.ID); - - const response = { batchedRequests: [], errors: [] }; - Object.entries(allDestEvents).forEach(([, destEvents]) => { - try { - // eslint-disable-next-line no-param-reassign - destEvents = processDynamicConfig(destEvents, 'batch'); - const destBatchedRequests = destHandler.batch(destEvents); - response.batchedRequests.push(...destBatchedRequests); - } catch (error) { - const errorObj = generateErrorObject(error, { - [tags.TAG_NAMES.DEST_TYPE]: destType.toUpperCase(), - [tags.TAG_NAMES.MODULE]: tags.MODULES.DESTINATION, - [tags.TAG_NAMES.IMPLEMENTATION]: tags.IMPLEMENTATIONS.NATIVE, - [tags.TAG_NAMES.FEATURE]: tags.FEATURES.BATCH, - [tags.TAG_NAMES.DESTINATION_ID]: destEvents[0].metadata?.destinationId, - [tags.TAG_NAMES.WORKSPACE_ID]: destEvents[0].metadata?.workspaceId, - }); - const errResp = getErrorRespEvents( - destEvents.map((d) => d.metadata), - 500, // not using errorObj.status - errorObj.message, - errorObj.statTags, - ); - response.errors.push({ - ...errResp, - destination: destEvents[0].destination, - }); - errNotificationClient.notify(error, 'Batch Transformation', { - ...errResp, - ...getCommonMetadata(ctx), - ...getReqMetadata(destEvents), - }); - } - }); - if (response.errors.length > 0) { - ctx.status = 500; - ctx.body = response.errors; - return null; - } - ctx.body = response.batchedRequests; - return ctx.body; -}; -router.post('/batch', (ctx) => { - ctx.set('apiVersion', API_VERSION); - batchHandler(ctx); -}); - -/** - * @deprecated this function is deprecated and will be removed in future release - */ -const fileUpload = async (ctx) => { - const getReqMetadata = () => { - try { - const reqBody = ctx.request.body; - return { destType: reqBody?.destType }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const { destType } = ctx.request.body; - const destFileUploadHandler = getDestFileUploadHandler('v0', destType.toLowerCase()); - - if (!destFileUploadHandler || !destFileUploadHandler.processFileData) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - let response; - try { - response = await destFileUploadHandler.processFileData(ctx.request.body); - } catch (error) { - response = { - statusCode: error.response ? error.response.status : 400, - error: error.message || PAYLOAD_PROC_ERR_MSG, - metadata: error.response ? error.response.metadata : null, - }; - errNotificationClient.notify(error, 'File Upload', { - ...response, - ...getCommonMetadata(ctx), - ...getReqMetadata(), - }); - } - ctx.body = response; - return ctx.body; -}; - -const jobAndPollStatusReqMetadata = (ctx) => { - try { - const reqBody = ctx.request.body; - return { destType: reqBody?.destType, importId: reqBody?.importId }; - } catch (error) { - // Do nothing - } - return {}; -}; - -/** - * @deprecated this function is deprecated and will be removed in future release - */ -const pollStatus = async (ctx) => { - const { destType } = ctx.request.body; - const destFileUploadHandler = getPollStatusHandler('v0', destType.toLowerCase()); - let response; - if (!destFileUploadHandler || !destFileUploadHandler.processPolling) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - try { - response = await destFileUploadHandler.processPolling(ctx.request.body); - } catch (error) { - response = { - statusCode: error.response ? error.response.status : 400, - error: error.message || PAYLOAD_PROC_ERR_MSG, - }; - errNotificationClient.notify(error, 'Poll Status', { - ...response, - ...getCommonMetadata(ctx), - ...jobAndPollStatusReqMetadata(ctx), - }); - } - ctx.body = response; - return ctx.body; -}; - -/** - * @deprecated this function is deprecated and will be removed in future release - */ -const getJobStatus = async (ctx, type) => { - const { destType } = ctx.request.body; - const destFileUploadHandler = getJobStatusHandler('v0', destType.toLowerCase()); - - if (!destFileUploadHandler || !destFileUploadHandler.processJobStatus) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - let response; - try { - response = await destFileUploadHandler.processJobStatus(ctx.request.body, type); - } catch (error) { - response = { - statusCode: error.response ? error.response.status : 400, - error: error.message || PAYLOAD_PROC_ERR_MSG, - }; - errNotificationClient.notify(error, 'Job Status', { - ...response, - ...getCommonMetadata(ctx), - ...jobAndPollStatusReqMetadata(ctx), - }); - } - ctx.body = response; - return ctx.body; -}; - -/** - * @deprecated this function is deprecated and will be removed in future release - */ -const handleDeletionOfUsers = async (ctx) => { - const getReqMetadata = () => { - try { - const reqBody = ctx.request.body; - return { - destType: reqBody[0]?.destType, - jobs: reqBody.map((req) => req.jobId), - }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const getRudderDestInfo = () => { - try { - const rudderDestInfoHeader = ctx.get('x-rudder-dest-info'); - const destInfoHeader = JSON.parse(rudderDestInfoHeader); - if (!Array.isArray(destInfoHeader)) { - return destInfoHeader; - } - } catch (error) { - logger.error(`Error while getting rudderDestInfo header value: ${error}`); - } - return {}; - }; - - const { body } = ctx.request; - const respList = []; - const rudderDestInfo = getRudderDestInfo(); - let response; - await Promise.all( - body.map(async (reqBody) => { - const { destType } = reqBody; - const destUserDeletionHandler = getDeletionUserHandler('v0', destType.toLowerCase()); - if (!destUserDeletionHandler || !destUserDeletionHandler.processDeleteUsers) { - ctx.status = 404; - ctx.body = "Doesn't support deletion of users"; - return null; - } - - try { - response = await destUserDeletionHandler.processDeleteUsers({ - ...reqBody, - rudderDestInfo, - }); - if (response) { - respList.push(response); - } - } catch (error) { - const errObj = generateErrorObject( - error, - { - [tags.TAG_NAMES.DEST_TYPE]: destType.toUpperCase(), - [tags.TAG_NAMES.MODULE]: tags.MODULES.DESTINATION, - [tags.TAG_NAMES.IMPLEMENTATION]: tags.IMPLEMENTATIONS.NATIVE, - [tags.TAG_NAMES.FEATURE]: tags.FEATURES.USER_DELETION, - }, - false, - ); - - // adding the status to the request - ctx.status = errObj.status; - const resp = { - statusCode: errObj.status, - error: errObj.message, - ...(errObj.authErrorCategory && { - authErrorCategory: errObj.authErrorCategory, - }), - }; - - respList.push(resp); - logger.error(`Error Response List: ${JSON.stringify(respList, null, 2)}`); - - errNotificationClient.notify(error, 'User Deletion', { - ...resp, - ...getCommonMetadata(ctx), - ...getReqMetadata(), - }); - } - return undefined; - }), - ); - ctx.body = respList; - return ctx.body; - // const { destType } = ctx.request.body; -}; - -router.post('/fileUpload', async (ctx) => { - await fileUpload(ctx); -}); - -router.post('/pollStatus', async (ctx) => { - await pollStatus(ctx); -}); - -router.post('/getFailedJobs', async (ctx) => { - await getJobStatus(ctx, 'fail'); -}); - -router.post('/getWarningJobs', async (ctx) => { - await getJobStatus(ctx, 'warn'); -}); -// eg. v0/validate. will validate events as per respective tracking plans -router.post(`/v0/validate`, async (ctx) => { - await handleValidation(ctx); -}); - -// Api to handle deletion of users for data regulation -// { -// "destType": "dest name", -// "userAttributes": [ -// { -// "userId": "user_1" -// }, -// { -// "userId": "user_2" -// } -// ], -// "config": { -// "apiKey": "", -// "apiSecret": "" -// } -// } -router.post(`/deleteUsers`, async (ctx) => { - await handleDeletionOfUsers(ctx); -}); - -module.exports = { - router, - handleDest, - routerHandleDest, - batchHandler, - handleProxyRequest, - handleDeletionOfUsers, - fileUpload, - pollStatus, - getJobStatus, - handleV0Destination, - getDestHandler, -}; diff --git a/src/middleware.test.js b/src/middleware.test.js new file mode 100644 index 00000000000..397dedfbd07 --- /dev/null +++ b/src/middleware.test.js @@ -0,0 +1,107 @@ +const Koa = require('koa'); // Import Koa +const { + addStatMiddleware, + addRequestSizeMiddleware, + getHeapProfile, + getCPUProfile, + initPyroscope, +} = require('./middleware'); + +const Pyroscope = require('@pyroscope/nodejs'); +const stats = require('./util/stats'); +const { getDestTypeFromContext } = require('@rudderstack/integrations-lib'); + +// Mock dependencies +jest.mock('@pyroscope/nodejs'); +jest.mock('./util/stats', () => ({ + timing: jest.fn(), + histogram: jest.fn(), +})); +jest.mock('@rudderstack/integrations-lib', () => ({ + getDestTypeFromContext: jest.fn(), +})); + +describe('Pyroscope Initialization', () => { + it('should initialize Pyroscope with the correct app name', () => { + initPyroscope(); + expect(Pyroscope.init).toHaveBeenCalledWith({ appName: 'rudder-transformer' }); + expect(Pyroscope.startHeapCollecting).toHaveBeenCalled(); + }); +}); + +describe('getCPUProfile', () => { + it('should call Pyroscope.collectCpu with the specified seconds', () => { + const seconds = 5; + getCPUProfile(seconds); + expect(Pyroscope.collectCpu).toHaveBeenCalledWith(seconds); + }); +}); + +describe('getHeapProfile', () => { + it('should call Pyroscope.collectHeap', () => { + getHeapProfile(); + expect(Pyroscope.collectHeap).toHaveBeenCalled(); + }); +}); + +describe('durationMiddleware', () => { + it('should record the duration of the request', async () => { + // Mock getDestTypeFromContext to return a fixed value + getDestTypeFromContext.mockReturnValue('mock-destination-type'); + + const app = new Koa(); // Create a Koa app instance + addStatMiddleware(app); // Pass the app instance to the middleware + + const ctx = { + method: 'GET', + status: 200, + request: { url: '/test' }, + }; + const next = jest.fn().mockResolvedValue(null); + + // Simulate the middleware execution + await app.middleware[0](ctx, next); + + expect(stats.timing).toHaveBeenCalledWith('http_request_duration', expect.any(Date), { + method: 'GET', + code: 200, + route: '/test', + destType: 'mock-destination-type', // Mocked value + }); + }); +}); + +describe('requestSizeMiddleware', () => { + it('should record the size of the request and response', async () => { + const app = new Koa(); // Create a Koa app instance + addRequestSizeMiddleware(app); // Pass the app instance to the middleware + + const ctx = { + method: 'POST', + status: 200, + request: { + url: '/test', + body: { key: 'value' }, + }, + response: { + body: { success: true }, + }, + }; + const next = jest.fn().mockResolvedValue(null); + + // Simulate the middleware execution + await app.middleware[0](ctx, next); + + expect(stats.histogram).toHaveBeenCalledWith('http_request_size', expect.any(Number), { + method: 'POST', + code: 200, + route: '/test', + }); + + expect(stats.histogram).toHaveBeenCalledWith('http_response_size', expect.any(Number), { + method: 'POST', + code: 200, + route: '/test', + }); + }); +}); diff --git a/src/middlewares/stats.ts b/src/middlewares/stats.ts new file mode 100644 index 00000000000..6fe0cc1c2cd --- /dev/null +++ b/src/middlewares/stats.ts @@ -0,0 +1,15 @@ +import { Context, Next } from 'koa'; + +export class StatsMiddleware { + private static instanceID: string = process.env.INSTANCE_ID || 'default'; + + private static workerID: string = process.env.WORKER_ID || 'master'; + + public static async executionStats(ctx: Context, next: Next) { + const start = Date.now(); + await next(); + const ms = Date.now() - start; + ctx.set('X-Response-Time', `${ms}ms`); + ctx.set('X-Instance-ID', `${StatsMiddleware.instanceID}/${StatsMiddleware.workerID}`); + } +} diff --git a/src/routerUtils.js b/src/routerUtils.js index 081070d78ac..67b6e0d31c4 100644 --- a/src/routerUtils.js +++ b/src/routerUtils.js @@ -4,13 +4,7 @@ const logger = require('./logger'); const { proxyRequest } = require('./adapters/network'); const { nodeSysErrorToStatus } = require('./adapters/utils/networkUtils'); -let areFunctionsEnabled = -1; -const functionsEnabled = () => { - if (areFunctionsEnabled === -1) { - areFunctionsEnabled = process.env.ENABLE_FUNCTIONS === 'false' ? 0 : 1; - } - return areFunctionsEnabled === 1; -}; +const functionsEnabled = () => process.env.ENABLE_FUNCTIONS !== 'false'; const userTransformHandler = () => { if (functionsEnabled()) { diff --git a/src/routerUtils.test.js b/src/routerUtils.test.js new file mode 100644 index 00000000000..81c8ed49919 --- /dev/null +++ b/src/routerUtils.test.js @@ -0,0 +1,126 @@ +const { sendToDestination, userTransformHandler } = require('./routerUtils'); // Update the path accordingly + +const logger = require('./logger'); +const { proxyRequest } = require('./adapters/network'); +const { nodeSysErrorToStatus } = require('./adapters/utils/networkUtils'); + +// Mock dependencies +jest.mock('./logger'); +jest.mock('./adapters/network'); +jest.mock('./adapters/utils/networkUtils'); + +describe('sendToDestination', () => { + beforeEach(() => { + jest.clearAllMocks(); // Clear mocks before each test + }); + + it('should send a request to the destination and return a successful response', async () => { + // Mock proxyRequest to return a successful response + proxyRequest.mockResolvedValue({ + success: true, + response: { + headers: { 'content-type': 'application/json' }, + data: { message: 'Success' }, + status: 200, + }, + }); + + const destination = 'mock-destination'; + const payload = { key: 'value' }; + + const result = await sendToDestination(destination, payload); + + expect(logger.info).toHaveBeenCalledWith('Request recieved for destination', destination); + expect(proxyRequest).toHaveBeenCalledWith(payload); + expect(result).toEqual({ + headers: { 'content-type': 'application/json' }, + response: { message: 'Success' }, + status: 200, + }); + }); + + it('should handle network failure and return a parsed response', async () => { + // Mock proxyRequest to return a network failure + proxyRequest.mockResolvedValue({ + success: false, + response: { + code: 'ENOTFOUND', // Simulate a network error + }, + }); + + // Mock nodeSysErrorToStatus to return a specific error message and status + nodeSysErrorToStatus.mockReturnValue({ + message: 'Network error', + status: 500, + }); + + const destination = 'mock-destination'; + const payload = { key: 'value' }; + + const result = await sendToDestination(destination, payload); + + expect(logger.info).toHaveBeenCalledWith('Request recieved for destination', destination); + expect(proxyRequest).toHaveBeenCalledWith(payload); + expect(nodeSysErrorToStatus).toHaveBeenCalledWith('ENOTFOUND'); + expect(result).toEqual({ + headers: null, + networkFailure: true, + response: 'Network error', + status: 500, + }); + }); + + it('should handle axios error with response and return a parsed response', async () => { + // Mock proxyRequest to return an axios error with response + proxyRequest.mockResolvedValue({ + success: false, + response: { + response: { + headers: { 'content-type': 'application/json' }, + status: 400, + data: 'Bad Request', + }, + }, + }); + + const destination = 'mock-destination'; + const payload = { key: 'value' }; + + const result = await sendToDestination(destination, payload); + + expect(logger.info).toHaveBeenCalledWith('Request recieved for destination', destination); + expect(proxyRequest).toHaveBeenCalledWith(payload); + expect(result).toEqual({ + headers: { 'content-type': 'application/json' }, + status: 400, + response: 'Bad Request', + }); + }); +}); + +describe('userTransformHandler', () => { + beforeEach(() => { + jest.clearAllMocks(); // Clear mocks before each test + jest.resetModules(); // Reset modules to reset process.env + }); + + it('should return userTransformHandler when functions are enabled', () => { + // Mock process.env to enable functions + process.env.ENABLE_FUNCTIONS = 'true'; + + const mockUserTransformHandler = jest.fn(); + jest.mock('./util/customTransformer', () => ({ + userTransformHandler: mockUserTransformHandler, + })); + + const result = userTransformHandler(); + expect(result).toBe(mockUserTransformHandler); + }); + + it('should throw an error when functions are not enabled', () => { + // Mock process.env to disable functions + process.env.ENABLE_FUNCTIONS = 'false'; + + expect(() => userTransformHandler()).toThrow('Functions are not enabled'); + }); +}); diff --git a/src/routes/bulkUpload.ts b/src/routes/bulkUpload.ts deleted file mode 100644 index efbd81c34e0..00000000000 --- a/src/routes/bulkUpload.ts +++ /dev/null @@ -1,17 +0,0 @@ -import Router from '@koa/router'; -import { - fileUpload, - pollStatus, - getFailedJobStatus, - getWarnJobStatus, -} from '../controllers/bulkUpload'; - -const router = new Router(); - -router.post('/fileUpload', fileUpload); -router.post('/pollStatus', pollStatus); -router.post('/getFailedJobs', getFailedJobStatus); -router.post('/getWarningJobs', getWarnJobStatus); -const bulkUploadRoutes = router.routes(); - -export default bulkUploadRoutes; diff --git a/src/routes/index.ts b/src/routes/index.ts index d77584bea34..9bd40b8e680 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -5,7 +5,6 @@ import dotenv from 'dotenv'; import { koaSwagger } from 'koa2-swagger-ui'; import path from 'path'; import userTransformRoutes from './userTransform'; -import bulkUploadRoutes from './bulkUpload'; import proxyRoutes from './delivery'; import destinationRoutes from './destination'; import miscRoutes from './misc'; @@ -17,11 +16,7 @@ import { isNotEmpty } from '../v0/util'; dotenv.config(); -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const enableSwagger = process.env.ENABLE_SWAGGER === 'true'; - export function applicationRoutes(app: Koa) { - app.use(bulkUploadRoutes); app.use(proxyRoutes); app.use(destinationRoutes); app.use(miscRoutes); diff --git a/src/routes/userTransform.ts b/src/routes/userTransform.ts index fc61ab7b941..e2883bdc22f 100644 --- a/src/routes/userTransform.ts +++ b/src/routes/userTransform.ts @@ -1,7 +1,8 @@ import Router from '@koa/router'; -import { RouteActivationMiddleware } from '../middlewares/routeActivation'; -import { FeatureFlagMiddleware } from '../middlewares/featureFlag'; import { UserTransformController } from '../controllers/userTransform'; +import { FeatureFlagMiddleware } from '../middlewares/featureFlag'; +import { RouteActivationMiddleware } from '../middlewares/routeActivation'; +import { StatsMiddleware } from '../middlewares/stats'; const router = new Router(); @@ -15,6 +16,7 @@ router.post( '/customTransform', RouteActivationMiddleware.isUserTransformRouteActive, FeatureFlagMiddleware.handle, + StatsMiddleware.executionStats, UserTransformController.transform, ); router.post( diff --git a/src/services/comparator.ts b/src/services/comparator.ts index 1eb67cd5979..3f90d962e3f 100644 --- a/src/services/comparator.ts +++ b/src/services/comparator.ts @@ -61,8 +61,9 @@ export class ComparatorService implements DestinationService { return metaTO; } - private getTestThreshold(destination: Destination) { - return destination.DestinationDefinition?.Config?.camparisonTestThreshold || 0; + private getTestThreshold(destination: Destination): number { + const threshold = destination.DestinationDefinition.Config.camparisonTestThreshold; + return typeof threshold === 'number' ? threshold : 0; } private getComparisonLogs( diff --git a/src/services/destination/__tests__/nativeIntegration.test.ts b/src/services/destination/__tests__/nativeIntegration.test.ts index 3ec3222b9d6..326a170cd0b 100644 --- a/src/services/destination/__tests__/nativeIntegration.test.ts +++ b/src/services/destination/__tests__/nativeIntegration.test.ts @@ -16,7 +16,7 @@ describe('NativeIntegration Service', () => { const destType = '__rudder_test__'; const version = 'v0'; const requestMetadata = {}; - const event = { message: { a: 'b' } } as ProcessorTransformationRequest; + const event = { message: { a: 'b' } } as unknown as ProcessorTransformationRequest; const events: ProcessorTransformationRequest[] = [event, event]; const tevent = { version: 'v0', endpoint: 'http://abc' } as ProcessorTransformationOutput; @@ -58,7 +58,7 @@ describe('NativeIntegration Service', () => { const destType = '__rudder_test__'; const version = 'v0'; const requestMetadata = {}; - const event = { message: { a: 'b' } } as ProcessorTransformationRequest; + const event = { message: { a: 'b' } } as unknown as ProcessorTransformationRequest; const events: ProcessorTransformationRequest[] = [event, event]; FetchHandler.getDestHandler = jest.fn().mockImplementation((d, v) => { diff --git a/src/services/destination/__tests__/preTransformation.test.ts b/src/services/destination/__tests__/preTransformation.test.ts index c10bab78acb..5d6624b7f41 100644 --- a/src/services/destination/__tests__/preTransformation.test.ts +++ b/src/services/destination/__tests__/preTransformation.test.ts @@ -8,13 +8,13 @@ describe('PreTransformation Service', () => { ctx.request.query = { cycle: 'true', x: 'y' }; const events: ProcessorTransformationRequest[] = [ - { message: { a: 'b' } } as ProcessorTransformationRequest, + { message: { a: 'b' } } as unknown as ProcessorTransformationRequest, ]; const expected: ProcessorTransformationRequest[] = [ { message: { a: 'b' }, request: { query: { cycle: 'true', x: 'y' } }, - } as ProcessorTransformationRequest, + } as unknown as ProcessorTransformationRequest, ]; const resp = DestinationPreTransformationService.preProcess(events, ctx); diff --git a/src/services/destination/cdkV2Integration.ts b/src/services/destination/cdkV2Integration.ts index 0789a98c1e7..8175d167a69 100644 --- a/src/services/destination/cdkV2Integration.ts +++ b/src/services/destination/cdkV2Integration.ts @@ -61,8 +61,8 @@ export class CDKV2DestinationService implements DestinationService { events.map(async (event) => { const metaTo = this.getTags( destinationType, - event.metadata.destinationId, - event.metadata.workspaceId, + event.metadata?.destinationId, + event.metadata?.workspaceId, tags.FEATURES.PROCESSOR, ); metaTo.metadata = event.metadata; diff --git a/src/services/destination/nativeIntegration.ts b/src/services/destination/nativeIntegration.ts index 38ec934ff7a..c0b389bf565 100644 --- a/src/services/destination/nativeIntegration.ts +++ b/src/services/destination/nativeIntegration.ts @@ -151,8 +151,8 @@ export class NativeIntegrationDestinationService implements DestinationService { const response = groupedEvents.map((destEvents) => { const metaTO = this.getTags( destinationType, - destEvents[0].metadata.destinationId, - destEvents[0].metadata.workspaceId, + destEvents[0].metadata?.destinationId, + destEvents[0].metadata?.workspaceId, tags.FEATURES.BATCH, ); metaTO.metadatas = events.map((event) => event.metadata); diff --git a/src/services/misc.ts b/src/services/misc.ts index 334b54ba17b..897e8acc793 100644 --- a/src/services/misc.ts +++ b/src/services/misc.ts @@ -14,6 +14,9 @@ export class MiscService { } public static getSourceHandler(source: string, version: string) { + if (version === 'v2') { + return require(`../sources/${source}/transform`); + } return require(`../${version}/sources/${source}/transform`); } @@ -33,7 +36,7 @@ export class MiscService { }; } - public static getMetaTags(metadata: Metadata) { + public static getMetaTags(metadata?: Metadata) { if (!metadata) { return {}; } diff --git a/src/services/source/__tests__/nativeIntegration.test.ts b/src/services/source/__tests__/nativeIntegration.test.ts index 51bb37f5f13..d0decd20258 100644 --- a/src/services/source/__tests__/nativeIntegration.test.ts +++ b/src/services/source/__tests__/nativeIntegration.test.ts @@ -1,5 +1,8 @@ import { FetchHandler } from '../../../helpers/fetchHandlers'; -import { RudderMessage, SourceTransformationResponse } from '../../../types/index'; +import { + SourceTransformationResponse, + SourceTransformationSuccessResponse, +} from '../../../types/index'; import stats from '../../../util/stats'; import { NativeIntegrationSourceService } from '../nativeIntegration'; import { SourcePostTransformationService } from '../postTransformation'; @@ -21,8 +24,11 @@ describe('NativeIntegration Source Service', () => { const event = { message: { a: 'b' }, headers }; const events = [event, event]; - const tevent = { anonymousId: 'test', context: { headers } } as RudderMessage; - const tresp = { output: { batch: [tevent] }, statusCode: 200 } as SourceTransformationResponse; + const tevent = { anonymousId: 'test', context: { headers } }; + const tresp = { + output: { batch: [tevent] }, + statusCode: 200, + } as unknown as SourceTransformationSuccessResponse; const tresponse = [tresp, tresp]; diff --git a/src/services/source/__tests__/postTransformation.test.ts b/src/services/source/__tests__/postTransformation.test.ts index ea8b463bf92..1a30df21d68 100644 --- a/src/services/source/__tests__/postTransformation.test.ts +++ b/src/services/source/__tests__/postTransformation.test.ts @@ -28,12 +28,14 @@ describe('Source PostTransformation Service', () => { const event = { outputToSource: {}, output: { batch: [{ anonymousId: 'test' }] }, + statusCode: 200, } as SourceTransformationResponse; const postProcessedEvents = { outputToSource: {}, output: { batch: [{ anonymousId: 'test', context: { headers } }] }, - } as SourceTransformationResponse; + statusCode: 200, + } as unknown as SourceTransformationResponse; const result = SourcePostTransformationService.handleSuccessEventsSource(event, { headers }); diff --git a/src/services/source/nativeIntegration.ts b/src/services/source/nativeIntegration.ts index 078716df96c..7a4df6fc6d5 100644 --- a/src/services/source/nativeIntegration.ts +++ b/src/services/source/nativeIntegration.ts @@ -1,7 +1,9 @@ +import { JsonSchemaGenerator } from '@rudderstack/integrations-lib'; import { FetchHandler } from '../../helpers/fetchHandlers'; import { SourceService } from '../../interfaces/SourceService'; import { ErrorDetailer, + ErrorDetailerOptions, MetaTransferObject, RudderMessage, SourceInputConversionResult, @@ -13,15 +15,17 @@ import { FixMe } from '../../util/types'; import tags from '../../v0/util/tags'; import { SourcePostTransformationService } from './postTransformation'; import logger from '../../logger'; +import { getBodyFromV2SpecPayload } from '../../v0/util'; export class NativeIntegrationSourceService implements SourceService { - public getTags(): MetaTransferObject { + public getTags(extraErrorDetails: ErrorDetailerOptions = {}): MetaTransferObject { const metaTO = { errorDetails: { module: tags.MODULES.SOURCE, implementation: tags.IMPLEMENTATIONS.NATIVE, destinationId: 'Non determinable', workspaceId: 'Non determinable', + ...extraErrorDetails, } as ErrorDetailer, errorContext: '[Native Integration Service] Failure During Source Transform', } as MetaTransferObject; @@ -36,7 +40,7 @@ export class NativeIntegrationSourceService implements SourceService { _requestMetadata: NonNullable, ): Promise { const sourceHandler = FetchHandler.getSourceHandler(sourceType, version); - const metaTO = this.getTags(); + const metaTO = this.getTags({ srcType: sourceType }); const respList: SourceTransformationResponse[] = await Promise.all( sourceEvents.map(async (sourceEvent) => { try { @@ -57,16 +61,9 @@ export class NativeIntegrationSourceService implements SourceService { if (sourceEvent.output) { const newSourceEvent = sourceEvent.output; - const { headers } = newSourceEvent; - if (headers) { - delete newSourceEvent.headers; - } - const respEvents: RudderMessage | RudderMessage[] | SourceTransformationResponse = await sourceHandler.process(newSourceEvent); - return SourcePostTransformationService.handleSuccessEventsSource(respEvents, { - headers, - }); + return SourcePostTransformationService.handleSuccessEventsSource(respEvents, {}); } return SourcePostTransformationService.handleFailureEventsSource( new Error('Error post version converstion, converstion output is undefined'), @@ -80,6 +77,19 @@ export class NativeIntegrationSourceService implements SourceService { logger.debug(`Error during source Transform: ${error}`, { ...logger.getLogMetadata(metaTO.errorDetails), }); + // log the payload schema here + const duplicateSourceEvent: any = sourceEvent; + try { + duplicateSourceEvent.output.request.body = getBodyFromV2SpecPayload( + duplicateSourceEvent?.output, + ); + } catch (e) { + /* empty */ + } + logger.error( + `Sample Payload Schema for source ${sourceType} : ${JSON.stringify(JsonSchemaGenerator.generate(duplicateSourceEvent))}`, + ); + return SourcePostTransformationService.handleFailureEventsSource(error, metaTO); } }), diff --git a/src/services/source/postTransformation.ts b/src/services/source/postTransformation.ts index c62f0ed7138..962860fa925 100644 --- a/src/services/source/postTransformation.ts +++ b/src/services/source/postTransformation.ts @@ -1,4 +1,9 @@ -import { MetaTransferObject, RudderMessage, SourceTransformationResponse } from '../../types/index'; +import { + MetaTransferObject, + RudderMessage, + SourceTransformationResponse, + SourceTransformationSuccessResponse, +} from '../../types/index'; import { CommonUtils } from '../../util/common'; import { CatchErr } from '../../util/types'; import { generateErrorObject } from '../../v0/util'; @@ -26,12 +31,12 @@ export class SourcePostTransformationService { // We send response back to the source // through outputToSource. This is not sent to gateway // We will not return array for events not meant for gateway - let sourceTransformationResponse = events as SourceTransformationResponse; + let sourceTransformationResponse = events as SourceTransformationSuccessResponse; if (!Object.prototype.hasOwnProperty.call(events, 'outputToSource')) { const eventsBatch = CommonUtils.toArray(events); sourceTransformationResponse = { output: { batch: eventsBatch }, - } as SourceTransformationResponse; + } as SourceTransformationSuccessResponse; } if (sourceTransformationResponse.output) { diff --git a/src/services/userTransform.ts b/src/services/userTransform.ts index 2afad88c56a..345985d5179 100644 --- a/src/services/userTransform.ts +++ b/src/services/userTransform.ts @@ -38,7 +38,6 @@ export class UserTransformService { `${event.metadata.destinationId}_${event.metadata.sourceId}`, ); stats.counter('user_transform_function_group_size', Object.entries(groupedEvents).length, {}); - stats.histogram('user_transform_input_events', events.length, {}); const transformedEvents: FixMe[] = []; let librariesVersionIDs: FixMe[] = []; @@ -63,11 +62,12 @@ export class UserTransformService { const messageIdsInOutputSet = new Set(); + const workspaceId = eventsToProcess[0]?.metadata.workspaceId; const commonMetadata = { sourceId: eventsToProcess[0]?.metadata?.sourceId, destinationId: eventsToProcess[0]?.metadata.destinationId, destinationType: eventsToProcess[0]?.metadata.destinationType, - workspaceId: eventsToProcess[0]?.metadata.workspaceId, + workspaceId, transformationId: eventsToProcess[0]?.metadata.transformationId, messageIds, }; @@ -76,6 +76,7 @@ export class UserTransformService { eventsToProcess.length > 0 && eventsToProcess[0].metadata ? getMetadata(eventsToProcess[0].metadata) : {}; + const transformationTags = getTransformationMetadata(eventsToProcess[0]?.metadata); if (!transformationVersionId) { const errorMessage = 'Transformation VersionID not found'; @@ -87,6 +88,11 @@ export class UserTransformService { } as ProcessorTransformationResponse); return transformedEvents; } + stats.counter('user_transform_input_events', events.length, { workspaceId }); + logger.info('user_transform_input_events', { + inCount: events.length, + ...transformationTags, + }); const userFuncStartTime = new Date(); try { const destTransformedEvents: UserTransformationResponse[] = await userTransformHandler()( @@ -167,22 +173,28 @@ export class UserTransformService { stats.counter('user_transform_errors', eventsToProcess.length, { status, ...metaTags, - ...getTransformationMetadata(eventsToProcess[0]?.metadata), + ...transformationTags, }); } finally { stats.timingSummary('user_transform_request_latency_summary', userFuncStartTime, { ...metaTags, - ...getTransformationMetadata(eventsToProcess[0]?.metadata), + ...transformationTags, }); stats.summary('user_transform_batch_size_summary', requestSize, { ...metaTags, - ...getTransformationMetadata(eventsToProcess[0]?.metadata), + ...transformationTags, }); } stats.counter('user_transform_requests', 1, {}); - stats.histogram('user_transform_output_events', transformedEvents.length, {}); + stats.counter('user_transform_output_events', transformedEvents.length, { + workspaceId, + }); + logger.info('user_transform_output_events', { + outCount: transformedEvents.length, + ...transformationTags, + }); return transformedEvents; }), ); diff --git a/src/v0/sources/adjust/config.ts b/src/sources/adjust/config.ts similarity index 100% rename from src/v0/sources/adjust/config.ts rename to src/sources/adjust/config.ts diff --git a/src/sources/adjust/core.js b/src/sources/adjust/core.js new file mode 100644 index 00000000000..0aaa5459690 --- /dev/null +++ b/src/sources/adjust/core.js @@ -0,0 +1,38 @@ +const path = require('path'); +const fs = require('fs'); +const Message = require('../message'); +const { excludedFieldList } = require('./config'); +const { extractCustomFields, generateUUID } = require('../../v0/util'); +const { convertToISODate } = require('./utils'); + +// ref : https://help.adjust.com/en/article/global-callbacks#general-recommended-placeholders +// import mapping json using JSON.parse to preserve object key order +const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); + +const processPayload = (payload) => { + const message = new Message(`Adjust`); + + // event type is always track + const eventType = 'track'; + message.setEventType(eventType); + message.setPropertiesV2(payload, mapping); + let customProperties = {}; + + // to remove writeKey from custom properties we can add it to excludedFieldList + excludedFieldList.push('writeKey'); + + customProperties = extractCustomFields(payload, customProperties, 'root', excludedFieldList); + + message.properties = { ...message.properties, ...customProperties }; + + if (payload.created_at) { + const ts = convertToISODate(payload.created_at); + message.setProperty('originalTimestamp', ts); + message.setProperty('timestamp', ts); + } + // adjust 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(); + return message; +}; + +module.exports = { processPayload }; diff --git a/src/v0/sources/adjust/mapping.json b/src/sources/adjust/mapping.json similarity index 100% rename from src/v0/sources/adjust/mapping.json rename to src/sources/adjust/mapping.json diff --git a/src/sources/adjust/transform.js b/src/sources/adjust/transform.js new file mode 100644 index 00000000000..42dec5320a8 --- /dev/null +++ b/src/sources/adjust/transform.js @@ -0,0 +1,45 @@ +const { flattenQueryParams, TransformationError } = require('@rudderstack/integrations-lib'); +const { CommonUtils } = require('../../util/common'); +const logger = require('../../logger'); +const { processPayload } = require('./core'); + +/** + * Extracts and flattens query parameters from the webhook request + * @param {Object} inputRequest - The incoming webhook request object + * @returns {Object} Flattened query parameters + * @throws {TransformationError} If request or query_parameters are missing + */ +const getPayloadFromRequest = (inputRequest) => { + const { request } = inputRequest; + if (!request) { + throw new TransformationError('request field is missing from webhook V2 payload'); + } + + const { query_parameters: qParams } = request; + logger.debug(`[Adjust] Input event: query_params: ${JSON.stringify(qParams)}`); + if (!qParams || Object.keys(qParams).length === 0) { + throw new TransformationError('Query_parameters is missing'); + } + + return flattenQueryParams(qParams); +}; + +/** + * Processes incoming webhook requests from Adjust + * @param {Object|Array} requests - Single request object or array of webhook requests + * @returns {Array} Array of transformed payloads ready to be sent to rudder-server + * @description + * This function: + * - converts incoming payload to array + * - extracts params and constructs payload + * - sends it to processPayload for transformation + */ +const process = (requests) => { + const requestsArray = CommonUtils.toArray(requests); + return requestsArray.map((inputRequest) => { + const formattedPayload = getPayloadFromRequest(inputRequest); + return processPayload(formattedPayload); + }); +}; + +module.exports = { process }; diff --git a/src/v0/sources/adjust/utils.js b/src/sources/adjust/utils.js similarity index 70% rename from src/v0/sources/adjust/utils.js rename to src/sources/adjust/utils.js index 73ec696e342..9b85ea24009 100644 --- a/src/v0/sources/adjust/utils.js +++ b/src/sources/adjust/utils.js @@ -1,5 +1,11 @@ const { TransformationError } = require('@rudderstack/integrations-lib'); +/** + * Converts a raw timestamp to ISO 8601 date string format + * @param {number|string} rawTimestamp - The timestamp to convert (expects Unix timestamp in seconds) + * @returns {string} The timestamp converted to ISO 8601 format + * @throws {TransformationError} If the timestamp is invalid or cannot be parsed + */ const convertToISODate = (rawTimestamp) => { if (typeof rawTimestamp !== 'number' && typeof rawTimestamp !== 'string') { throw new TransformationError( diff --git a/src/sources/adjust/utils.test.js b/src/sources/adjust/utils.test.js new file mode 100644 index 00000000000..cc1ab6e2606 --- /dev/null +++ b/src/sources/adjust/utils.test.js @@ -0,0 +1,66 @@ +const { convertToISODate } = require('./utils'); +const { TransformationError } = require('@rudderstack/integrations-lib'); + +describe('convertToISODate', () => { + const testCases = [ + { + name: 'valid numeric timestamp', + input: 1633072800, + expected: '2021-10-01T07:20:00.000Z', + shouldThrow: false, + }, + { + name: 'non-numeric string', + input: 'invalid', + shouldThrow: true, + errorType: TransformationError, + }, + { + name: 'valid numeric string timestamp', + input: '1633072800', + expected: '2021-10-01T07:20:00.000Z', + shouldThrow: false, + }, + { + name: 'object input', + input: {}, + shouldThrow: true, + errorType: TransformationError, + }, + { + name: 'array input', + input: [], + shouldThrow: true, + errorType: TransformationError, + }, + { + name: 'null input', + input: null, + shouldThrow: true, + errorType: TransformationError, + }, + { + name: 'undefined input', + input: undefined, + shouldThrow: true, + errorType: TransformationError, + }, + { + name: 'huge timestamp that becomes invalid', + input: 999999999999999, + shouldThrow: true, + errorType: TransformationError, + }, + ]; + + testCases.forEach(({ name, input, expected, shouldThrow, errorType }) => { + it(`should handle ${name}`, () => { + if (shouldThrow) { + expect(() => convertToISODate(input)).toThrow(errorType); + } else { + const result = convertToISODate(input); + expect(result).toBe(expected); + } + }); + }); +}); diff --git a/src/v0/sources/appcenter/mapping.json b/src/sources/appcenter/mapping.json similarity index 100% rename from src/v0/sources/appcenter/mapping.json rename to src/sources/appcenter/mapping.json diff --git a/src/v0/sources/appcenter/transform.js b/src/sources/appcenter/transform.js similarity index 88% rename from src/v0/sources/appcenter/transform.js rename to src/sources/appcenter/transform.js index 35d15f697e3..d885abb7ef6 100644 --- a/src/v0/sources/appcenter/transform.js +++ b/src/sources/appcenter/transform.js @@ -1,14 +1,12 @@ const path = require('path'); const fs = require('fs'); const { TransformationError } = require('@rudderstack/integrations-lib'); -const utils = require('../../util'); +const utils = require('../../v0/util'); const Message = require('../message'); const mappingJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); -const { removeUndefinedAndNullValues } = require('../../util'); - -const { JSON_MIME_TYPE } = require('../../util/constant'); +const { JSON_MIME_TYPE } = require('../../v0/util/constant'); const processNormalEvent = (event) => { const message = new Message(`APPCENTER`); @@ -56,11 +54,12 @@ const processTestEvent = (event) => ({ statusCode: 200, }); -const process = (event) => { +const process = (payload) => { + const event = utils.getBodyFromV2SpecPayload(payload); const response = isTestEvent(event) ? processTestEvent(event) : processNormalEvent(event); // to bypass the unit testcases ( we may change this) // response.anonymousId = "7e32188a4dab669f"; - return removeUndefinedAndNullValues(response); + return utils.removeUndefinedAndNullValues(response); }; exports.process = process; diff --git a/src/v0/sources/appsflyer/mapping.json b/src/sources/appsflyer/mapping.json similarity index 100% rename from src/v0/sources/appsflyer/mapping.json rename to src/sources/appsflyer/mapping.json diff --git a/src/sources/appsflyer/transform.js b/src/sources/appsflyer/transform.js new file mode 100644 index 00000000000..07e60f136e3 --- /dev/null +++ b/src/sources/appsflyer/transform.js @@ -0,0 +1,80 @@ +const path = require('path'); +const fs = require('fs'); +const { TransformationError } = require('@rudderstack/integrations-lib'); +const Message = require('../message'); +const { + generateUUID, + getBodyFromV2SpecPayload, + removeUndefinedAndNullValues, + isObject, +} = require('../../v0/util'); +const { getAdvertisingId } = require('./utils'); + +const mappingJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); + +const TRACK_MESSAGE_TYPE = 'track'; + +function createBaseMessage(eventName) { + const message = new Message(`AF`); + message.setEventType(TRACK_MESSAGE_TYPE); + message.setEventName(eventName); + return message; +} + +function processEvent(event) { + if (!event.event_name) { + throw new TransformationError('Unknwon event type from Appsflyer'); + } + + const message = createBaseMessage(event.event_name); + + const properties = { ...event }; + message.setProperty('properties', properties); + + // set fields in payload from mapping json + message.setProperties(event, mappingJson); + + const mappedPropertiesKeys = Object.keys(mappingJson); + + if (!isObject(message.context.device)) { + message.context.device = {}; + } + + if (event.platform) { + const advertisingId = getAdvertisingId(event); + if (advertisingId) { + message.context.device.advertisingId = advertisingId; + message.context.device.adTrackingEnabled = true; + } + mappedPropertiesKeys.push('idfa', 'android_id'); + } + + if (event.appsflyer_id) { + message.context.externalId = [ + { + type: 'appsflyerExternalId', + value: event.appsflyer_id, + }, + ]; + mappedPropertiesKeys.push('appsflyer_id'); + } + message.setProperty('anonymousId', generateUUID()); + + // Remove the fields from properties that are already mapped to other fields. + mappedPropertiesKeys.forEach((key) => { + if (message.properties && message.properties[key] !== undefined) { + delete message.properties[key]; + } + }); + + return message; +} + +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); + const response = processEvent(event); + const returnValue = removeUndefinedAndNullValues(response); + return returnValue; +} + +exports.process = process; diff --git a/src/sources/appsflyer/utils.js b/src/sources/appsflyer/utils.js new file mode 100644 index 00000000000..dc02833f67a --- /dev/null +++ b/src/sources/appsflyer/utils.js @@ -0,0 +1,13 @@ +const { isAppleFamily, isAndroidFamily } = require('../../v0/util'); + +function getAdvertisingId(event) { + if (isAppleFamily(event.platform)) { + return event.idfa; + } + if (isAndroidFamily(event.platform)) { + return event.android_id; + } + return null; +} + +module.exports = { getAdvertisingId }; diff --git a/src/sources/appsflyer/utils.test.js b/src/sources/appsflyer/utils.test.js new file mode 100644 index 00000000000..845854cf001 --- /dev/null +++ b/src/sources/appsflyer/utils.test.js @@ -0,0 +1,56 @@ +const { getAdvertisingId } = require('./utils'); + +describe('getAdvertisingId', () => { + const testCases = [ + { + name: 'should return idfa for iOS device', + event: { + platform: 'iOS', + idfa: 'ios-advertising-id-123', + android_id: 'not-this-one', + }, + expected: 'ios-advertising-id-123', + }, + { + name: 'should return idfa for iPadOS device', + event: { + platform: 'iPadOS', + idfa: 'ipad-advertising-id-456', + android_id: 'not-this-one', + }, + expected: 'ipad-advertising-id-456', + }, + { + name: 'should return android_id for Android device', + event: { + platform: 'Android', + idfa: 'not-this-one', + android_id: 'android-advertising-id-789', + }, + expected: 'android-advertising-id-789', + }, + { + name: 'should return null for unknown platform', + event: { + platform: 'Windows', + idfa: 'some-id', + android_id: 'some-other-id', + }, + expected: null, + }, + { + name: 'should return null when platform is missing', + event: { + idfa: 'some-id', + android_id: 'some-other-id', + }, + expected: null, + }, + ]; + + testCases.forEach(({ name, event, expected }) => { + it(name, () => { + expect(getAdvertisingId(event)).toBe(expected); + }); + }); +}); diff --git a/src/v0/sources/auth0/eventMapping.json b/src/sources/auth0/eventMapping.json similarity index 100% rename from src/v0/sources/auth0/eventMapping.json rename to src/sources/auth0/eventMapping.json diff --git a/src/v0/sources/auth0/mapping.json b/src/sources/auth0/mapping.json similarity index 100% rename from src/v0/sources/auth0/mapping.json rename to src/sources/auth0/mapping.json diff --git a/src/v0/sources/auth0/transform.js b/src/sources/auth0/transform.js similarity index 87% rename from src/v0/sources/auth0/transform.js rename to src/sources/auth0/transform.js index 5a1bf42e28a..22920cb6256 100644 --- a/src/v0/sources/auth0/transform.js +++ b/src/sources/auth0/transform.js @@ -1,11 +1,11 @@ const path = require('path'); const fs = require('fs'); -const { removeUndefinedAndNullValues } = require('../../util'); +const { removeUndefinedAndNullValues, getBodyFromV2SpecPayload } = require('../../v0/util'); const { getGroupId } = require('./util'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); const Message = require('../message'); -const { generateUUID } = require('../../util'); +const { generateUUID } = require('../../v0/util'); // Ref: https://auth0.com/docs/logs/references/log-event-type-codes const eventNameMap = JSON.parse( @@ -45,7 +45,7 @@ function processEvents(eventList) { // eslint-disable-next-line @typescript-eslint/naming-convention const { data, log_id } = event; // Dropping the event if type is not present - if (data && data.type) { + if (data?.type) { const eventType = data.type; // ss -> successful signup if (eventType === 'ss') { @@ -69,10 +69,11 @@ function processEvents(eventList) { return responses; } -function process(events) { - let eventList = events; - if (!Array.isArray(events)) { - eventList = events.logs || [events]; +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); + let eventList = event; + if (!Array.isArray(event)) { + eventList = event.logs || [event]; } return processEvents(eventList); } diff --git a/src/v0/sources/auth0/util.js b/src/sources/auth0/util.js similarity index 100% rename from src/v0/sources/auth0/util.js rename to src/sources/auth0/util.js diff --git a/src/v1/sources/braze/ignore.json b/src/sources/braze/ignore.json similarity index 100% rename from src/v1/sources/braze/ignore.json rename to src/sources/braze/ignore.json diff --git a/src/v1/sources/braze/mapping.json b/src/sources/braze/mapping.json similarity index 100% rename from src/v1/sources/braze/mapping.json rename to src/sources/braze/mapping.json diff --git a/src/v1/sources/braze/transform.js b/src/sources/braze/transform.js similarity index 87% rename from src/v1/sources/braze/transform.js rename to src/sources/braze/transform.js index 771c5887b33..5d19e26fb3c 100644 --- a/src/v1/sources/braze/transform.js +++ b/src/sources/braze/transform.js @@ -7,8 +7,9 @@ const { formatTimeStamp, removeUndefinedAndNullValues, getHashFromArray, -} = require('../../../v0/util'); -const Message = require('../../../v0/sources/message'); + getBodyFromV2SpecPayload, +} = require('../../v0/util'); +const Message = require('../message'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); @@ -66,14 +67,18 @@ const processEvent = (event, eventMapping) => { throw new TransformationError('Unknown event type from Braze'); }; -const process = (inputEvent) => { - const { event, source } = inputEvent; +const process = (payload) => { + const event = getBodyFromV2SpecPayload(payload); + const { source } = payload; const { customMapping } = source.Config; const eventMapping = getHashFromArray(customMapping, 'from', 'to', false); const responses = []; // Ref: Custom Currents Connector Partner Dev Documentation.pdf - const eventList = Array.isArray(event) && event.length > 0 ? event[0].events : event.events; + const eventList = Array.isArray(event) && event.length > 0 ? event[0]?.events : event?.events; + if (!Array.isArray(eventList)) { + throw new TransformationError('eventList should be an array'); + } eventList.forEach((singleEvent) => { try { const resp = processEvent(singleEvent, eventMapping); @@ -81,7 +86,7 @@ const process = (inputEvent) => { responses.push(removeUndefinedAndNullValues(resp)); } } catch (error) { - // TODO: figure out a way to handle partial failures within batch + // Figure out a way to handle partial failures within batch // responses.push({ // statusCode: 400, // error: error.message || "Unknwon error" diff --git a/src/v0/sources/canny/authorMapping.json b/src/sources/canny/authorMapping.json similarity index 100% rename from src/v0/sources/canny/authorMapping.json rename to src/sources/canny/authorMapping.json diff --git a/src/v0/sources/canny/transform.js b/src/sources/canny/transform.js similarity index 92% rename from src/v0/sources/canny/transform.js rename to src/sources/canny/transform.js index aad5a881c18..634bbf269e7 100644 --- a/src/v0/sources/canny/transform.js +++ b/src/sources/canny/transform.js @@ -2,7 +2,8 @@ const sha256 = require('sha256'); const { TransformationError } = require('@rudderstack/integrations-lib'); const Message = require('../message'); const { voterMapping, authorMapping, checkForRequiredFields } = require('./util'); -const logger = require('../../../logger'); +const logger = require('../../logger'); +const { getBodyFromV2SpecPayload } = require('../../v0/util'); const CannyOperation = { VOTE_CREATED: 'vote.created', @@ -73,7 +74,8 @@ function createMessage(event, typeOfUser) { return finalMessage; } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); let typeOfUser; switch (event.type) { diff --git a/src/v0/sources/canny/util.js b/src/sources/canny/util.js similarity index 100% rename from src/v0/sources/canny/util.js rename to src/sources/canny/util.js diff --git a/src/v0/sources/canny/voterMapping.json b/src/sources/canny/voterMapping.json similarity index 100% rename from src/v0/sources/canny/voterMapping.json rename to src/sources/canny/voterMapping.json diff --git a/src/v1/sources/close_crm/config.js b/src/sources/close_crm/config.js similarity index 100% rename from src/v1/sources/close_crm/config.js rename to src/sources/close_crm/config.js diff --git a/src/v1/sources/close_crm/transform.js b/src/sources/close_crm/transform.js similarity index 88% rename from src/v1/sources/close_crm/transform.js rename to src/sources/close_crm/transform.js index b597285e62a..f16edbb8896 100644 --- a/src/v1/sources/close_crm/transform.js +++ b/src/sources/close_crm/transform.js @@ -4,9 +4,10 @@ const { removeUndefinedAndNullRecurse, generateUUID, formatTimeStamp, -} = require('../../../v0/util'); + getBodyFromV2SpecPayload, +} = require('../../v0/util'); const { excludedFieldList } = require('./config'); -const Message = require('../../../v0/sources/message'); +const Message = require('../message'); function processEvent(inputEvent) { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -48,8 +49,8 @@ function processEvent(inputEvent) { return message; } -function process(inputEvent) { - const { event } = inputEvent; +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = processEvent(event); return removeUndefinedAndNullValues(response); } diff --git a/src/v1/sources/cordial/config.js b/src/sources/cordial/config.js similarity index 100% rename from src/v1/sources/cordial/config.js rename to src/sources/cordial/config.js diff --git a/src/v1/sources/cordial/mapping.json b/src/sources/cordial/mapping.json similarity index 100% rename from src/v1/sources/cordial/mapping.json rename to src/sources/cordial/mapping.json diff --git a/src/v1/sources/cordial/transform.js b/src/sources/cordial/transform.js similarity index 82% rename from src/v1/sources/cordial/transform.js rename to src/sources/cordial/transform.js index 5548efee70b..ababd67d296 100644 --- a/src/v1/sources/cordial/transform.js +++ b/src/sources/cordial/transform.js @@ -1,6 +1,6 @@ -const Message = require('../../../v0/sources/message'); -const { CommonUtils } = require('../../../util/common'); -const { generateUUID, isDefinedAndNotNull } = require('../../../v0/util'); +const Message = require('../message'); +const { CommonUtils } = require('../../util/common'); +const { generateUUID, isDefinedAndNotNull, getBodyFromV2SpecPayload } = require('../../v0/util'); const { eventsMapping } = require('./config'); const mapping = require('./mapping.json'); @@ -43,8 +43,8 @@ const processEvent = (inputPaylaod) => { }; const process = (inputEvent) => { - const { event: events } = inputEvent; - const eventsArray = CommonUtils.toArray(events); + const event = getBodyFromV2SpecPayload(inputEvent); + const eventsArray = CommonUtils.toArray(event); return eventsArray.map(processEvent); }; diff --git a/src/v0/sources/customerio/config.js b/src/sources/customerio/config.js similarity index 100% rename from src/v0/sources/customerio/config.js rename to src/sources/customerio/config.js diff --git a/src/v0/sources/customerio/mapping.json b/src/sources/customerio/mapping.json similarity index 100% rename from src/v0/sources/customerio/mapping.json rename to src/sources/customerio/mapping.json diff --git a/src/v0/sources/customerio/transform.js b/src/sources/customerio/transform.js similarity index 81% rename from src/v0/sources/customerio/transform.js rename to src/sources/customerio/transform.js index a2e69388b94..84e8491f41f 100644 --- a/src/v0/sources/customerio/transform.js +++ b/src/sources/customerio/transform.js @@ -7,9 +7,10 @@ const { get } = require('lodash'); const Message = require('../message'); const { mappingConfig } = require('./config'); -const { isDefinedAndNotNull } = require('../../util'); +const { isDefinedAndNotNull, getBodyFromV2SpecPayload } = require('../../v0/util'); -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const message = new Message(`Customer.io`); // since customer, email, sms, push, slack, webhook @@ -20,7 +21,6 @@ function process(event) { const eventObjectType = event.object_type?.toLowerCase() || ''; let eventName = get(mappingConfig, `${eventObjectType}.${event.metric}`); if (!eventName) { - // throw new TransformationError("Metric not supported"); eventName = 'Unknown Event'; } message.setEventName(eventName); @@ -35,12 +35,7 @@ function process(event) { } // when customer.io does not pass an associated userId, set the email address as anonymousId - if ( - (message.userId === null || message.userId === undefined) && - message.context && - message.context.traits && - message.context.traits.email - ) { + if ((message.userId === null || message.userId === undefined) && message.context?.traits?.email) { message.anonymousId = message.context.traits.email; } diff --git a/src/v0/sources/extole/mapping.json b/src/sources/extole/mapping.json similarity index 100% rename from src/v0/sources/extole/mapping.json rename to src/sources/extole/mapping.json diff --git a/src/v0/sources/extole/transform.js b/src/sources/extole/transform.js similarity index 80% rename from src/v0/sources/extole/transform.js rename to src/sources/extole/transform.js index a5fa99adcea..022762aa0eb 100644 --- a/src/v0/sources/extole/transform.js +++ b/src/sources/extole/transform.js @@ -1,9 +1,9 @@ /* eslint-disable no-case-declarations */ const path = require('path'); const fs = require('fs'); -const { generateUUID } = require('../../util'); +const { generateUUID, getBodyFromV2SpecPayload } = require('../../v0/util'); const Message = require('../message'); -const { removeUndefinedAndNullValues, extractCustomFields } = require('../../util'); +const { removeUndefinedAndNullValues, extractCustomFields } = require('../../v0/util'); const mappingJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); @@ -21,8 +21,7 @@ function processEvent(event) { break; default: message.setEventName(event.type); - let messageProperties = {}; - messageProperties = extractCustomFields(event, messageProperties, 'root', ['type']); + const messageProperties = extractCustomFields(event, {}, 'root', ['type']); message.setProperty('properties', messageProperties); } @@ -31,7 +30,8 @@ function processEvent(event) { return message; } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = processEvent(event); const returnValue = removeUndefinedAndNullValues(response); return returnValue; diff --git a/src/sources/facebook_lead_ads/mapping.json b/src/sources/facebook_lead_ads/mapping.json new file mode 100644 index 00000000000..fabd79e3759 --- /dev/null +++ b/src/sources/facebook_lead_ads/mapping.json @@ -0,0 +1,66 @@ +[ + { + "sourceKeys": ["id", "facebook_lead_id"], + "destKeys": "userId" + }, + { + "sourceKeys": "full_name", + "destKeys": "context.traits.name" + }, + { + "sourceKeys": "first_name", + "destKeys": "context.traits.firstName" + }, + { + "sourceKeys": "last_name", + "destKeys": "context.traits.lastName" + }, + { + "sourceKeys": "date_of_birth", + "destKeys": "context.traits.birthday" + }, + { + "sourceKeys": "phone_number", + "destKeys": "context.traits.phone" + }, + { + "sourceKeys": "email", + "destKeys": "context.traits.email" + }, + { + "sourceKeys": "gender", + "destKeys": "context.traits.gender" + }, + { + "sourceKeys": "zip_code", + "destKeys": "context.traits.address.zipCode" + }, + { + "sourceKeys": "post_code", + "destKeys": "context.traits.address.postalCode" + }, + { + "sourceKeys": "state", + "destKeys": "context.traits.address.state" + }, + { + "sourceKeys": "city", + "destKeys": "context.traits.address.city" + }, + { + "sourceKeys": "country", + "destKeys": "context.traits.address.country" + }, + { + "sourceKeys": "province", + "destKeys": "context.traits.address.province" + }, + { + "sourceKeys": "street_address", + "destKeys": "context.traits.address.street" + }, + { + "sourceKeys": "company_name", + "destKeys": "context.traits.company.name" + } +] diff --git a/src/sources/facebook_lead_ads/transform.ts b/src/sources/facebook_lead_ads/transform.ts new file mode 100644 index 00000000000..c1cd5695cb9 --- /dev/null +++ b/src/sources/facebook_lead_ads/transform.ts @@ -0,0 +1,54 @@ +import { flattenQueryParams, TransformationError } from '@rudderstack/integrations-lib'; +import get from 'get-value'; +import Message = require('../message'); +import { EventType } from '../../constants'; +import { InputEventType, OutputEventType } from './type'; +import { SourceInputV2 } from '../../types'; +import { generateUUID } from '../../v0/util'; + +const { removeUndefinedAndNullValues, getBodyFromV2SpecPayload } = require('../../v0/util'); + +const mapping = require('./mapping.json'); + +function processEvent(inputEvent: InputEventType): any { + const unwrappedInputEvent = flattenQueryParams(inputEvent); + + if (Object.keys(unwrappedInputEvent).length === 0) { + throw new TransformationError('input event must have at least one field'); + } + + const message = new Message(`FacebookLeadAds`); + + // set event type identify + message.setEventType(EventType.IDENTIFY); + + // setting traits based on mapping + message.setPropertiesV2(unwrappedInputEvent, mapping); + + // set and transform originalTimestamp to ISO 8601 from mm/dd/yyyy hh:mm + if (unwrappedInputEvent.created_time) { + const date: Date = new Date(`${unwrappedInputEvent.created_time} UTC`); + if (!Number.isNaN(date.getTime())) { + message.setProperty('originalTimestamp', date.toISOString()); + } + } + + // set anonymous id if userId unavailable + if (!get(message, 'userId')) { + message.setProperty('anonymousId', generateUUID()); + } + + // add everything as it is in context.traits + if (!message.context.traits) message.context.traits = {}; + Object.assign(message.context.traits, unwrappedInputEvent); + + return message; +} + +const process = (payload: SourceInputV2) => { + const event = getBodyFromV2SpecPayload(payload); + const response: OutputEventType = processEvent(event); + return removeUndefinedAndNullValues(response); +}; + +export { process }; diff --git a/src/sources/facebook_lead_ads/type.ts b/src/sources/facebook_lead_ads/type.ts new file mode 100644 index 00000000000..05a3d9448da --- /dev/null +++ b/src/sources/facebook_lead_ads/type.ts @@ -0,0 +1,18 @@ +export type InputEventType = Record; + +export type OutputEventType = { + userId?: string; + anonymousId?: string; + type: 'identify'; + context: { + traits: Record; + library: { + name: string; + version: string; + }; + integration: { + name: string; + }; + }; + originalTimestamp?: Date; +}; diff --git a/src/v0/sources/formsort/mapping.json b/src/sources/formsort/mapping.json similarity index 100% rename from src/v0/sources/formsort/mapping.json rename to src/sources/formsort/mapping.json diff --git a/src/v0/sources/formsort/transform.js b/src/sources/formsort/transform.js similarity index 81% rename from src/v0/sources/formsort/transform.js rename to src/sources/formsort/transform.js index dd37482bc49..234c9573bf8 100644 --- a/src/v0/sources/formsort/transform.js +++ b/src/sources/formsort/transform.js @@ -1,12 +1,13 @@ const path = require('path'); const fs = require('fs'); -const { generateUUID, isDefinedAndNotNull } = require('../../util'); +const { generateUUID, isDefinedAndNotNull, getBodyFromV2SpecPayload } = require('../../v0/util'); const Message = require('../message'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const message = new Message(`Formsort`); // we are setting event type as track always diff --git a/src/v0/sources/formsort/transform.test.js b/src/sources/formsort/transform.test.js similarity index 64% rename from src/v0/sources/formsort/transform.test.js rename to src/sources/formsort/transform.test.js index e3d686fcefb..a7462899404 100644 --- a/src/v0/sources/formsort/transform.test.js +++ b/src/sources/formsort/transform.test.js @@ -3,18 +3,22 @@ const { process } = require('./transform'); it(`Transform.js Tests`, () => { const data = { input: { - answers: { - yes: true, - enter_email: 'test@user.com', - enter_name: '2022-11-17', - yes_or_no: false, + request: { + body: JSON.stringify({ + 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', + }), }, - 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: { diff --git a/src/v0/sources/gainsightpx/config.js b/src/sources/gainsightpx/config.js similarity index 100% rename from src/v0/sources/gainsightpx/config.js rename to src/sources/gainsightpx/config.js diff --git a/src/v0/sources/gainsightpx/data/customMapping.json b/src/sources/gainsightpx/data/customMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/customMapping.json rename to src/sources/gainsightpx/data/customMapping.json diff --git a/src/v0/sources/gainsightpx/data/engagementMapping.json b/src/sources/gainsightpx/data/engagementMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/engagementMapping.json rename to src/sources/gainsightpx/data/engagementMapping.json diff --git a/src/v0/sources/gainsightpx/data/featureMatchMapping.json b/src/sources/gainsightpx/data/featureMatchMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/featureMatchMapping.json rename to src/sources/gainsightpx/data/featureMatchMapping.json diff --git a/src/v0/sources/gainsightpx/data/feedbackMapping.json b/src/sources/gainsightpx/data/feedbackMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/feedbackMapping.json rename to src/sources/gainsightpx/data/feedbackMapping.json diff --git a/src/v0/sources/gainsightpx/data/identifyMapping.json b/src/sources/gainsightpx/data/identifyMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/identifyMapping.json rename to src/sources/gainsightpx/data/identifyMapping.json diff --git a/src/v0/sources/gainsightpx/data/segmentIOMapping.json b/src/sources/gainsightpx/data/segmentIOMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/segmentIOMapping.json rename to src/sources/gainsightpx/data/segmentIOMapping.json diff --git a/src/v0/sources/gainsightpx/data/segmentMapping.json b/src/sources/gainsightpx/data/segmentMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/segmentMapping.json rename to src/sources/gainsightpx/data/segmentMapping.json diff --git a/src/v0/sources/gainsightpx/data/surveyMapping.json b/src/sources/gainsightpx/data/surveyMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/surveyMapping.json rename to src/sources/gainsightpx/data/surveyMapping.json diff --git a/src/v0/sources/gainsightpx/transform.js b/src/sources/gainsightpx/transform.js similarity index 95% rename from src/v0/sources/gainsightpx/transform.js rename to src/sources/gainsightpx/transform.js index 92f0a074562..62bc73e6152 100644 --- a/src/v0/sources/gainsightpx/transform.js +++ b/src/sources/gainsightpx/transform.js @@ -10,6 +10,7 @@ const surveyMapping = require('./data/surveyMapping.json'); const featureMatchMapping = require('./data/featureMatchMapping.json'); const segmentIoMapping = require('./data/segmentIOMapping.json'); const { refinePayload, refineTraitPayload } = require('./utils'); +const { getBodyFromV2SpecPayload } = require('../../v0/util'); const buildIdentifyPayload = (event) => { let message = new Message(`GAINSIGHTPX`); @@ -84,7 +85,8 @@ function processEvent(event) { return message; } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = processEvent(event); const returnValue = refinePayload(response); return returnValue; diff --git a/src/v0/sources/gainsightpx/utils.js b/src/sources/gainsightpx/utils.js similarity index 95% rename from src/v0/sources/gainsightpx/utils.js rename to src/sources/gainsightpx/utils.js index aed0f5fab8d..f93caaada91 100644 --- a/src/v0/sources/gainsightpx/utils.js +++ b/src/sources/gainsightpx/utils.js @@ -1,5 +1,5 @@ /* eslint-disable no-param-reassign */ -const { isDefinedAndNotNullAndNotEmpty } = require('../../util'); +const { isDefinedAndNotNullAndNotEmpty } = require('../../v0/util'); const { traitsToDelete, accountTraitsToDelete } = require('./config'); /** diff --git a/src/v0/sources/iterable/mapping.json b/src/sources/iterable/mapping.json similarity index 100% rename from src/v0/sources/iterable/mapping.json rename to src/sources/iterable/mapping.json diff --git a/src/v0/sources/iterable/transform.js b/src/sources/iterable/transform.js similarity index 90% rename from src/v0/sources/iterable/transform.js rename to src/sources/iterable/transform.js index dc3fc72c3c8..ffb96c26b30 100644 --- a/src/v0/sources/iterable/transform.js +++ b/src/sources/iterable/transform.js @@ -3,11 +3,13 @@ const fs = require('fs'); const md5 = require('md5'); const { TransformationError } = require('@rudderstack/integrations-lib'); const Message = require('../message'); +const { getBodyFromV2SpecPayload } = require('../../v0/util'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); // throw an error if (email, eventName) are not present if (!(event.email && event.eventName)) { throw new TransformationError('Unknwon event type from Iterable'); diff --git a/src/v0/sources/mailjet/mapping.json b/src/sources/mailjet/mapping.json similarity index 100% rename from src/v0/sources/mailjet/mapping.json rename to src/sources/mailjet/mapping.json diff --git a/src/v0/sources/mailjet/transform.js b/src/sources/mailjet/transform.js similarity index 88% rename from src/v0/sources/mailjet/transform.js rename to src/sources/mailjet/transform.js index 91f90b6ed0f..e115b8a0253 100644 --- a/src/v0/sources/mailjet/transform.js +++ b/src/sources/mailjet/transform.js @@ -2,7 +2,8 @@ const path = require('path'); const fs = require('fs'); const md5 = require('md5'); const Message = require('../message'); -const { CommonUtils } = require('../../../util/common'); +const { CommonUtils } = require('../../util/common'); +const { getBodyFromV2SpecPayload } = require('../../v0/util'); // ref : https://dev.mailjet.com/email/guides/webhooks/ // import mapping json using JSON.parse to preserve object key order @@ -46,7 +47,8 @@ const processEvent = (event) => { }; // This fucntion just converts the incoming payload to array of already not and sends it to processEvent -const process = (events) => { +const process = (payload) => { + const events = getBodyFromV2SpecPayload(payload); const eventsArray = CommonUtils.toArray(events); return eventsArray.map(processEvent); }; diff --git a/src/v0/sources/mailmodo/mapping.json b/src/sources/mailmodo/mapping.json similarity index 100% rename from src/v0/sources/mailmodo/mapping.json rename to src/sources/mailmodo/mapping.json diff --git a/src/v0/sources/mailmodo/transform.js b/src/sources/mailmodo/transform.js similarity index 93% rename from src/v0/sources/mailmodo/transform.js rename to src/sources/mailmodo/transform.js index a4383fb4409..0ec483f5936 100644 --- a/src/v0/sources/mailmodo/transform.js +++ b/src/sources/mailmodo/transform.js @@ -2,7 +2,11 @@ const path = require('path'); const fs = require('fs'); const sha256 = require('sha256'); const { TransformationError } = require('@rudderstack/integrations-lib'); -const { flattenJson, removeUndefinedAndNullAndEmptyValues } = require('../../util'); +const { + flattenJson, + removeUndefinedAndNullAndEmptyValues, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); const Message = require('../message'); // import mapping json using JSON.parse to preserve object key order @@ -39,7 +43,8 @@ function settingProperties(event, message) { return cloneMessage; } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const message = new Message(`Mailmodo`); // event type is always track diff --git a/src/v0/sources/message.js b/src/sources/message.js similarity index 97% rename from src/v0/sources/message.js rename to src/sources/message.js index aa7fd48dd4a..05c4c50f559 100644 --- a/src/v0/sources/message.js +++ b/src/sources/message.js @@ -1,7 +1,7 @@ const set = require('set-value'); const get = require('get-value'); -const { getValueFromMessage } = require('../util'); +const { getValueFromMessage } = require('../v0/util'); const context = (integration) => ({ library: { diff --git a/src/sources/moengage/transform.js b/src/sources/moengage/transform.js new file mode 100644 index 00000000000..e64de556ad1 --- /dev/null +++ b/src/sources/moengage/transform.js @@ -0,0 +1,11 @@ +const { getBodyFromV2SpecPayload } = require('../../v0/util'); + +function process(payload) { + const events = getBodyFromV2SpecPayload(payload); + if (events.batch) { + return events.batch; + } + return events; +} + +exports.process = process; diff --git a/src/v0/sources/monday/mapping.json b/src/sources/monday/mapping.json similarity index 100% rename from src/v0/sources/monday/mapping.json rename to src/sources/monday/mapping.json diff --git a/src/v0/sources/monday/transform.js b/src/sources/monday/transform.js similarity index 89% rename from src/v0/sources/monday/transform.js rename to src/sources/monday/transform.js index d63323605b3..adf3d564a75 100644 --- a/src/v0/sources/monday/transform.js +++ b/src/sources/monday/transform.js @@ -2,8 +2,12 @@ const sha256 = require('sha256'); const { TransformationError } = require('@rudderstack/integrations-lib'); const Message = require('../message'); const { mapping, formEventName } = require('./util'); -const { generateUUID, removeUndefinedAndNullValues } = require('../../util'); -const { JSON_MIME_TYPE } = require('../../util/constant'); +const { + generateUUID, + removeUndefinedAndNullValues, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); +const { JSON_MIME_TYPE } = require('../../v0/util/constant'); function processNormalEvent(mondayPayload) { const message = new Message(`MONDAY`); @@ -61,7 +65,8 @@ function processChallengeEvent(event) { // For challenge event the recieved challenge object is sent back // to Monday to verify the webhook url. // Ref: https://developer.monday.com/api-reference/docs/webhooks-1#how-to-verify-a-webhook-url -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = isChallengeEvent(event) ? processChallengeEvent(event) : processNormalEvent(event); diff --git a/src/v0/sources/monday/util.js b/src/sources/monday/util.js similarity index 100% rename from src/v0/sources/monday/util.js rename to src/sources/monday/util.js diff --git a/src/v0/sources/olark/groupMapping.json b/src/sources/olark/groupMapping.json similarity index 100% rename from src/v0/sources/olark/groupMapping.json rename to src/sources/olark/groupMapping.json diff --git a/src/v0/sources/olark/trackMapping.json b/src/sources/olark/trackMapping.json similarity index 100% rename from src/v0/sources/olark/trackMapping.json rename to src/sources/olark/trackMapping.json diff --git a/src/v0/sources/olark/transform.js b/src/sources/olark/transform.js similarity index 91% rename from src/v0/sources/olark/transform.js rename to src/sources/olark/transform.js index 50b5e5bfc49..377b78532d4 100644 --- a/src/v0/sources/olark/transform.js +++ b/src/sources/olark/transform.js @@ -2,7 +2,7 @@ const path = require('path'); const fs = require('fs'); const set = require('set-value'); const Message = require('../message'); -const { removeUndefinedAndNullValues } = require('../../util'); +const { removeUndefinedAndNullValues, getBodyFromV2SpecPayload } = require('../../v0/util'); const { getBrowserInfo } = require('./util'); // ref : https://www.olark.com/help/webhooks/ @@ -49,7 +49,8 @@ const prepareGroupPayload = (event) => { return groupEvents; }; -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = []; response.push(prepareTrackPayload(event)); diff --git a/src/v0/sources/olark/util.js b/src/sources/olark/util.js similarity index 100% rename from src/v0/sources/olark/util.js rename to src/sources/olark/util.js diff --git a/src/v0/sources/ortto/event_mapping.json b/src/sources/ortto/event_mapping.json similarity index 100% rename from src/v0/sources/ortto/event_mapping.json rename to src/sources/ortto/event_mapping.json diff --git a/src/v0/sources/ortto/mapping.json b/src/sources/ortto/mapping.json similarity index 100% rename from src/v0/sources/ortto/mapping.json rename to src/sources/ortto/mapping.json diff --git a/src/v0/sources/ortto/transform.js b/src/sources/ortto/transform.js similarity index 91% rename from src/v0/sources/ortto/transform.js rename to src/sources/ortto/transform.js index b40163f567b..bb719cf6e5e 100644 --- a/src/v0/sources/ortto/transform.js +++ b/src/sources/ortto/transform.js @@ -1,9 +1,14 @@ const path = require('path'); const fs = require('fs'); -const { flattenJson, removeUndefinedAndNullValues, generateUUID } = require('../../util'); +const { + flattenJson, + removeUndefinedAndNullValues, + generateUUID, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); const Message = require('../message'); const eventMapping = require('./event_mapping.json'); -const { JSON_MIME_TYPE } = require('../../util/constant'); +const { JSON_MIME_TYPE } = require('../../v0/util/constant'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); @@ -43,7 +48,8 @@ function settingProperties(event, message) { return message; } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); let message = new Message(`ortto`); // Here, we are checking for the test event to discard them diff --git a/src/v0/sources/pagerduty/data/eventMapping.json b/src/sources/pagerduty/data/eventMapping.json similarity index 100% rename from src/v0/sources/pagerduty/data/eventMapping.json rename to src/sources/pagerduty/data/eventMapping.json diff --git a/src/v0/sources/pagerduty/data/trackMapping.json b/src/sources/pagerduty/data/trackMapping.json similarity index 100% rename from src/v0/sources/pagerduty/data/trackMapping.json rename to src/sources/pagerduty/data/trackMapping.json diff --git a/src/v0/sources/pagerduty/transform.js b/src/sources/pagerduty/transform.js similarity index 84% rename from src/v0/sources/pagerduty/transform.js rename to src/sources/pagerduty/transform.js index 19c52b21ba3..51b64b31440 100644 --- a/src/v0/sources/pagerduty/transform.js +++ b/src/sources/pagerduty/transform.js @@ -1,5 +1,5 @@ const Message = require('../message'); -const { generateUUID } = require('../../util'); +const { generateUUID, getBodyFromV2SpecPayload } = require('../../v0/util'); const trackMapping = require('./data/trackMapping.json'); const eventNameMap = require('./data/eventMapping.json'); @@ -25,8 +25,8 @@ const prepareTrackPayload = (event) => { return message; }; -function process(event) { - const { event: processEvent } = event; +function process(payload) { + const { event: processEvent } = getBodyFromV2SpecPayload(payload); return prepareTrackPayload(processEvent); } diff --git a/src/v0/sources/pipedream/config.js b/src/sources/pipedream/config.js similarity index 100% rename from src/v0/sources/pipedream/config.js rename to src/sources/pipedream/config.js diff --git a/src/v0/sources/pipedream/transform.js b/src/sources/pipedream/transform.js similarity index 80% rename from src/v0/sources/pipedream/transform.js rename to src/sources/pipedream/transform.js index 744ffd4649c..3ef788abc26 100644 --- a/src/v0/sources/pipedream/transform.js +++ b/src/sources/pipedream/transform.js @@ -1,5 +1,5 @@ const Message = require('../message'); -const { generateUUID } = require('../../util'); +const { generateUUID, getBodyFromV2SpecPayload } = require('../../v0/util'); const { callTypes } = require('./config'); const { findUserIdOrAnonymousId } = require('./util'); @@ -11,7 +11,8 @@ const buildTrackPayload = (event) => { return message; }; -const process = (event) => { +const process = (payload) => { + const event = getBodyFromV2SpecPayload(payload); const id = findUserIdOrAnonymousId(event); if (event?.type && callTypes.includes(event.type.toLowerCase()) && id) { return event; diff --git a/src/v0/sources/pipedream/util.js b/src/sources/pipedream/util.js similarity index 100% rename from src/v0/sources/pipedream/util.js rename to src/sources/pipedream/util.js diff --git a/src/v0/sources/refiner/groupMapping.json b/src/sources/refiner/groupMapping.json similarity index 100% rename from src/v0/sources/refiner/groupMapping.json rename to src/sources/refiner/groupMapping.json diff --git a/src/v0/sources/refiner/identifyMapping.json b/src/sources/refiner/identifyMapping.json similarity index 100% rename from src/v0/sources/refiner/identifyMapping.json rename to src/sources/refiner/identifyMapping.json diff --git a/src/v0/sources/refiner/trackMapping.json b/src/sources/refiner/trackMapping.json similarity index 100% rename from src/v0/sources/refiner/trackMapping.json rename to src/sources/refiner/trackMapping.json diff --git a/src/v0/sources/refiner/transform.js b/src/sources/refiner/transform.js similarity index 83% rename from src/v0/sources/refiner/transform.js rename to src/sources/refiner/transform.js index b9982ef1d83..447ff14217f 100644 --- a/src/v0/sources/refiner/transform.js +++ b/src/sources/refiner/transform.js @@ -1,7 +1,7 @@ const path = require('path'); const fs = require('fs'); const Message = require('../message'); -const { removeUndefinedAndNullValues } = require('../../util'); +const { removeUndefinedAndNullValues, getBodyFromV2SpecPayload } = require('../../v0/util'); // import mapping json using JSON.parse to preserve object key order const identifyMapping = JSON.parse( @@ -40,18 +40,19 @@ const prepareGroupPayload = (event) => { return message; }; -function process(event) { - const payload = []; +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); + const resultPayload = []; const identifyPayload = prepareIdentifyaPayload(event); const trackPayload = prepareTrackPayload(event); const groupPayload = prepareGroupPayload(event); - payload.push(identifyPayload, trackPayload); + resultPayload.push(identifyPayload, trackPayload); if (groupPayload.groupId) { - payload.push(groupPayload); + resultPayload.push(groupPayload); } - return payload; + return resultPayload; } module.exports = { process }; diff --git a/src/v0/sources/revenuecat/mapping.json b/src/sources/revenuecat/mapping.json similarity index 100% rename from src/v0/sources/revenuecat/mapping.json rename to src/sources/revenuecat/mapping.json diff --git a/src/v0/sources/revenuecat/transform.js b/src/sources/revenuecat/transform.js similarity index 88% rename from src/v0/sources/revenuecat/transform.js rename to src/sources/revenuecat/transform.js index c746f13b1a8..e9967ae4992 100644 --- a/src/v0/sources/revenuecat/transform.js +++ b/src/sources/revenuecat/transform.js @@ -1,11 +1,17 @@ const { camelCase } = require('lodash'); const moment = require('moment'); const { isDefinedAndNotNullAndNotEmpty } = require('@rudderstack/integrations-lib'); -const { removeUndefinedAndNullValues, isDefinedAndNotNull, generateUUID } = require('../../util'); +const { + removeUndefinedAndNullValues, + isDefinedAndNotNull, + generateUUID, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); const Message = require('../message'); -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const message = new Message(`RevenueCat`); // we are setting event type as track always diff --git a/src/v0/sources/satismeter/data/trackMapping.json b/src/sources/satismeter/data/trackMapping.json similarity index 100% rename from src/v0/sources/satismeter/data/trackMapping.json rename to src/sources/satismeter/data/trackMapping.json diff --git a/src/v0/sources/satismeter/transform.js b/src/sources/satismeter/transform.js similarity index 83% rename from src/v0/sources/satismeter/transform.js rename to src/sources/satismeter/transform.js index 162b4f461c4..b8c08529195 100644 --- a/src/v0/sources/satismeter/transform.js +++ b/src/sources/satismeter/transform.js @@ -1,5 +1,5 @@ const Message = require('../message'); -const { refinePayload } = require('../../util'); +const { refinePayload, getBodyFromV2SpecPayload } = require('../../v0/util'); const trackMapping = require('./data/trackMapping.json'); const buildTrackPayload = (event) => { @@ -19,7 +19,8 @@ const processEvent = (event) => { return message; }; -const process = (event) => { +const process = (payload) => { + const event = getBodyFromV2SpecPayload(payload); const response = processEvent(event); const refinedResponse = refinePayload(response); return refinedResponse; diff --git a/src/sources/segment/transform.js b/src/sources/segment/transform.js new file mode 100644 index 00000000000..8db0e0921c0 --- /dev/null +++ b/src/sources/segment/transform.js @@ -0,0 +1,8 @@ +const { getBodyFromV2SpecPayload } = require('../../v0/util'); + +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); + return event; +} + +exports.process = process; diff --git a/src/sources/shopify/transform.js b/src/sources/shopify/transform.js new file mode 100644 index 00000000000..1d0d70ca907 --- /dev/null +++ b/src/sources/shopify/transform.js @@ -0,0 +1,19 @@ +const { process: processV1 } = require('../../v1/sources/shopify/transform'); + +const convertV2ToV1 = (inputRequest) => { + const { body: bodyString, query_parameters: qParams } = inputRequest.request; + const requestBody = JSON.parse(bodyString); + + if (qParams) { + requestBody.query_parameters = qParams; + } + + return { + event: requestBody, + source: inputRequest.source, + }; +}; + +const process = async (inputEvent) => processV1(convertV2ToV1(inputEvent)); + +module.exports = { process }; diff --git a/src/v0/sources/signl4/mapping.json b/src/sources/signl4/mapping.json similarity index 100% rename from src/v0/sources/signl4/mapping.json rename to src/sources/signl4/mapping.json diff --git a/src/v0/sources/signl4/transform.js b/src/sources/signl4/transform.js similarity index 90% rename from src/v0/sources/signl4/transform.js rename to src/sources/signl4/transform.js index f569786099a..3c34859db7e 100644 --- a/src/v0/sources/signl4/transform.js +++ b/src/sources/signl4/transform.js @@ -1,8 +1,13 @@ const path = require('path'); const fs = require('fs'); -const { flattenJson, removeUndefinedAndNullValues, generateUUID } = require('../../util'); +const { + flattenJson, + removeUndefinedAndNullValues, + generateUUID, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); const Message = require('../message'); -const { JSON_MIME_TYPE } = require('../../util/constant'); +const { JSON_MIME_TYPE } = require('../../v0/util/constant'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); @@ -24,7 +29,8 @@ function settingProperties(event, message) { return message; } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); let message = new Message(`Signl4`); // Here, we are checking for the test event to discard them diff --git a/src/v0/sources/slack/mapping.json b/src/sources/slack/mapping.json similarity index 100% rename from src/v0/sources/slack/mapping.json rename to src/sources/slack/mapping.json diff --git a/src/v0/sources/slack/transform.js b/src/sources/slack/transform.js similarity index 93% rename from src/v0/sources/slack/transform.js rename to src/sources/slack/transform.js index 98324a7b650..e51e897078a 100644 --- a/src/v0/sources/slack/transform.js +++ b/src/sources/slack/transform.js @@ -2,9 +2,13 @@ const sha256 = require('sha256'); const { TransformationError } = require('@rudderstack/integrations-lib'); const Message = require('../message'); const { mapping, tsToISODate, normalizeEventName } = require('./util'); -const { generateUUID, removeUndefinedAndNullValues } = require('../../util'); -const { JSON_MIME_TYPE } = require('../../util/constant'); -const { EventType } = require('../../../constants'); +const { + generateUUID, + removeUndefinedAndNullValues, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); +const { JSON_MIME_TYPE } = require('../../v0/util/constant'); +const { EventType } = require('../../constants'); /** * Transform event data to RudderStack supported standard event schema @@ -100,7 +104,8 @@ function isWebhookUrlVerificationEvent(event) { * Reference - https://api.slack.com/apis/connections/events-api * @param {Object} event */ -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = isWebhookUrlVerificationEvent(event) ? processUrlVerificationEvent(event) : processNormalEvent(event); diff --git a/src/v0/sources/slack/util.js b/src/sources/slack/util.js similarity index 100% rename from src/v0/sources/slack/util.js rename to src/sources/slack/util.js diff --git a/src/v0/sources/slack/util.test.js b/src/sources/slack/util.test.js similarity index 100% rename from src/v0/sources/slack/util.test.js rename to src/sources/slack/util.test.js diff --git a/src/sources/webhook/transform.js b/src/sources/webhook/transform.js new file mode 100644 index 00000000000..fcfe51604fd --- /dev/null +++ b/src/sources/webhook/transform.js @@ -0,0 +1,41 @@ +const { flattenQueryParams: flattenMapWithArrayValues } = require('@rudderstack/integrations-lib'); +const { + removeUndefinedAndNullValues, + generateUUID, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); + +function processEvent(payload) { + const event = getBodyFromV2SpecPayload(payload); + + const putRequestDetailsInContext = Boolean(payload.source.Config?.putRequestDetailsInContext); + + const request = { ...payload.request }; + + const response = { + type: 'track', + event: 'webhook_source_event', + properties: event, + anonymousId: generateUUID(), + }; + + if (putRequestDetailsInContext) { + response.context = { + method: request.method, + url: request.url, + proto: request.proto, + headers: request.headers && flattenMapWithArrayValues(request.headers), + query_parameters: + request.query_parameters && flattenMapWithArrayValues(request.query_parameters), + }; + } + + return response; +} + +function process(payload) { + const response = processEvent(payload); + return removeUndefinedAndNullValues(response); +} + +exports.process = process; diff --git a/src/types/controlPlaneConfig.ts b/src/types/controlPlaneConfig.ts new file mode 100644 index 00000000000..3454307b240 --- /dev/null +++ b/src/types/controlPlaneConfig.ts @@ -0,0 +1,69 @@ +// import type { FixMe } from '../util/types'; +import type { UserTransformationInput } from './userTransformation'; + +export type DestinationDefinition = { + ID: string; + Name: string; + DisplayName: string; + Config: Record; +}; + +export type Destination> = { + ID: string; + Name: string; + DestinationDefinition: DestinationDefinition; + Config: DestinationConfig; + Enabled: boolean; + WorkspaceID: string; + Transformations: UserTransformationInput[]; + RevisionID?: string; + IsProcessorEnabled?: boolean; + IsConnectionEnabled?: boolean; +}; + +export type DestinationConnectionConfig = { + destination: T; +}; + +export type Connection> = { + sourceId: string; + destinationId: string; + enabled: boolean; + config: T; + processorEnabled?: boolean; +}; + +export type SourceDefinition = { + ID: string; + Name: string; + Category: string; + Type: string; +}; + +export type Source = { + ID: string; + OriginalID: string; + Name: string; + SourceDefinition: SourceDefinition; + Config: object; + Enabled: boolean; + WorkspaceID: string; + WriteKey: string; + Transformations?: UserTransformationInput[]; + RevisionID?: string; + Destinations?: Destination[]; + Transient: boolean; + EventSchemasEnabled: boolean; + DgSourceTrackingPlanConfig: object; +}; + +export type UserTransformationLibrary = { + VersionID: string; +}; + +export type Credential = { + id: string; + key: string; + value: string; + isSecret: boolean; +}; diff --git a/src/types/destinationTransformation.ts b/src/types/destinationTransformation.ts new file mode 100644 index 00000000000..a1960db072d --- /dev/null +++ b/src/types/destinationTransformation.ts @@ -0,0 +1,233 @@ +import type { + Connection, + Credential, + Destination, + UserTransformationLibrary, +} from './controlPlaneConfig'; +import type { Metadata, RudderMessage } from './rudderEvents'; + +/** + * Processor transformation request/response structures + */ +export type ProcessorTransformationRequest = { + request?: object; + message: M; + metadata: MD; + destination: Destination; + connection?: Connection; + libraries?: UserTransformationLibrary[]; + credentials?: Credential[]; +}; + +export type BatchedRequestBody> = { + JSON?: T; + JSON_ARRAY?: Record; + XML?: Record; + FORM?: Record; +}; + +export type BatchedRequest< + TPayload = Record, + THeaders = Record, + TParams = Record, +> = { + body: BatchedRequestBody; + version: string; + type: string; + method: string; + endpoint: string; + headers: THeaders; + params: TParams; + files: Record; +}; + +export type BatchRequestOutput< + TPayload = Record, + THeaders = Record, + TParams = Record, + TDestination = Destination, +> = { + batchedRequest: BatchedRequest; + metadata: Partial[]; + batched: boolean; + statusCode: number; + destination: TDestination; +}; + +/** + * Output structure for processor transformations + */ +export type ProcessorTransformationOutput = { + version: string; + type: string; + method: string; + endpoint: string; + userId?: string; + headers?: Record; + params?: Record; + body?: BatchedRequestBody; + files?: Record; +}; + +export type ProcessorTransformationResponse = { + output?: ProcessorTransformationOutput | RudderMessage; + metadata: Partial; + statusCode: number; + error?: string; + statTags?: object; +}; + +/** + * Router transformation structures + */ +export type RouterTransformationRequestData< + M = RudderMessage, + D = Destination, + C = Connection, + MD = Metadata, +> = { + request?: object; + message: M; + metadata: MD; + destination: D; + connection?: C; +}; + +export type RouterTransformationRequest = { + input: RouterTransformationRequestData[]; + destType: string; +}; + +export type RouterTransformationResponse = { + batchedRequest?: ProcessorTransformationOutput | ProcessorTransformationOutput[]; + metadata: Partial[]; + destination: Destination; + batched: boolean; + statusCode: number; + error?: string; + statTags?: object; +}; + +/** + * Metadata structure for proxy requests + */ +export type ProxyMetdata = { + jobId: number; + attemptNum: number; + userId: string; + sourceId: string; + destinationId: string; + workspaceId: string; + secret: Record; + destInfo?: Record; + omitempty?: Record; + dontBatch: boolean; +}; + +/** + * Proxy request structure for version 0 + */ +export type ProxyV0Request = { + version: string; + type: string; + method: string; + endpoint: string; + userId: string; + headers?: Record; + params?: Record; + body?: { + JSON?: Record; + JSON_ARRAY?: Record; + XML?: Record; + FORM?: Record; + }; + files?: Record; + metadata: ProxyMetdata; + destinationConfig: Record; +}; + +/** + * Proxy request structure for version 1 + */ +export type ProxyV1Request = Omit & { + metadata: ProxyMetdata[]; +}; + +export type ProxyRequest = ProxyV0Request | ProxyV1Request; + +/** + * Error detailer structure for proxy + */ +export type ErrorDetailer = { + module: string; + implementation: string; + feature: string; +} & ErrorDetailerOptions; + +export type ErrorDetailerOptions = { + errorCategory?: string; + errorType?: string; + meta?: string; + destType?: string; + srcType?: string; + cluster?: string; + customer?: string; + destinationId?: string; + workspaceId?: string; + sourceId?: string; +}; + +export type MetaTransferObjectForProxy = { + metadata?: ProxyMetdata; + metadatas?: ProxyMetdata[]; + errorDetails: ErrorDetailer; + errorContext: string; +}; + +export type MetaTransferObject = + | { + metadatas?: Partial[]; + metadata?: Partial; + errorDetails: ErrorDetailer; + errorContext: string; + } + | MetaTransferObjectForProxy; + +/** + * Delivery response structures + */ +export type DeliveryV0Response = { + status: number; + message: string; + destinationResponse: any; + statTags: object; + authErrorCategory?: string; +}; + +export type DeliveryJobState = { + error: string; + statusCode: number; + metadata: ProxyMetdata; +}; + +export type DeliveryV1Response = { + status: number; + message: string; + statTags?: object; + destinationResponse?: any; + authErrorCategory?: string; + response: DeliveryJobState[]; +}; + +export type ComparatorInput = { + events: ProcessorTransformationRequest[] | RouterTransformationRequestData[]; + destination: string; + version: string; + requestMetadata: object; + feature: string; +}; + +// Add helper type for pre-processing functions +export type PreProcessableRequest = + | ProcessorTransformationRequest + | RouterTransformationRequestData; diff --git a/src/types/index.ts b/src/types/index.ts index 7c07f659df3..8927a7fe60d 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,415 +1,7 @@ -import { CatchErr, FixMe } from '../util/types'; - -/* eslint-disable @typescript-eslint/no-explicit-any */ -type ProcessorTransformationOutput = { - version: string; - type: string; - method: string; - endpoint: string; - userId?: string; - headers?: Record; - params?: Record; - body?: { - JSON?: Record; - JSON_ARRAY?: Record; - XML?: Record; - FORM?: Record; - }; - files?: Record; -}; - -type ProxyV0Request = { - version: string; - type: string; - method: string; - endpoint: string; - userId: string; - headers?: Record; - params?: Record; - body?: { - JSON?: Record; - JSON_ARRAY?: Record; - XML?: Record; - FORM?: Record; - }; - files?: Record; - metadata: ProxyMetdata; - destinationConfig: Record; -}; - -type ProxyV1Request = { - version: string; - type: string; - method: string; - endpoint: string; - userId: string; - headers?: Record; - params?: Record; - body?: { - JSON?: Record; - JSON_ARRAY?: Record; - XML?: Record; - FORM?: Record; - }; - files?: Record; - metadata: ProxyMetdata[]; - destinationConfig: Record; -}; - -type ProxyRequest = ProxyV0Request | ProxyV1Request; - -type ProxyMetdata = { - jobId: number; - attemptNum: number; - userId: string; - sourceId: string; - destinationId: string; - workspaceId: string; - secret: Record; - destInfo?: Record; - omitempty?: Record; - dontBatch: boolean; -}; - -type Metadata = { - sourceId: string; - workspaceId: string; - namespace: string; - instanceId: string; - sourceType: string; - sourceCategory: string; - trackingPlanId: string; - trackingPlanVersion: number; - sourceTpConfig: object; - mergedTpConfig: object; - destinationId: string; - jobRunId: string; - jobId: number; - sourceBatchId: string; - sourceJobId: string; - sourceJobRunId: string; - sourceTaskId: string; - sourceTaskRunId: string; - recordId: object; - destinationType: string; - messageId: string; - oauthAccessToken: string; - messageIds: string[]; - rudderId: string; - receivedAt: string; - eventName: string; - eventType: string; - sourceDefinitionId: string; - destinationDefinitionId: string; - transformationId: string; - dontBatch?: boolean; -}; - -type MessageIdMetadataMap = { - [key: string]: Metadata; -}; - -type UserTransformationInput = { - VersionID: string; - ID: string; - Config: object; -}; - -type DestinationDefinition = { - ID: string; - Name: string; - DisplayName: string; - Config: FixMe; -}; - -type Destination = { - ID: string; - Name: string; - DestinationDefinition: DestinationDefinition; - Config: FixMe; - Enabled: boolean; - WorkspaceID: string; - Transformations: UserTransformationInput[]; - RevisionID?: string; - IsProcessorEnabled?: boolean; - IsConnectionEnabled?: boolean; -}; - -type Connection = { - sourceId: string; - destinationId: string; - enabled: boolean; - config: Record; - processorEnabled?: boolean; -}; - -type UserTransformationLibrary = { - VersionID: string; -}; - -type Credential = { - id: string; - key: string; - value: string; - isSecret: boolean; -}; - -type ProcessorTransformationRequest = { - request?: object; - message: object; - metadata: Metadata; - destination: Destination; - connection?: Connection; - libraries?: UserTransformationLibrary[]; - credentials?: Credential[]; -}; - -type RouterTransformationRequestData = { - request?: object; - message: object; - metadata: Metadata; - destination: Destination; - connection?: Connection; -}; - -type RouterTransformationRequest = { - input: RouterTransformationRequestData[]; - destType: string; -}; - -type ProcessorTransformationResponse = { - output?: ProcessorTransformationOutput | RudderMessage; - metadata: Metadata; - statusCode: number; - error?: string; - statTags?: object; -}; - -type RouterTransformationResponse = { - batchedRequest?: ProcessorTransformationOutput | ProcessorTransformationOutput[]; - metadata: Metadata[]; - destination: Destination; - batched: boolean; - statusCode: number; - error?: string; - statTags?: object; -}; - -type SourceTransformationEvent = { - headers?: Record; - query_params?: Record; - [key: string]: any; -}; - -type SourceTransformationOutput = { - batch: RudderMessage[]; -}; - -type SourceTransformationResponse = { - output: SourceTransformationOutput; - error: CatchErr; - statusCode: number; - outputToSource: object; - statTags: object; -}; - -type DeliveryV0Response = { - status: number; - message: string; - destinationResponse: any; - statTags: object; - authErrorCategory?: string; -}; - -type DeliveryJobState = { - error: string; - statusCode: number; - metadata: ProxyMetdata; -}; - -type DeliveryV1Response = { - status: number; - message: string; - statTags?: object; - destinationResponse?: any; - authErrorCategory?: string; - response: DeliveryJobState[]; -}; - -enum MessageType { - IDENTIFY = 'identify', - TRACK = 'track', - PAGE = 'page', - SCREEN = 'screen', - GROUP = 'group', - ALIAS = 'alias', - AUDIENCE_LIST = 'audiencelist', -} - -type RudderMessage = { - userId?: string; - anonymousId: string; - type: MessageType; - channel: string; - context: object; - originalTimestamp: Date; - sentAt: Date; - timestamp: Date; - event?: string; - integrations?: object; - messageId: string; - properties?: object; - traits?: object; -}; - -type ErrorDetailer = { - module: string; - implementation: string; - feature: string; - errorCategory?: string; - errorType?: string; - meta?: string; - destType?: string; - srcType?: string; - cluster?: string; - customer?: string; - destinationId?: string; - workspaceId?: string; - sourceId?: string; -}; - -type MetaTransferObjectForProxy = { - metadata?: ProxyMetdata; - metadatas?: ProxyMetdata[]; - errorDetails: ErrorDetailer; - errorContext: string; -}; - -type MetaTransferObject = - | { - metadatas?: Metadata[]; - metadata?: Metadata; - errorDetails: ErrorDetailer; - errorContext: string; - } - | MetaTransferObjectForProxy; - -type UserTransformationResponse = { - transformedEvent: RudderMessage; - metadata: Metadata; - error: CatchErr; -}; - -type UserTransformationServiceResponse = { - transformedEvents: ProcessorTransformationResponse[]; - retryStatus: number; -}; - -type UserDeletionRequest = { - userAttributes: FixMe[]; - config: object; - destType: string; - jobId: string; -}; - -type UserDeletionResponse = { - statusCode: number; - error?: string; - status?: string; - authErrorCategory: FixMe; - statTags: object; -}; - -type ComparatorInput = { - events: ProcessorTransformationRequest[] | RouterTransformationRequestData[]; - destination: string; - version: string; - requestMetadata: object; - feature: string; -}; -type SourceDefinition = { - ID: string; - Name: string; - Category: string; - Type: string; -}; - -type Source = { - ID: string; - OriginalID: string; - Name: string; - SourceDefinition: SourceDefinition; - Config: object; - Enabled: boolean; - WorkspaceID: string; - WriteKey: string; - Transformations?: UserTransformationInput[]; - RevisionID?: string; - Destinations?: Destination[]; - Transient: boolean; - EventSchemasEnabled: boolean; - DgSourceTrackingPlanConfig: object; -}; - -type SourceInput = { - event: { - query_parameters?: any; - [key: string]: any; - }; - source?: Source; -}; - -type SourceRequestV2 = { - method?: string; - url?: string; - proto?: string; - body: string; - headers?: Record; - query_parameters?: Record; -}; - -type SourceInputV2 = { - request: SourceRequestV2; - source?: Source; -}; - -type SourceInputConversionResult = { - output?: T; - conversionError?: Error; -}; - -export { - ComparatorInput, - DeliveryJobState, - DeliveryV0Response, - DeliveryV1Response, - Connection, - Destination, - ErrorDetailer, - MessageIdMetadataMap, - MetaTransferObject, - Metadata, - ProcessorTransformationOutput, - ProcessorTransformationRequest, - ProcessorTransformationResponse, - ProxyMetdata, - ProxyRequest, - ProxyV0Request, - ProxyV1Request, - RouterTransformationRequest, - RouterTransformationRequestData, - RouterTransformationResponse, - RudderMessage, - SourceTransformationEvent, - SourceTransformationResponse, - UserDeletionRequest, - UserDeletionResponse, - SourceInput, - SourceInputV2, - SourceRequestV2, - Source, - SourceInputConversionResult, - UserTransformationLibrary, - UserTransformationResponse, - UserTransformationServiceResponse, -}; +export * from './rudderEvents'; +export * from './controlPlaneConfig'; +export * from './destinationTransformation'; +export * from './sourceTransformation'; +export * from './userTransformation'; +export * from './userRegulation'; +export * from './zodTypes'; diff --git a/src/types/rudderEvents.ts b/src/types/rudderEvents.ts new file mode 100644 index 00000000000..29ba4fe4787 --- /dev/null +++ b/src/types/rudderEvents.ts @@ -0,0 +1,91 @@ +import { z } from 'zod'; + +/** + * Supported message types in the event specification + */ +export const MessageTypeSchema = z.enum([ + 'identify', + 'track', + 'page', + 'screen', + 'group', + 'alias', + 'record', + 'audiencelist', +]); + +export type MessageType = z.infer; + +/** + * Core event message structure following Rudder event spec + */ + +export const RudderMessageSchema = z + .object({ + userId: z.string().optional(), + anonymousId: z.string().optional(), + type: MessageTypeSchema, + channel: z.string().optional(), + context: z.object({}).optional(), + originalTimestamp: z.string().optional(), + sentAt: z.string().optional(), + timestamp: z.string().optional(), + event: z.string().optional(), + integrations: z.object({}).optional(), + messageId: z.string().optional(), + properties: z.object({}).optional(), + traits: z.object({}).optional(), + statusCode: z.number().optional(), + }) + .passthrough(); + +export type RudderMessage = z.infer; + +export const RudderRecordV1Schema = z.object({ + type: z.literal('record'), +}); + +export type RudderRecordV1 = z.infer; + +/** + * Metadata structure for messages + */ +export const MetadataSchema = z + .object({ + sourceId: z.string(), + workspaceId: z.string(), + namespace: z.string().optional(), + instanceId: z.string().optional(), + sourceType: z.string(), + sourceCategory: z.string(), + trackingPlanId: z.string().optional(), + trackingPlanVersion: z.number().optional(), + sourceTpConfig: z.object({}).optional(), + mergedTpConfig: z.object({}).optional(), + destinationId: z.string(), + jobRunId: z.string().optional(), + jobId: z.number(), + sourceBatchId: z.string().optional(), + sourceJobId: z.string().optional(), + sourceJobRunId: z.string().optional(), + sourceTaskId: z.string().optional(), + sourceTaskRunId: z.string().optional(), + recordId: z.object({}).optional(), + destinationType: z.string(), + messageId: z.string(), + oauthAccessToken: z.string().optional(), + messageIds: z.array(z.string()).optional(), + rudderId: z.string().optional(), + receivedAt: z.string().optional(), + eventName: z.string().optional(), + eventType: z.string().optional(), + sourceDefinitionId: z.string().optional(), + destinationDefinitionId: z.string().optional(), + transformationId: z.string().optional(), + dontBatch: z.boolean().optional(), + }) + .passthrough(); + +export type Metadata = z.infer; + +export type MessageIdMetadataMap = Record>; diff --git a/src/types/sourceTransformation.ts b/src/types/sourceTransformation.ts new file mode 100644 index 00000000000..1ee569e4e6c --- /dev/null +++ b/src/types/sourceTransformation.ts @@ -0,0 +1,56 @@ +import type { CatchErr } from '../util/types'; +import type { Source } from './controlPlaneConfig'; +import type { RudderMessage } from './rudderEvents'; + +export type SourceTransformationEvent = { + headers?: Record; + query_params?: Record; + [key: string]: any; +}; + +export type SourceRequestV2 = { + method?: string; + url?: string; + proto?: string; + body: string; + headers?: Record; + query_parameters?: Record; +}; + +export type SourceInput = { + event: { + query_parameters?: any; + [key: string]: any; + }; + source?: Source; +}; + +export type SourceInputV2 = { + request: SourceRequestV2; + source?: Source; +}; + +export type SourceInputConversionResult = { + output?: T; + conversionError?: Error; +}; + +export type SourceTransformationOutput = { + batch: RudderMessage[]; +}; + +export type SourceTransformationSuccessResponse = { + output: SourceTransformationOutput; + statusCode: number; + outputToSource?: object; +}; + +export type SourceTransformationErrorResponse = { + error: CatchErr; + statusCode: number; + statTags: object; +}; + +export type SourceTransformationResponse = + | SourceTransformationSuccessResponse + | SourceTransformationErrorResponse; diff --git a/src/types/userRegulation.ts b/src/types/userRegulation.ts new file mode 100644 index 00000000000..a2390c7f9a4 --- /dev/null +++ b/src/types/userRegulation.ts @@ -0,0 +1,19 @@ +import type { FixMe } from '../util/types'; + +/** + * Types for user data regulation operations + */ +export type UserDeletionRequest = { + userAttributes: FixMe[]; + config: object; + destType: string; + jobId: string; +}; + +export type UserDeletionResponse = { + statusCode: number; + error?: string; + status?: string; + authErrorCategory: FixMe; + statTags: object; +}; diff --git a/src/types/userTransformation.ts b/src/types/userTransformation.ts new file mode 100644 index 00000000000..ec6b2ace370 --- /dev/null +++ b/src/types/userTransformation.ts @@ -0,0 +1,23 @@ +import type { CatchErr } from '../util/types'; +import type { Metadata, RudderMessage } from './rudderEvents'; +import type { ProcessorTransformationResponse } from './destinationTransformation'; + +/** + * Input structure for user transformations + */ +export type UserTransformationInput = { + VersionID: string; + ID: string; + Config: object; +}; + +export type UserTransformationResponse = { + transformedEvent: RudderMessage; + metadata: Metadata; + error: CatchErr; +}; + +export type UserTransformationServiceResponse = { + transformedEvents: ProcessorTransformationResponse[]; + retryStatus: number; +}; diff --git a/src/util/cluster.js b/src/util/cluster.js index b9b86cd3c61..6be25018f1d 100644 --- a/src/util/cluster.js +++ b/src/util/cluster.js @@ -28,6 +28,7 @@ async function shutdownWorkers() { } function start(port, app, metricsApp) { + if (cluster.isMaster) { logger.info(`Master (pid: ${process.pid}) has started`); @@ -44,7 +45,9 @@ function start(port, app, metricsApp) { // Fork workers. for (let i = 0; i < numWorkers; i += 1) { - cluster.fork(); + cluster.fork({ + WORKER_ID: `worker-${i + 1}`, + }); } cluster.on('online', (worker) => { diff --git a/src/util/common.js b/src/util/common.js index 8bf34f2eca2..5e601cd8ed3 100644 --- a/src/util/common.js +++ b/src/util/common.js @@ -24,6 +24,10 @@ const CommonUtils = { setDiff(mainSet, comparisionSet) { return [...mainSet].filter((item) => !comparisionSet.has(item)); }, + + isNonEmptyArray(array) { + return Array.isArray(array) && array.length > 0; + }, }; module.exports = { diff --git a/src/util/common.test.js b/src/util/common.test.js new file mode 100644 index 00000000000..0259c5411e8 --- /dev/null +++ b/src/util/common.test.js @@ -0,0 +1,151 @@ +const { CommonUtils } = require('./common'); + +describe('CommonUtils', () => { + describe('isNonEmptyArray', () => { + const testCases = [ + { name: 'array with numbers', input: [1, 2, 3], expected: true }, + { name: 'array with single string', input: ['a'], expected: true }, + { name: 'array with object', input: [{}], expected: true }, + { name: 'empty array', input: [], expected: false }, + { name: 'null', input: null, expected: false }, + { name: 'undefined', input: undefined, expected: false }, + { name: 'number', input: 42, expected: false }, + { name: 'string', input: 'string', expected: false }, + { name: 'object', input: {}, expected: false }, + { name: 'boolean', input: false, expected: false }, + ]; + + test.each(testCases)('$name', ({ input, expected }) => { + expect(CommonUtils.isNonEmptyArray(input)).toBe(expected); + }); + }); + + describe('objectDiff', () => { + const testCases = [ + { + name: 'different values in flat objects', + obj1: { a: 1, b: 2 }, + obj2: { a: 1, b: 3 }, + expected: { b: [2, 3] }, + }, + { + name: 'nested objects with differences', + obj1: { a: { b: 1, c: 2 }, d: 3 }, + obj2: { a: { b: 1, c: 3 }, d: 3 }, + expected: { 'a.c': [2, 3] }, + }, + { + name: 'missing keys in second object', + obj1: { a: 1, b: 2 }, + obj2: { a: 1 }, + expected: { b: [2, undefined] }, + }, + { + name: 'missing keys in first object', + obj1: { a: 1 }, + obj2: { a: 1, b: 2 }, + expected: { b: [undefined, 2] }, + }, + { + name: 'null inputs', + obj1: null, + obj2: { a: 1 }, + expected: { a: [undefined, 1] }, + }, + { + name: 'empty objects', + obj1: {}, + obj2: {}, + expected: {}, + }, + ]; + + test.each(testCases)('$name', ({ obj1, obj2, expected }) => { + expect(CommonUtils.objectDiff(obj1, obj2)).toEqual(expected); + }); + }); + + describe('toArray', () => { + const testCases = [ + { + name: 'existing array remains unchanged', + input: [1, 2, 3], + expected: [1, 2, 3], + }, + { + name: 'single number becomes array', + input: 42, + expected: [42], + }, + { + name: 'string becomes array', + input: 'test', + expected: ['test'], + }, + { + name: 'object becomes array', + input: { a: 1 }, + expected: [{ a: 1 }], + }, + { + name: 'null becomes array', + input: null, + expected: [null], + }, + { + name: 'undefined becomes array', + input: undefined, + expected: [undefined], + }, + ]; + + test.each(testCases)('$name', ({ input, expected }) => { + expect(CommonUtils.toArray(input)).toEqual(expected); + }); + }); + + describe('setDiff', () => { + const testCases = [ + { + name: 'sets with different elements', + mainSet: new Set([1, 2, 3]), + comparisonSet: new Set([2, 3, 4]), + expected: [1], + }, + { + name: 'identical sets', + mainSet: new Set([1, 2, 3]), + comparisonSet: new Set([1, 2, 3]), + expected: [], + }, + { + name: 'completely different sets', + mainSet: new Set([1, 2, 3]), + comparisonSet: new Set([4, 5, 6]), + expected: [1, 2, 3], + }, + { + name: 'empty comparison set', + mainSet: new Set([1, 2, 3]), + comparisonSet: new Set([]), + expected: [1, 2, 3], + }, + { + name: 'empty main set', + mainSet: new Set([]), + comparisonSet: new Set([1, 2, 3]), + expected: [], + }, + { + name: 'both empty sets', + mainSet: new Set([]), + comparisonSet: new Set([]), + expected: [], + }, + ]; + + test.each(testCases)('$name', ({ mainSet, comparisonSet, expected }) => { + expect(CommonUtils.setDiff(mainSet, comparisonSet)).toEqual(expected); + }); + }); +}); diff --git a/src/util/customTransformer-faas.js b/src/util/customTransformer-faas.js index 0f59f5db60f..d8bf556d893 100644 --- a/src/util/customTransformer-faas.js +++ b/src/util/customTransformer-faas.js @@ -34,7 +34,6 @@ function generateFunctionName(userTransformation, libraryVersionIds, testMode, h ids = ids.concat([hashSecret]); } - // FIXME: Why the id's are sorted ?! const hash = crypto.createHash('md5').update(`${ids}`).digest('hex'); return `fn-${userTransformation.workspaceId}-${hash}`.substring(0, 63).toLowerCase(); } diff --git a/src/util/dynamicConfig.js b/src/util/dynamicConfig.js index bdfebc87e87..a189141e1cd 100644 --- a/src/util/dynamicConfig.js +++ b/src/util/dynamicConfig.js @@ -3,30 +3,35 @@ const get = require('get-value'); const unset = require('unset-value'); function getDynamicConfigValue(event, value) { - // this regex checks for pattern "only spaces {{ path || defaultvalue }} only spaces" . - // " {{message.traits.key || \"email\" }} " - // " {{ message.traits.key || 1233 }} " - const defFormat = - /^\s*{{\s*(?[A-Z_a-z]\w*(?:\.[A-Z_a-z]\w*)+)\s*\|\|\s*(?.*)\s*}}\s*$/; - const matResult = value.match(defFormat); - if (matResult) { - // Support "event.." alias for "message.." - const fieldPath = matResult.groups.path.replace(/^event\.(.*)$/, 'message.$1'); - const pathVal = get(event, fieldPath); - if (pathVal) { - value = pathVal; - unset(event, fieldPath); - } else { - value = matResult.groups.defaultVal.replace(/"/g, '').trim(); + // Check if the value contains the "{{ }}" pattern + value = value.trim(); + if (value.startsWith(`{{`) && value.endsWith(`}}`)) { + // Remove the surrounding "{{ }}" and trim spaces + const innerContent = value.slice(2, -2).trim(); + + // Split the content by "||" to separate path and default value + const parts = innerContent.split('||').map((part) => part.trim()); + + // Ensure there are exactly two parts: path and default value + if (parts.length === 2) { + const [path, defaultVal] = parts; + + // Replace "event.." with "message.." + const fieldPath = path.startsWith('event.') ? path.replace(/^event\./, 'message.') : path; + + // Retrieve the value from the event object + const pathVal = get(event, fieldPath); + + // Use the path value if available, otherwise use the default value + if (pathVal) { + unset(event, fieldPath); // Remove the used path from the event object + return pathVal; + } + return defaultVal.replace(/"/g, '').trim(); // Clean up and use default value } - return value; } - /** var format2 = //; - matResult = value.match(format2); - if (matResult) { - - return value - } */ + + // Return the value unchanged if no "{{ }}" pattern or invalid format return value; } diff --git a/src/util/dynamicConfig.test.js b/src/util/dynamicConfig.test.js index 523f31ed10c..c500fa213a4 100644 --- a/src/util/dynamicConfig.test.js +++ b/src/util/dynamicConfig.test.js @@ -6,7 +6,7 @@ const reqType = 'processor'; describe(`${funcName} Tests`, () => { const funcTestData = getFuncTestData(__dirname, `./testdata/${funcName}.json`); - test.each(funcTestData)('$description', async ({ description, input, output }) => { + test.each(funcTestData)('$description', async ({ input, output }) => { let result; if (Array.isArray(input)) { result = processDynamicConfig(...input); diff --git a/src/util/eventValidation.js b/src/util/eventValidation.js index 46a494ee5ce..a009bc8f5cd 100644 --- a/src/util/eventValidation.js +++ b/src/util/eventValidation.js @@ -133,7 +133,7 @@ async function validate(event) { // UnPlanned event case - since no event schema is found. Violation is raised // Return this violation error only in case of track calls. - if (!eventSchema || eventSchema === {}) { + if (!eventSchema || Object.keys(eventSchema).length === 0) { if (event.message.type !== 'track') { return []; } @@ -173,7 +173,7 @@ async function validate(event) { let ajv = isDraft4 ? ajv4 : ajv19; const ajvCache = isDraft4 ? ajv4Cache : ajv19Cache; - if (merged !== {}) { + if (Object.keys(merged).length > 0) { const configHash = hash(merged); ajv = ajvCache.get(configHash); if (!ajv) { diff --git a/src/util/openfaas/index.js b/src/util/openfaas/index.js index 98f3340cad8..ec3604f066f 100644 --- a/src/util/openfaas/index.js +++ b/src/util/openfaas/index.js @@ -401,7 +401,7 @@ const executeFaasFunction = async ( throw new RetryRequestError(`Rate limit exceeded for ${name}`); } - if (error.statusCode === 500 || error.statusCode === 503) { + if (error.statusCode === 500 || error.statusCode === 503 || error.statusCode === 502) { throw new RetryRequestError(error.message); } diff --git a/src/util/prometheus.js b/src/util/prometheus.js index 2a3a1fb22a8..540dc6b807d 100644 --- a/src/util/prometheus.js +++ b/src/util/prometheus.js @@ -457,6 +457,24 @@ class Prometheus { type: 'counter', labelNames: ['event', 'writeKey'], }, + { + name: 'shopify_pixel_id_stitch_gaps', + help: 'shopify_pixel_id_stitch_gaps', + type: 'counter', + labelNames: ['event', 'reason', 'source', 'writeKey'], + }, + { + name: 'shopify_pixel_userid_mapping', + help: 'shopify_pixel_userid_mapping', + type: 'counter', + labelNames: ['action', 'operation'], + }, + { + name: 'shopify_pixel_cart_token_mapping', + help: 'shopify_pixel_cart_token_mapping', + type: 'counter', + labelNames: ['action', 'operation'], + }, { name: 'outgoing_request_count', help: 'Outgoing HTTP requests count', @@ -858,6 +876,18 @@ class Prometheus { { name: 'get_tracking_plan', help: 'get_tracking_plan', type: 'histogram', labelNames: [] }, // User transform metrics // counter + { + name: 'user_transform_input_events', + help: 'Number of input events to user transform', + type: 'counter', + labelNames: ['workspaceId'], + }, + { + name: 'user_transform_output_events', + help: 'user_transform_output_events', + type: 'counter', + labelNames: ['workspaceId'], + }, { name: 'user_transform_function_group_size', help: 'user_transform_function_group_size', @@ -948,20 +978,6 @@ class Prometheus { type: 'histogram', labelNames: ['identifier', 'transformationId', 'workspaceId'], }, - { - name: 'user_transform_input_events', - help: 'Number of input events to user transform', - type: 'histogram', - labelNames: [], - buckets: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 150, 200], - }, - { - name: 'user_transform_output_events', - help: 'user_transform_output_events', - type: 'histogram', - labelNames: [], - buckets: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 150, 200], - }, // summary { name: 'user_transform_request_latency_summary', diff --git a/src/util/stats.js b/src/util/stats.js index 6c42fc4b4d8..da937d5761b 100644 --- a/src/util/stats.js +++ b/src/util/stats.js @@ -1,9 +1,6 @@ -const statsd = require('./statsd'); const prometheus = require('./prometheus'); -const logger = require('../logger'); const enableStats = process.env.ENABLE_STATS !== 'false'; -const statsClientType = process.env.STATS_CLIENT || 'statsd'; // summary metrics are enabled by default. To disable set ENABLE_SUMMARY_METRICS='false'. const enableSummaryMetrics = process.env.ENABLE_SUMMARY_METRICS !== 'false'; @@ -13,22 +10,7 @@ function init() { return; } - switch (statsClientType) { - case 'statsd': - logger.info('setting up statsd client'); - statsClient = new statsd.Statsd(); - break; - - case 'prometheus': - logger.info('setting up prometheus client'); - statsClient = new prometheus.Prometheus(enableSummaryMetrics); - break; - - default: - logger.error( - `invalid stats client type: ${statsClientType}, supported values are 'statsd' and 'prometheues'`, - ); - } + statsClient = new prometheus.Prometheus(enableSummaryMetrics); } // Sends the diff between current time and start as the stat @@ -96,13 +78,7 @@ async function metricsController(ctx) { return; } - if (statsClientType === 'prometheus') { - await statsClient.metricsController(ctx); - return; - } - - ctx.status = 404; - ctx.body = `Not supported`; + await statsClient.metricsController(ctx); } async function resetMetricsController(ctx) { @@ -112,13 +88,7 @@ async function resetMetricsController(ctx) { return; } - if (statsClientType === 'prometheus') { - await statsClient.resetMetricsController(ctx); - return; - } - - ctx.status = 501; - ctx.body = `Not supported`; + await statsClient.resetMetricsController(ctx); } async function shutdownMetricsClient() { @@ -126,9 +96,7 @@ async function shutdownMetricsClient() { return; } - if (statsClientType === 'prometheus') { - await statsClient.shutdown(); - } + await statsClient.shutdown(); } init(); diff --git a/src/util/statsd.js b/src/util/statsd.js deleted file mode 100644 index 497b091f709..00000000000 --- a/src/util/statsd.js +++ /dev/null @@ -1,51 +0,0 @@ -const SDC = require('statsd-client'); - -const statsServerHost = process.env.STATSD_SERVER_HOST || 'localhost'; -const statsServerPort = parseInt(process.env.STATSD_SERVER_PORT || '8125', 10); -const instanceID = process.env.INSTANCE_ID || 'localhost'; - -class Statsd { - constructor() { - this.statsdClient = new SDC({ - host: statsServerHost, - port: statsServerPort, - prefix: 'transformer', - tags: { - instanceName: instanceID, - }, - }); - } - - // Sends the diff between current time and start as the stat - timing(name, start, tags = {}) { - this.statsdClient.timing(name, start, tags); - } - - // timingSummary is just a wrapper around timing for statsd.For prometheus, we will have to implement a different function. - timingSummary(name, start, tags = {}) { - this.statsdClient.timing(name, start, tags); - } - - // summary is just a wrapper around timing for statsd.For prometheus, we will have to implement a different function. - summary(name, value, tags = {}) { - this.statsdClient.timing(name, value, tags); - } - - increment(name, tags = {}) { - this.statsdClient.increment(name, 1, tags); - } - - counter(name, delta, tags = {}) { - this.statsdClient.counter(name, delta, tags); - } - - gauge(name, value, tags = {}) { - this.statsdClient.gauge(name, value, tags); - } - - histogram(name, value, tags = {}) { - this.statsdClient.histogram(name, value, tags); - } -} - -module.exports = { Statsd }; diff --git a/src/util/utils.js b/src/util/utils.js index 82c85b41a58..7f714a8b04b 100644 --- a/src/util/utils.js +++ b/src/util/utils.js @@ -44,35 +44,37 @@ const fetchAddressFromHostName = async (hostname) => { return { address, cacheHit: false }; }; -const staticLookup = (transformationTags) => async (hostname, _, cb) => { - let ip; - const resolveStartTime = new Date(); - try { - const { address, cacheHit } = await fetchAddressFromHostName(hostname); - ip = address; - stats.timing('fetch_dns_resolve_time', resolveStartTime, { ...transformationTags, cacheHit }); - } catch (error) { - logger.error(`DNS Error Code: ${error.code} | Message : ${error.message}`); - stats.timing('fetch_dns_resolve_time', resolveStartTime, { - ...transformationTags, - error: 'true', - }); - cb(null, `unable to resolve IP address for ${hostname}`, RECORD_TYPE_A); - return; - } - - if (!ip) { - cb(null, `resolved empty list of IP address for ${hostname}`, RECORD_TYPE_A); - return; - } - - if (ip.startsWith(LOCALHOST_OCTET)) { - cb(null, `cannot use ${ip} as IP address`, RECORD_TYPE_A); - return; - } - - cb(null, ip, RECORD_TYPE_A); -}; +const staticLookup = + (transformationTags, fetchAddress = fetchAddressFromHostName) => + (hostname, options, cb) => { + const resolveStartTime = new Date(); + + fetchAddress(hostname) + .then(({ address, cacheHit }) => { + stats.timing('fetch_dns_resolve_time', resolveStartTime, { + ...transformationTags, + cacheHit, + }); + + if (!address) { + cb(new Error(`resolved empty list of IP address for ${hostname}`), null); + } else if (address.startsWith(LOCALHOST_OCTET)) { + cb(new Error(`cannot use ${address} as IP address`), null); + } else if (options?.all) { + cb(null, [{ address, family: RECORD_TYPE_A }]); + } else { + cb(null, address, RECORD_TYPE_A); + } + }) + .catch((error) => { + logger.error(`DNS Error Code: ${error.code} | Message : ${error.message}`); + stats.timing('fetch_dns_resolve_time', resolveStartTime, { + ...transformationTags, + error: 'true', + }); + cb(new Error(`unable to resolve IP address for ${hostname}`), null); + }); + }; const httpAgentWithDnsLookup = (scheme, transformationTags) => { const httpModule = scheme === 'http' ? http : https; @@ -226,4 +228,5 @@ module.exports = { logProcessInfo, extractStackTraceUptoLastSubstringMatch, fetchWithDnsWrapper, + staticLookup, }; diff --git a/src/util/utils.test.js b/src/util/utils.test.js new file mode 100644 index 00000000000..ead605aab89 --- /dev/null +++ b/src/util/utils.test.js @@ -0,0 +1,61 @@ +const { staticLookup } = require('./utils'); + +describe('staticLookup', () => { + const transformationTags = { tag: 'value' }; + const RECORD_TYPE_A = 4; + const HOST_NAME = 'example.com'; + const fetchAddressFromHostName = jest.fn(); + + beforeEach(() => { + jest.clearAllMocks(); + }); + + const testCases = [ + { + name: 'should resolve the hostname and return the IP address', + mockResponse: { address: '192.168.1.1', cacheHit: true }, + expectedArgs: [null, '192.168.1.1', RECORD_TYPE_A], + }, + { + name: 'should resolve the hostname and return the IP address with all option', + options: { all: true }, + mockResponse: { address: '192.168.1.1', cacheHit: true }, + expectedArgs: [null, [{ address: '192.168.1.1', family: RECORD_TYPE_A }]], + }, + { + name: 'should handle errors from fetchAddressFromHostName', + mockResponse: { error: 'DNS error', errorCode: 'ENOTFOUND' }, + expectedArgs: [new Error(`unable to resolve IP address for ${HOST_NAME}`), null], + }, + { + name: 'should handle empty address', + mockResponse: { address: '', cacheHit: true }, + expectedArgs: [new Error(`resolved empty list of IP address for ${HOST_NAME}`), null], + }, + { + name: 'should handle localhost address', + mockResponse: { address: '127.0.0.1', cacheHit: true }, + expectedArgs: [new Error(`cannot use 127.0.0.1 as IP address`), null], + }, + ]; + + testCases.forEach(({ name, options, mockResponse, expectedArgs }) => { + it(name, async () => { + if (mockResponse.error) { + const error = new Error(mockResponse.error); + error.code = mockResponse.errorCode; + fetchAddressFromHostName.mockRejectedValueOnce(error); + } else { + fetchAddressFromHostName.mockResolvedValueOnce(mockResponse); + } + + const resolve = staticLookup(transformationTags, fetchAddressFromHostName); + const callback = (...args) => { + expect(fetchAddressFromHostName).toHaveBeenCalledWith(HOST_NAME); + expect(args).toEqual(expectedArgs); + }; + + resolve(HOST_NAME, options, callback); + }); + }); +}); diff --git a/src/util/worker.js b/src/util/worker.js index d1b7b24d969..df6cbf4984d 100644 --- a/src/util/worker.js +++ b/src/util/worker.js @@ -4,7 +4,7 @@ const { MESSAGE_TYPES } = require('./metricsAggregator'); const { AggregatorRegistry } = require('prom-client'); parentPort.on('message', async (message) => { - if ((message.type = MESSAGE_TYPES.AGGREGATE_METRICS_REQ)) { + if (message.type === MESSAGE_TYPES.AGGREGATE_METRICS_REQ) { try { const promString = await AggregatorRegistry.aggregate(message.metrics).metrics(); parentPort.postMessage({ type: MESSAGE_TYPES.AGGREGATE_METRICS_RES, metrics: promString }); diff --git a/src/v0/destinations/active_campaign/transform.js b/src/v0/destinations/active_campaign/transform.js index f21bb1a70d4..3fd5229c371 100644 --- a/src/v0/destinations/active_campaign/transform.js +++ b/src/v0/destinations/active_campaign/transform.js @@ -95,7 +95,7 @@ const customTagProcessor = async ({ message, destination, metadata }, category, // Step - 1 // Fetch already created tags from dest, so that we avoid duplicate tag creation request // Ref - https://developers.activecampaign.com/reference/retrieve-all-tags - endpoint = `${destination.Config.apiUrl}${`${tagEndPoint}?limit=100`}`; + endpoint = `${destination.Config.apiUrl}${tagEndPoint}?limit=100`; requestOptions = { headers: getHeader(destination), }; diff --git a/src/v0/destinations/adobe_analytics/transform.js b/src/v0/destinations/adobe_analytics/transform.js index 5d3d6e7d00f..ecc2fdd4573 100644 --- a/src/v0/destinations/adobe_analytics/transform.js +++ b/src/v0/destinations/adobe_analytics/transform.js @@ -340,7 +340,9 @@ const processTrackEvent = (message, adobeEventName, destinationConfig, extras = return { ...extras, events: overrideEventString || adobeEventArr.join(','), - products: overrideProductString || prodString, + products: + overrideProductString || + (Array.isArray(prodString) && prodString.length > 0 ? prodString : undefined), }; }; diff --git a/src/v0/destinations/adobe_analytics/utils.js b/src/v0/destinations/adobe_analytics/utils.js index ceba177ff14..e5196a30d48 100644 --- a/src/v0/destinations/adobe_analytics/utils.js +++ b/src/v0/destinations/adobe_analytics/utils.js @@ -97,6 +97,25 @@ function escapeToHTML(inputString) { ); } +/** + * Tries to find a value from alternative sources based on the source key. + * @param {Object} message - The input message object. + * @param {string} sourceKey - The key to look for. + * @returns {any} - The found value or null. + */ +function findValueFromSources(message, sourceKey) { + // Try alternative sources defined in SOURCE_KEYS + for (const source of SOURCE_KEYS) { + const value = getMappingFieldValueFormMessage(message, source, sourceKey); + if (isDefinedAndNotNull(value)) { + return value; + } + } + + // Fallback to value retrieval by path + return getValueByPath(message, sourceKey); +} + /** * This function is used for populating the eVars and hVars in the payload * @param {*} destVarMapping @@ -106,31 +125,28 @@ function escapeToHTML(inputString) { * @returns updated paylaod with eVars and hVars added */ function rudderPropToDestMap(destVarMapping, message, payload, destVarStrPrefix) { - const mappedVar = {}; - // pass the Rudder Property mapped in the ui whose evar you want to map - Object.keys(destVarMapping).forEach((key) => { - let val = get(message, `properties.${key}`); - if (isDefinedAndNotNull(val)) { - const destVarKey = destVarStrPrefix + destVarMapping[key]; - mappedVar[destVarKey] = escapeToHTML(val); - } else { - SOURCE_KEYS.some((sourceKey) => { - val = getMappingFieldValueFormMessage(message, sourceKey, key); - if (isDefinedAndNotNull(val)) { - mappedVar[`${destVarStrPrefix}${[destVarMapping[key]]}`] = escapeToHTML(val); - } else { - val = getValueByPath(message, key); - if (isDefinedAndNotNull(val)) { - mappedVar[`${destVarStrPrefix}${[destVarMapping[key]]}`] = escapeToHTML(val); - } - } - }); + const mappedVariables = {}; + + // Iterate over each key in the destination variable mapping + Object.keys(destVarMapping).forEach((sourceKey) => { + let value = message?.properties?.[sourceKey]; + + if (!isDefinedAndNotNull(value)) { + // Try getting the value from alternative sources + value = findValueFromSources(message, sourceKey); + } + + if (isDefinedAndNotNull(value)) { + const destinationKey = `${destVarStrPrefix}${destVarMapping[sourceKey]}`; + mappedVariables[destinationKey] = escapeToHTML(value); } }); - if (Object.keys(mappedVar).length > 0) { - // non-empty object - Object.assign(payload, mappedVar); + + // Add non-empty mapped variables to the payload + if (Object.keys(mappedVariables).length > 0) { + Object.assign(payload, mappedVariables); } + return payload; } diff --git a/src/v0/destinations/adobe_analytics/utils.test.js b/src/v0/destinations/adobe_analytics/utils.test.js new file mode 100644 index 00000000000..df40bf2ff31 --- /dev/null +++ b/src/v0/destinations/adobe_analytics/utils.test.js @@ -0,0 +1,271 @@ +const { + handleContextData, + handleEvar, + handleHier, + handleList, + handleCustomProperties, + stringifyValueAndJoinWithDelimiter, + escapeToHTML, +} = require('./utils'); // Update the path accordingly + +const { InstrumentationError } = require('@rudderstack/integrations-lib'); + +describe('handleContextData', () => { + it('should add context data to the payload when values are found', () => { + const payload = {}; + const destinationConfig = { + contextDataPrefix: 'c_', + contextDataMapping: { + 'user.id': 'userId', + 'user.email': 'userEmail', + }, + }; + const message = { + user: { + id: '123', + email: 'test@example.com', + }, + }; + + const result = handleContextData(payload, destinationConfig, message); + + expect(result.contextData).toEqual({ + c_userId: '123', + c_userEmail: 'test@example.com', + }); + }); + + it('should not add context data to the payload when no values are found', () => { + const payload = {}; + const destinationConfig = { + contextDataPrefix: 'c_', + contextDataMapping: { + 'user.id': 'userId', + 'user.email': 'userEmail', + }, + }; + const message = { + user: { + name: 'John Doe', + }, + }; + + const result = handleContextData(payload, destinationConfig, message); + + expect(result.contextData).toBeUndefined(); + }); +}); + +describe('handleEvar', () => { + it('should map properties to eVars in the payload', () => { + const payload = {}; + const destinationConfig = { + eVarMapping: { + productId: '1', + category: '2', + }, + }; + const message = { + properties: { + productId: 'p123', + category: 'electronics', + }, + }; + + const result = handleEvar(payload, destinationConfig, message); + + expect(result).toEqual({ + eVar1: 'p123', + eVar2: 'electronics', + }); + }); + + it('should not add eVars to the payload when no values are found', () => { + const payload = {}; + const destinationConfig = { + eVarMapping: { + productId: '1', + category: '2', + }, + }; + const message = { + properties: { + name: 'Product Name', + }, + }; + + const result = handleEvar(payload, destinationConfig, message); + + expect(result).toEqual({}); + }); +}); + +describe('handleHier', () => { + it('should map properties to hVars in the payload', () => { + const payload = {}; + const destinationConfig = { + hierMapping: { + section: '1', + subsection: '2', + }, + }; + const message = { + properties: { + section: 'home', + subsection: 'kitchen', + }, + }; + + const result = handleHier(payload, destinationConfig, message); + + expect(result).toEqual({ + hier1: 'home', + hier2: 'kitchen', + }); + }); + + it('should not add hVars to the payload when no values are found', () => { + const payload = {}; + const destinationConfig = { + hierMapping: { + section: '1', + subsection: '2', + }, + }; + const message = { + properties: { + name: 'Section Name', + }, + }; + + const result = handleHier(payload, destinationConfig, message); + + expect(result).toEqual({}); + }); +}); + +describe('handleList', () => { + it('should map properties to list variables in the payload', () => { + const payload = {}; + const destinationConfig = { + listMapping: { + products: '1', + }, + listDelimiter: { + products: ',', + }, + }; + const message = { + properties: { + products: ['p1', 'p2', 'p3'], + }, + }; + + const result = handleList(payload, destinationConfig, message); + + expect(result).toEqual({ + list1: 'p1,p2,p3', + }); + }); + + it('should throw an error when list properties are not strings or arrays', () => { + const payload = {}; + const destinationConfig = { + listMapping: { + products: '1', + }, + listDelimiter: { + products: ',', + }, + }; + const message = { + properties: { + products: 123, // Invalid type + }, + }; + + expect(() => handleList(payload, destinationConfig, message)).toThrow(InstrumentationError); + }); +}); + +describe('handleCustomProperties', () => { + it('should map properties to custom properties in the payload', () => { + const payload = {}; + const destinationConfig = { + customPropsMapping: { + color: '1', + size: '2', + }, + propsDelimiter: { + color: ',', + size: ';', + }, + }; + const message = { + properties: { + color: 'red,green,blue', + size: ['S', 'M', 'L'], + }, + }; + + const result = handleCustomProperties(payload, destinationConfig, message); + + expect(result).toEqual({ + prop1: 'red,green,blue', + prop2: 'S;M;L', + }); + }); + + it('should throw an error when custom properties are not strings or arrays', () => { + const payload = {}; + const destinationConfig = { + customPropsMapping: { + color: '1', + }, + propsDelimiter: { + color: ',', + }, + }; + const message = { + properties: { + color: 123, // Invalid type + }, + }; + + expect(() => handleCustomProperties(payload, destinationConfig, message)).toThrow( + InstrumentationError, + ); + }); +}); + +describe('stringifyValueAndJoinWithDelimiter', () => { + it('should join values with a delimiter after stringifying them', () => { + const values = [1, null, 'test', true]; + const result = stringifyValueAndJoinWithDelimiter(values, '|'); + + expect(result).toBe('1|null|test|true'); + }); + + it('should use the default delimiter if none is provided', () => { + const values = [1, 2, 3]; + const result = stringifyValueAndJoinWithDelimiter(values); + + expect(result).toBe('1;2;3'); + }); +}); + +describe('escapeToHTML', () => { + it('should escape HTML entities in a string', () => { + const input = '
&
'; + const result = escapeToHTML(input); + + expect(result).toBe('<div>&</div>'); + }); + + it('should return non-string values unchanged', () => { + const input = 123; + const result = escapeToHTML(input); + + expect(result).toBe(123); + }); +}); diff --git a/src/v0/destinations/af/deleteUsers.js b/src/v0/destinations/af/deleteUsers.js index e0da3699edd..ca956dc86fb 100644 --- a/src/v0/destinations/af/deleteUsers.js +++ b/src/v0/destinations/af/deleteUsers.js @@ -77,7 +77,7 @@ const userDeletionHandler = async (userAttributes, config) => { if (config.statusCallbackUrls) { const statusCallbackUrlsArray = config.statusCallbackUrls.split(','); const filteredStatusCallbackUrlsArray = statusCallbackUrlsArray.filter((statusCallbackUrl) => { - const URLRegex = /^(https?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w!#$&'()*+,/:;=?@[\]~-]+$/; + const URLRegex = /^(https?:\/\/)?[\w.-]+(\.[A-Za-z]{2,})+([#/?]\S*)?$/; return statusCallbackUrl.match(URLRegex); }); if (filteredStatusCallbackUrlsArray.length > 3) { diff --git a/src/v0/destinations/airship/transform.js b/src/v0/destinations/airship/transform.js index fcf18daa7ed..d2244b542a3 100644 --- a/src/v0/destinations/airship/transform.js +++ b/src/v0/destinations/airship/transform.js @@ -7,7 +7,6 @@ const { groupMapping, BASE_URL_EU, BASE_URL_US, - RESERVED_TRAITS_MAPPING, AIRSHIP_TRACK_EXCLUSION, } = require('./config'); @@ -25,6 +24,7 @@ const { convertToUuid, } = require('../../util'); const { JSON_MIME_TYPE } = require('../../util/constant'); +const { prepareAttributePayload, prepareTagPayload } = require('./utils'); const DEFAULT_ACCEPT_HEADER = 'application/vnd.urbanairship+json; version=3'; @@ -37,7 +37,7 @@ const transformSessionId = (rawSessionId) => { }; const identifyResponseBuilder = (message, { Config }) => { - const tagPayload = constructPayload(message, identifyMapping); + const initialTagPayload = constructPayload(message, identifyMapping); const { apiKey, dataCenter } = Config; if (!apiKey) @@ -55,38 +55,10 @@ const identifyResponseBuilder = (message, { Config }) => { } // Creating tags and attribute payload - tagPayload.add = { rudderstack_integration: [] }; - tagPayload.remove = { rudderstack_integration: [] }; - let timestamp = getFieldValueFromMessage(message, 'timestamp'); - timestamp = new Date(timestamp).toISOString().replace(/\.\d{3}/, ''); + const tagPayload = prepareTagPayload(traits, initialTagPayload); // Creating attribute payload - const attributePayload = { attributes: [] }; - Object.keys(traits).forEach((key) => { - // tags - if (typeof traits[key] === 'boolean') { - const tag = key.toLowerCase().replace(/\./g, '_'); - if (traits[key] === true) { - tagPayload.add.rudderstack_integration.push(tag); - } - if (traits[key] === false) { - tagPayload.remove.rudderstack_integration.push(tag); - } - } - // attribute - if (typeof traits[key] !== 'boolean') { - const attribute = { action: 'set' }; - const keyMapped = RESERVED_TRAITS_MAPPING[key.toLowerCase()]; - if (keyMapped) { - attribute.key = keyMapped; - } else { - attribute.key = key.replace(/\./g, '_'); - } - attribute.value = traits[key]; - attribute.timestamp = timestamp; - attributePayload.attributes.push(attribute); - } - }); + const attributePayload = prepareAttributePayload(traits, message); let tagResponse; let attributeResponse; @@ -149,7 +121,7 @@ const trackResponseBuilder = async (message, { Config }) => { } payload.name = name.replace(/\s+/g, '_'); - if (payload.value) { + if (payload.value && typeof payload.value === 'string') { payload.value.replace(/\s+/g, '_'); } const { appKey, dataCenter, apiKey } = Config; @@ -183,7 +155,7 @@ const trackResponseBuilder = async (message, { Config }) => { }; const groupResponseBuilder = (message, { Config }) => { - const tagPayload = constructPayload(message, groupMapping); + const initTagPayload = constructPayload(message, groupMapping); const { apiKey, dataCenter } = Config; if (!apiKey) @@ -200,37 +172,9 @@ const groupResponseBuilder = (message, { Config }) => { ); } - tagPayload.add = { rudderstack_integration_group: [] }; - tagPayload.remove = { rudderstack_integration_group: [] }; - let timestamp = getFieldValueFromMessage(message, 'timestamp'); - timestamp = new Date(timestamp).toISOString().replace(/\.\d{3}/, ''); - - const attributePayload = { attributes: [] }; - Object.keys(traits).forEach((key) => { - // tags - if (typeof traits[key] === 'boolean') { - const tag = key.toLowerCase().replace(/\./g, '_'); - if (traits[key] === true) { - tagPayload.add.rudderstack_integration_group.push(tag); - } - if (traits[key] === false) { - tagPayload.remove.rudderstack_integration_group.push(tag); - } - } - // attribute - if (typeof traits[key] !== 'boolean') { - const attribute = { action: 'set' }; - const keyMapped = RESERVED_TRAITS_MAPPING[key.toLowerCase()]; - if (keyMapped) { - attribute.key = keyMapped; - } else { - attribute.key = key.replace(/\./g, '_'); - } - attribute.value = traits[key]; - attribute.timestamp = timestamp; - attributePayload.attributes.push(attribute); - } - }); + const tagPayload = prepareTagPayload(traits, initTagPayload, 'group'); + + const attributePayload = prepareAttributePayload(traits, message); let tagResponse; let attributeResponse; diff --git a/src/v0/destinations/airship/utils.test.ts b/src/v0/destinations/airship/utils.test.ts new file mode 100644 index 00000000000..0ed77a6fa67 --- /dev/null +++ b/src/v0/destinations/airship/utils.test.ts @@ -0,0 +1,433 @@ +import { RudderMessage } from '../../../types'; +import { convertToUuid, flattenJson, getFieldValueFromMessage } from '../../util'; +import { getAirshipTimestamp, isValidTimestamp, prepareAttributePayload } from './utils'; + +type timestampTc = { + description: string; + input: string; + output?: string; + error?: string; +}; + +describe('Airship utils - getAirshipTimestamp', () => { + const timestampCases: timestampTc[] = [ + { + description: 'should return the same timestamp', + input: '2025-01-23T12:00:00Z', + output: '2025-01-23T12:00:00Z', + }, + { + description: 'should remove milliseconds', + input: '2025-01-23T12:00:00.123Z', + output: '2025-01-23T12:00:00Z', + }, + { + description: 'should remove milliseconds - 2', + input: '2025-01-23T12:00:00.123456Z', + output: '2025-01-23T12:00:00Z', + }, + { + description: 'should return with correct format when T is present but Z is not present', + input: '2025-01-23T12:00:00', + output: '2025-01-23T12:00:00Z', + }, + { + description: 'should return with correct format when T & Z is not present', + input: '2025-01-23 12:00:00', + output: '2025-01-23T12:00:00Z', + }, + { + description: 'should throw error when timestamp is not supported', + input: 'abcd', + error: 'timestamp is not supported: abcd', + }, + { + description: + 'should return with correct format when timestamp contains microseconds without Z', + input: '2025-01-23T12:00:00.123456', + output: '2025-01-23T12:00:00Z', + }, + ]; + + test.each(timestampCases)('getAirshipTimestamp - $description', ({ input, output, error }) => { + const message = { + timestamp: input, + } as RudderMessage; + if (error) { + expect(() => getAirshipTimestamp(message)).toThrow(error); + } else { + const timestamp = getAirshipTimestamp(message); + expect(timestamp).toBe(output); + } + }); +}); + +describe('Airship utils - prepareAttributePayload', () => { + const commonContextProps = { + app: { + build: '1', + name: 'Polarsteps', + namespace: 'com.polarsteps.Polarsteps', + version: '8.2.11', + }, + device: { + attTrackingStatus: 0, + id: '1d89c859-76c6-4374-ac0a-e32dee541e12', + manufacturer: 'Apple', + model: 'arm64', + name: 'iPhone 14 Pro Max', + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.31.0', + }, + locale: 'en-US', + network: { + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '17.0', + }, + screen: { + density: 3, + height: 932, + width: 430, + }, + sessionId: 1736246350, + timezone: 'Europe/Amsterdam', + }; + const commonEventProps = { + anonymousId: 'd00de6f3-2ea3-44bd-8fc5-0c318cb0b9d9', + channel: 'mobile', + messageId: 'b95d29ee-f9c8-486c-b9ef-acf231759612', + originalTimestamp: '2025-01-07T10:57:38.768Z', + receivedAt: '2025-01-07T10:57:49.882Z', + request_ip: '77.248.183.43', + rudderId: 'b931e94b-3b22-462c-8b58-243cb4b37366', + sentAt: '2025-01-07T10:57:47.707Z', + userId: '1c5577e3-8d2d-4ecd-9361-88c2bfb254c5', + }; + it('should return the correct attribute payload when jsonAttributes is not present in integrations object ', () => { + const message = { + ...commonEventProps, + context: { + ...commonContextProps, + traits: { + af_install_time: '2024-12-09 12:26:29.643', + af_status: 'Organic', + firstName: 'Orcun', + lastName: 'Test', + widgets_installed: ['no_widgets_installed', 'widgets_installed'], + }, + }, + event: 'identify', + integrations: { + All: true, + }, + type: 'identify', + }; + + const expectedAttributePayload = { + attributes: [ + { + action: 'set', + key: 'af_install_time', + value: '2024-12-09T12:26:29Z', + timestamp: '2025-01-07T10:57:38Z', + }, + { action: 'set', key: 'af_status', value: 'Organic', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'first_name', value: 'Orcun', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'last_name', value: 'Test', timestamp: '2025-01-07T10:57:38Z' }, + { + action: 'set', + key: 'widgets_installed[0]', + value: 'no_widgets_installed', + timestamp: '2025-01-07T10:57:38Z', + }, + { + action: 'set', + key: 'widgets_installed[1]', + value: 'widgets_installed', + timestamp: '2025-01-07T10:57:38Z', + }, + ], + }; + + const traits = getFieldValueFromMessage(message, 'traits'); + const flattenedTraits = flattenJson(traits); + // @ts-expect-error error with type + const attributePayload = prepareAttributePayload(flattenedTraits, message); + expect(attributePayload).toEqual(expectedAttributePayload); + }); + + it('should throw error when jsonAttributes is present in integrations object and jsonAttribute(widgets_installed#123) is array', () => { + const message = { + ...commonEventProps, + context: { + ...commonContextProps, + traits: { + af_install_time: '2024-12-09 12:26:29.643', + af_status: 'Organic', + firstName: 'Orcun', + lastName: 'Test', + widgets_installed: ['no_widgets_installed', 'widgets_installed'], + }, + }, + event: 'identify', + integrations: { + All: true, + AIRSHIP: { + JSONAttributes: { + 'widgets_installed#123': ['no_widgets_installed', 'widgets_installed'], + }, + }, + }, + type: 'identify', + }; + + const traits = getFieldValueFromMessage(message, 'traits'); + const flattenedTraits = flattenJson(traits); + // @ts-expect-error error with type + expect(() => prepareAttributePayload(flattenedTraits, message)).toThrow( + 'JsonAttribute as array is not supported for widgets_installed#123 in Airship', + ); + }); + + it('should return the correct attribute payload when jsonAttributes is present in integrations object and jsonAttribute(widgets_installed#123) is object', () => { + const message = { + ...commonEventProps, + context: { + ...commonContextProps, + traits: { + af_install_time: '2024-12-09 12:26:29.643', + af_status: 'Organic', + firstName: 'Orcun', + lastName: 'Test', + }, + }, + event: 'identify', + integrations: { + All: true, + AIRSHIP: { + JSONAttributes: { + 'widgets_installed#123': { + widgets: ['no_widgets_installed', 'widgets_installed'], + }, + }, + }, + }, + type: 'identify', + }; + + const expectedAttributePayload = { + attributes: [ + { + action: 'set', + key: 'af_install_time', + value: '2024-12-09T12:26:29Z', + timestamp: '2025-01-07T10:57:38Z', + }, + { action: 'set', key: 'af_status', value: 'Organic', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'first_name', value: 'Orcun', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'last_name', value: 'Test', timestamp: '2025-01-07T10:57:38Z' }, + { + action: 'set', + key: 'widgets_installed#123', + value: { + widgets: ['no_widgets_installed', 'widgets_installed'], + }, + timestamp: '2025-01-07T10:57:38Z', + }, + ], + }; + + const traits = getFieldValueFromMessage(message, 'traits'); + const flattenedTraits = flattenJson(traits); + // @ts-expect-error error with type + const attributePayload = prepareAttributePayload(flattenedTraits, message); + expect(attributePayload).toEqual(expectedAttributePayload); + }); + + it('should return the correct attribute payload when jsonAttributes is present in integrations object and jsonAttribute(data) is object & traits include an object', () => { + const message = { + ...commonEventProps, + context: { + ...commonContextProps, + traits: { + af_install_time: '2024-12-09 12:26:29.643', + af_status: 'Organic', + firstName: 'Orcun', + lastName: 'Test', + data: { + recordId: '123', + recordType: 'user', + }, + }, + }, + event: 'identify', + integrations: { + All: true, + AIRSHIP: { + JSONAttributes: { + 'widgets_installed#123': { + widgets: ['no_widgets_installed', 'widgets_installed'], + }, + }, + }, + }, + type: 'identify', + }; + + const expectedAttributePayload = { + attributes: [ + { + action: 'set', + key: 'af_install_time', + value: '2024-12-09T12:26:29Z', + timestamp: '2025-01-07T10:57:38Z', + }, + { action: 'set', key: 'af_status', value: 'Organic', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'first_name', value: 'Orcun', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'last_name', value: 'Test', timestamp: '2025-01-07T10:57:38Z' }, + { + action: 'set', + key: 'data_recordId', + value: '123', + timestamp: '2025-01-07T10:57:38Z', + }, + { + action: 'set', + key: 'data_recordType', + value: 'user', + timestamp: '2025-01-07T10:57:38Z', + }, + { + action: 'set', + key: 'widgets_installed#123', + value: { + widgets: ['no_widgets_installed', 'widgets_installed'], + }, + timestamp: '2025-01-07T10:57:38Z', + }, + ], + }; + + const traits = getFieldValueFromMessage(message, 'traits'); + const flattenedTraits = flattenJson(traits); + // @ts-expect-error error with type + const attributePayload = prepareAttributePayload(flattenedTraits, message); + expect(attributePayload).toEqual(expectedAttributePayload); + }); + + it('should return the correct attribute payload when jsonAttributes is present in integrations object and jsonAttribute(widgets_installed#123) is object & traits include an object', () => { + const message = { + ...commonEventProps, + context: { + ...commonContextProps, + traits: { + af_install_time: '2024-12-09 12:26:29.643', + af_status: 'Organic', + firstName: 'Orcun', + lastName: 'Test', + data: { + recordId: '123', + recordType: 'user', + }, + widgets_installed: ['no_widgets_installed', 'widgets_installed'], + }, + }, + event: 'identify', + integrations: { + All: true, + AIRSHIP: { + JSONAttributes: { + 'widgets_installed#123': { + widgets: ['no_widgets_installed', 'widgets_installed'], + }, + }, + }, + }, + type: 'identify', + }; + + const expectedAttributePayload = { + attributes: [ + { + action: 'set', + key: 'af_install_time', + value: '2024-12-09T12:26:29Z', + timestamp: '2025-01-07T10:57:38Z', + }, + { action: 'set', key: 'af_status', value: 'Organic', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'first_name', value: 'Orcun', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'last_name', value: 'Test', timestamp: '2025-01-07T10:57:38Z' }, + { + action: 'set', + key: 'data_recordId', + value: '123', + timestamp: '2025-01-07T10:57:38Z', + }, + { + action: 'set', + key: 'data_recordType', + value: 'user', + timestamp: '2025-01-07T10:57:38Z', + }, + { + action: 'set', + key: 'widgets_installed#123', + value: { + widgets: ['no_widgets_installed', 'widgets_installed'], + }, + timestamp: '2025-01-07T10:57:38Z', + }, + ], + }; + + const traits = getFieldValueFromMessage(message, 'traits'); + const flattenedTraits = flattenJson(traits); + // @ts-expect-error error with type + const attributePayload = prepareAttributePayload(flattenedTraits, message); + expect(attributePayload).toEqual(expectedAttributePayload); + }); +}); + +describe('Airship utils - isValidTimestamp', () => { + it('should return true when timestamp is a valid Unix timestamp', () => { + const timestamp = 1736246350; + expect(isValidTimestamp(timestamp)).toBe(true); + }); + + it('should return true when timestamp is a valid Unix timestamp with milliseconds', () => { + const timestamp = 1736246350 * 1000; + expect(isValidTimestamp(timestamp)).toBe(true); + }); + + it('should return true when timestamp is a valid date string', () => { + const timestamp = '2025-01-23T12:00:00Z'; + expect(isValidTimestamp(timestamp)).toBe(true); + }); + + it('should return false when timestamp is not a valid Unix timestamp or date string(invalid_timestamp)', () => { + const timestamp = 'invalid_timestamp'; + expect(isValidTimestamp(timestamp)).toBe(false); + }); + + it('should return false when timestamp is not a valid Unix timestamp or date string(uuid)', () => { + const timestamp = convertToUuid('invalid_timestamp'); + expect(isValidTimestamp(timestamp)).toBe(false); + }); + + it('should return false when timestamp is not a valid Unix timestamp or date string(91504)', () => { + const timestamp = 91504; + expect(isValidTimestamp(timestamp)).toBe(false); + }); + + it('should return false when timestamp is not a valid Unix timestamp or date string("91504")', () => { + const timestamp = '91504'; + expect(isValidTimestamp(timestamp)).toBe(false); + }); +}); diff --git a/src/v0/destinations/airship/utils.ts b/src/v0/destinations/airship/utils.ts new file mode 100644 index 00000000000..d8c48fa2d04 --- /dev/null +++ b/src/v0/destinations/airship/utils.ts @@ -0,0 +1,209 @@ +import moment from 'moment'; +import { InstrumentationError } from '@rudderstack/integrations-lib'; +import { RudderMessage } from '../../../types'; +import { getFieldValueFromMessage, getIntegrationsObj } from '../../util'; +import { RESERVED_TRAITS_MAPPING } from './config'; + +export type TagPayloadEventType = 'identify' | 'group'; + +type AirshipTagProperties = { + identify: 'rudderstack_integration'; + group: 'rudderstack_integration_group'; +}; + +const AIRSHIP_TAG_PROPERTIES: Record = { + identify: 'rudderstack_integration', + group: 'rudderstack_integration_group', +}; + +type AirshipTag = { + [K in keyof Pick]: string[]; +}; + +type TagPayload = { + add: AirshipTag[T]; + remove: AirshipTag[T]; + [key: string]: unknown; +}; + +type AttributeValue = string | number | object; + +type Attribute = { + action: 'set' | 'remove'; + key: string; + value?: AttributeValue; + timestamp: string; +}; + +type AttributePayload = { + attributes: Attribute[]; +}; + +type AirshipIntegrationsObj = { + JSONAttributes: Record; + removeAttributes: string[]; +}; + +type AirshipObjectAttributes = Partial<{ + jsonAttributes: Attribute[]; + removeAttributes: Omit[]; +}>; + +const getDigitCount = (num: number): number => Math.floor(Math.log10(Math.abs(num))) + 1; + +export const isValidTimestamp = (timestamp: string | number): boolean => { + // Check if timestamp is a valid Unix timestamp (10 digits) + if (typeof timestamp === 'number' || !Number.isNaN(Number(timestamp))) { + return getDigitCount(Number(timestamp)) >= 10; + } + + // Check if timestamp is a valid date string + const date = moment.utc(timestamp); + return date.isValid() && date.year() >= 1970; +}; + +// Airship timestamp format: https://docs.airship.com/api/ua/#api-request-format +const AIRSHIP_TIMESTAMP_FORMAT = 'YYYY-MM-DD[T]HH:mm:ss[Z]'; + +const convertToAirshipTimestamp = (timestamp: string) => { + if (!timestamp || !moment(timestamp).isValid()) { + throw new InstrumentationError(`timestamp is not supported: ${timestamp}`); + } + return moment.utc(timestamp).format(AIRSHIP_TIMESTAMP_FORMAT); +}; + +export const getAirshipTimestamp = (message: RudderMessage) => { + const timestamp = getFieldValueFromMessage(message, 'timestamp'); + return convertToAirshipTimestamp(timestamp); +}; + +export const prepareTagPayload = ( + flattenedTraits: Record, + initTagPayload: TagPayload, + eventType: TagPayloadEventType = 'identify', +): TagPayload => { + const property = AIRSHIP_TAG_PROPERTIES[eventType]; + const initialTagPayload: TagPayload = { + ...initTagPayload, + add: { + [property]: [], + } as unknown as AirshipTag[TagPayloadEventType], + remove: { + [property]: [], + } as unknown as AirshipTag[TagPayloadEventType], + }; + + const tagPayload = Object.entries(flattenedTraits).reduce((acc, [key, value]) => { + // tags + if (typeof value === 'boolean') { + const tag = key.toLowerCase().replace(/\./g, '_'); + if (value === true) { + acc.add[property].push(tag); + } + if (value === false) { + acc.remove[property].push(tag); + } + } + return acc; + }, initialTagPayload); + return tagPayload; +}; + +const getJsonAttributesFromIntegrationsObj = (message: RudderMessage): AirshipObjectAttributes => { + const integrationsObj = getIntegrationsObj( + message, + 'airship' as any, + ) as Partial; + const timestamp = getAirshipTimestamp(message); + const airshipObjectAttributes: AirshipObjectAttributes = {}; + if (integrationsObj?.JSONAttributes) { + airshipObjectAttributes.jsonAttributes = Object.entries(integrationsObj.JSONAttributes).map( + ([key, value]) => { + // object attribute type in Airship: https://docs.airship.com/api/ua/#schemas-setattributeobject + if (Array.isArray(value)) { + throw new InstrumentationError( + `JsonAttribute as array is not supported for ${key} in Airship`, + ); + } + return { + action: 'set', + key, + value: value as AttributeValue, + timestamp, + }; + }, + ); + } + if (integrationsObj?.removeAttributes) { + // Remove Attributes in Airship: https://docs.airship.com/api/ua/#schemas-removeattributeobject + airshipObjectAttributes.removeAttributes = integrationsObj.removeAttributes.map((key) => ({ + action: 'remove', + key, + timestamp, + })); + } + return airshipObjectAttributes; +}; + +export const getAttributeValue = (value: string | number | object): AttributeValue => { + if (isValidTimestamp(value as string)) { + return convertToAirshipTimestamp(value as string); + } + return value as AttributeValue; +}; + +export const prepareAttributePayload = ( + flattenedTraits: Record, + message: RudderMessage, +): AttributePayload => { + const timestamp = getAirshipTimestamp(message); + const initialAttributePayload: AttributePayload = { attributes: [] }; + const airshipObjectAttributes: AirshipObjectAttributes = + getJsonAttributesFromIntegrationsObj(message); + + const isJsonAttributesPresent = + Array.isArray(airshipObjectAttributes?.jsonAttributes) && + airshipObjectAttributes?.jsonAttributes.length > 0; + + const attributePayload = Object.entries(flattenedTraits).reduce((acc, [key, value]) => { + // attribute + if (typeof value !== 'boolean') { + const attribute: Attribute = { action: 'set', key: '', value: '', timestamp }; + const keyMapped = RESERVED_TRAITS_MAPPING[key] || RESERVED_TRAITS_MAPPING[key.toLowerCase()]; + const isKeyObjectType = key.includes('.') || (key.includes('[') && key.includes(']')); + if (keyMapped) { + attribute.key = keyMapped; + } else { + attribute.key = key.replace(/\./g, '_'); + } + if (isJsonAttributesPresent && isKeyObjectType) { + // Skip these keys + // they can be in the form of an array or object + const keyParts = key?.split(/[[\]_]+/g) || []; + if (keyParts.length === 0) { + // If key doesn't include any of the delimiters like '[' or ']' or '_' , skip it + return acc; + } + // Skip keys that exist in both traits and integrations object to avoid duplication + const isKeyPresentInJsonAttributes = airshipObjectAttributes.jsonAttributes?.some((attr) => + attr.key.includes(keyParts[0]), + ); + if (isKeyPresentInJsonAttributes) { + // Skip this key + return acc; + } + } + attribute.value = getAttributeValue(value as AttributeValue); + acc.attributes.push(attribute); + } + return acc; + }, initialAttributePayload); + + attributePayload.attributes = [ + ...attributePayload.attributes, + ...(airshipObjectAttributes?.jsonAttributes || []), + ...(airshipObjectAttributes?.removeAttributes || []), + ]; + + return attributePayload; +}; diff --git a/src/v0/destinations/am/deleteUsers.js b/src/v0/destinations/am/deleteUsers.js index 96c4f7b19c7..1fde1c4142e 100644 --- a/src/v0/destinations/am/deleteUsers.js +++ b/src/v0/destinations/am/deleteUsers.js @@ -16,7 +16,7 @@ const userDeletionHandler = async (userAttributes, config) => { if (!config) { throw new ConfigurationError('Config for deletion not present'); } - const { apiKey, apiSecret } = config; + const { apiKey, apiSecret, residencyServer } = config; if (!apiKey || !apiSecret) { throw new ConfigurationError('api key/secret for deletion not present'); } @@ -27,7 +27,10 @@ const userDeletionHandler = async (userAttributes, config) => { }; // Ref : https://www.docs.developers.amplitude.com/analytics/apis/user-privacy-api/#response const batchEvents = getUserIdBatches(userAttributes, DELETE_MAX_BATCH_SIZE); - const url = 'https://amplitude.com/api/2/deletions/users'; + const url = + residencyServer === 'EU' + ? 'https://analytics.eu.amplitude.com/api/2/deletions/users' + : 'https://amplitude.com/api/2/deletions/users'; const endpointPath = '/api/2/deletions/users'; await Promise.all( batchEvents.map(async (batch) => { diff --git a/src/v0/destinations/am/networkHandler.js b/src/v0/destinations/am/networkHandler.js new file mode 100644 index 00000000000..0e9dc42b8c2 --- /dev/null +++ b/src/v0/destinations/am/networkHandler.js @@ -0,0 +1,60 @@ +const { ThrottledError, AbortedError, RetryableError } = require('@rudderstack/integrations-lib'); +const { processAxiosResponse } = require('../../../adapters/utils/networkUtils'); +const { prepareProxyRequest, proxyRequest } = require('../../../adapters/network'); +const { isHttpStatusSuccess, isHttpStatusRetryable } = require('../../util'); +const logger = require('../../../logger'); +const { DESTINATION } = require('./config'); + +class NetworkHandler { + constructor() { + this.prepareProxyRequest = prepareProxyRequest; + this.proxy = proxyRequest; + this.processAxiosResponse = processAxiosResponse; + } + + responseHandler(responseParams) { + const { destinationResponse } = responseParams; + const message = `[${DESTINATION} Response Handler] - Request Processed Successfully`; + const { status, response } = destinationResponse; + if (isHttpStatusSuccess(status)) { + const { error, code, throttled_users: throttledUsers } = response; + if (code === 429) { + // log the error when throttled_users in response > 0 and throw a RetryableError + if (Object.keys(throttledUsers).length > 0) { + logger.error('Too many requests for some devices and users.'); + throw new RetryableError( + `Request Failed during ${DESTINATION} response transformation: ${error} - due to Request Limit exceeded, (Retryable)`, + 500, + destinationResponse, + ); + } + // throw a ThrottledError in other 429 cases + throw new ThrottledError( + `Request Failed during ${DESTINATION} response transformation: ${error} - due to Request Limit exceeded, (Throttled)`, + destinationResponse, + ); + } + return { + destinationResponse: JSON.stringify(response), + message, + status, + }; + } + if (isHttpStatusRetryable(status)) { + throw new RetryableError( + `Request Failed during ${DESTINATION} response transformation: with status "${status}" due to "${JSON.stringify(response)}", (Retryable)`, + 500, + destinationResponse, + ); + } + throw new AbortedError( + `Request Failed during ${DESTINATION} response transformation: with status "${status}" due to "${JSON.stringify(response)}", (Aborted)`, + 400, + destinationResponse, + ); + } +} + +module.exports = { + NetworkHandler, +}; diff --git a/src/v0/destinations/branch/data/eventMapping.js b/src/v0/destinations/branch/data/eventMapping.js index 84ae1a07af4..abab6a29932 100644 --- a/src/v0/destinations/branch/data/eventMapping.js +++ b/src/v0/destinations/branch/data/eventMapping.js @@ -40,6 +40,7 @@ const CommerceEventConfig = { 'Spend Credits': 'SPEND_CREDITS', 'Promotion Viewed': 'VIEW_AD', 'Promotion Clicked': 'CLICK_AD', + Purchase: 'PURCHASE', Reserve: 'RESERVE', }, event_data: ['transaction_id', 'currency', 'revenue', 'shipping', 'tax', 'coupon', 'description'], diff --git a/src/v0/destinations/branch/transform.js b/src/v0/destinations/branch/transform.js index 2626d8aa812..8362f10723a 100644 --- a/src/v0/destinations/branch/transform.js +++ b/src/v0/destinations/branch/transform.js @@ -46,17 +46,16 @@ function getCategoryAndName(rudderEventName) { let requiredName = null; let requiredCategory = null; // eslint-disable-next-line array-callback-return, sonarjs/no-ignored-return - Object.keys(category.name).find((branchKey) => { + Object.keys(category.name).forEach((branchKey) => { if ( typeof branchKey === 'string' && typeof rudderEventName === 'string' && - branchKey.toLowerCase() === rudderEventName.toLowerCase() + (branchKey.toLowerCase() === rudderEventName.toLowerCase() || + category.name[branchKey].toLowerCase() === rudderEventName.toLowerCase()) ) { requiredName = category.name[branchKey]; requiredCategory = category; - return true; } - return false; }); if (requiredName != null && requiredCategory != null) { return { evName: requiredName, category: requiredCategory }; @@ -116,14 +115,12 @@ function mapPayload(category, rudderProperty, rudderPropertiesObj) { let valFound = false; if (category.content_items) { // eslint-disable-next-line sonarjs/no-ignored-return - Object.keys(category.content_items).find((branchMappingProperty) => { + Object.keys(category.content_items).forEach((branchMappingProperty) => { if (branchMappingProperty === rudderProperty) { const tmpKeyName = category.content_items[branchMappingProperty]; contentItems[tmpKeyName] = rudderPropertiesObj[rudderProperty]; valFound = true; - return true; } - return false; }); } @@ -217,16 +214,17 @@ function getCommonPayload(message, category, evName) { function processMessage(message, destination) { let evName; let category; + let updatedEventName = message.event; switch (message.type) { case EventType.TRACK: { if (!message.event) { throw new InstrumentationError('Event name is required'); } - ({ evName, category } = getCategoryAndName(message.event)); const eventNameFromConfig = getMappedEventNameFromConfig(message, destination); if (eventNameFromConfig) { - evName = eventNameFromConfig; + updatedEventName = eventNameFromConfig; } + ({ evName, category } = getCategoryAndName(updatedEventName)); break; } case EventType.IDENTIFY: diff --git a/src/v0/destinations/braze/braze.util.test.js b/src/v0/destinations/braze/braze.util.test.js index 6fe4dbbb44e..8e0725a8543 100644 --- a/src/v0/destinations/braze/braze.util.test.js +++ b/src/v0/destinations/braze/braze.util.test.js @@ -7,12 +7,14 @@ const { setAliasObject, handleReservedProperties, combineSubscriptionGroups, + getEndpointFromConfig, } = require('./util'); const { processBatch } = require('./util'); const { removeUndefinedAndNullValues, removeUndefinedAndNullAndEmptyValues, } = require('../../util'); +const { generateRandomString } = require('@rudderstack/integrations-lib'); // Mock the handleHttpRequest function jest.mock('../../../adapters/network'); @@ -255,7 +257,7 @@ describe('dedup utility tests', () => { enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'test-rest-api-key', + restApiKey: generateRandomString(), supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -321,7 +323,7 @@ describe('dedup utility tests', () => { }, { headers: { - Authorization: 'Bearer test-rest-api-key', + Authorization: `Bearer ${destination.Config.restApiKey}`, }, timeout: 10000, }, @@ -341,7 +343,8 @@ describe('dedup utility tests', () => { ID: 'some-destination-id', Name: 'Test Destination', Config: { - restApiKey: 'test-rest-api-key', + restApiKey: generateRandomString(), + dataCenter: 'EU-01', }, }; @@ -433,6 +436,7 @@ describe('dedup utility tests', () => { Name: 'Test Destination', Config: { restApiKey: 'test_rest_api_key', + dataCenter: 'EU-01', }, }; const chunks = [ @@ -1879,3 +1883,55 @@ describe('combineSubscriptionGroups', () => { expect(result).toEqual(expectedOutput); }); }); + +describe('getEndpointFromConfig', () => { + const testCases = [ + { + name: 'returns correct EU endpoint', + input: { Config: { dataCenter: 'EU-02' } }, + expected: 'https://rest.fra-02.braze.eu', + }, + { + name: 'returns correct US endpoint', + input: { Config: { dataCenter: 'US-03' } }, + expected: 'https://rest.iad-03.braze.com', + }, + { + name: 'returns correct AU endpoint', + input: { Config: { dataCenter: 'AU-01' } }, + expected: 'https://rest.au-01.braze.com', + }, + { + name: 'handles lowercase input correctly', + input: { Config: { dataCenter: 'eu-03' } }, + expected: 'https://rest.fra-03.braze.eu', + }, + { + name: 'handles whitespace in input', + input: { Config: { dataCenter: ' US-02 ' } }, + expected: 'https://rest.iad-02.braze.com', + }, + { + name: 'throws error for empty dataCenter', + input: { Config: {} }, + throws: true, + errorMessage: 'Invalid Data Center: valid values are EU, US, AU', + }, + { + name: 'throws error for invalid region', + input: { Config: { dataCenter: 'INVALID-01' } }, + throws: true, + errorMessage: 'Invalid Data Center: INVALID-01, valid values are EU, US, AU', + }, + ]; + + testCases.forEach(({ name, input, expected, throws, errorMessage }) => { + test(name, () => { + if (throws) { + expect(() => getEndpointFromConfig(input)).toThrow(errorMessage); + } else { + expect(getEndpointFromConfig(input)).toBe(expected); + } + }); + }); +}); diff --git a/src/v0/destinations/braze/util.js b/src/v0/destinations/braze/util.js index 74cb7fb9533..ffc0905960c 100644 --- a/src/v0/destinations/braze/util.js +++ b/src/v0/destinations/braze/util.js @@ -30,19 +30,28 @@ const { removeUndefinedValues, getIntegrationsObj } = require('../../util'); const { InstrumentationError, isDefined } = require('@rudderstack/integrations-lib'); const getEndpointFromConfig = (destination) => { - // Init -- mostly for test cases - let endpoint = 'https://rest.fra-01.braze.eu'; + if (!destination.Config?.dataCenter || typeof destination.Config.dataCenter !== 'string') { + throw new InstrumentationError('Invalid Data Center: valid values are EU, US, AU'); + } // Ref: https://www.braze.com/docs/user_guide/administrative/access_braze/braze_instances - if (destination.Config.dataCenter) { - const dataCenterArr = destination.Config.dataCenter.trim().split('-'); - if (dataCenterArr[0].toLowerCase() === 'eu') { - endpoint = `https://rest.fra-${dataCenterArr[1]}.braze.eu`; - } else { - endpoint = `https://rest.iad-${dataCenterArr[1]}.braze.com`; - } + const [dataCenterRegion, dataCenterNumber] = destination.Config.dataCenter + .trim() + .toLowerCase() + .split('-'); + + switch (dataCenterRegion) { + case 'eu': + return `https://rest.fra-${dataCenterNumber}.braze.eu`; + case 'us': + return `https://rest.iad-${dataCenterNumber}.braze.com`; + case 'au': + return `https://rest.au-${dataCenterNumber}.braze.com`; + default: + throw new InstrumentationError( + `Invalid Data Center: ${destination.Config.dataCenter}, valid values are EU, US, AU`, + ); } - return endpoint; }; // Merges external_ids, emails, and phones for entries with the same subscription_group_id and subscription_state @@ -771,7 +780,7 @@ const collectStatsForAliasFailure = (brazeResponse, destinationId) => { if (!isDefinedAndNotNull(brazeResponse)) { return; } - const { aliases_processed: aliasesProcessed, errors } = brazeResponse; + const { aliases_processed: aliasesProcessed } = brazeResponse; if (aliasesProcessed === 0) { stats.increment('braze_alias_failure_count', { destination_id: destinationId }); } diff --git a/src/v0/destinations/clevertap/transform.js b/src/v0/destinations/clevertap/transform.js index e558b119f15..ee190246de5 100644 --- a/src/v0/destinations/clevertap/transform.js +++ b/src/v0/destinations/clevertap/transform.js @@ -404,7 +404,6 @@ const process = (event) => processEvent(event.message, event.destination); const processRouterDest = (inputs, reqMetadata) => { const eventsChunk = []; const errorRespList = []; - // const { destination } = inputs[0]; inputs.forEach((event) => { try { diff --git a/src/v0/destinations/clickup/util.js b/src/v0/destinations/clickup/util.js index 5da4192b5bb..55923b29538 100644 --- a/src/v0/destinations/clickup/util.js +++ b/src/v0/destinations/clickup/util.js @@ -1,4 +1,5 @@ const { NetworkError, InstrumentationError } = require('@rudderstack/integrations-lib'); +const validator = require('validator'); const { httpGET } = require('../../../adapters/network'); const { processAxiosResponse, @@ -9,6 +10,7 @@ const { getHashFromArrayWithValueAsObject, formatTimeStamp, } = require('../../util'); + const { getCustomFieldsEndPoint } = require('./config'); const tags = require('../../util/tags'); const { JSON_MIME_TYPE } = require('../../util/constant'); @@ -44,9 +46,7 @@ const validatePhoneWithCountryCode = (phone) => { * @param {*} email */ const validateEmail = (email) => { - const regex = - /^(([^\s"(),.:;<>@[\\\]]+(\.[^\s"(),.:;<>@[\\\]]+)*)|(".+"))@((\[(?:\d{1,3}\.){3}\d{1,3}])|(([\dA-Za-z-]+\.)+[A-Za-z]{2,}))$/; - if (!regex.test(email)) { + if (!validator.isEmail(email)) { throw new InstrumentationError('The provided email is invalid'); } }; @@ -56,7 +56,7 @@ const validateEmail = (email) => { * @param {*} url */ const validateUrl = (url) => { - const regex = /^(https?:\/\/)[\w.-]+(?:\.[\w.-]+)+[\w!#$&'()*+,/:;=?@[\]~-]+$/; + const regex = /^https?:\/\/[\w.-]+(\.[A-Za-z]{2,})+([#/?]\S*)?$/; if (!regex.test(url)) { throw new InstrumentationError('The provided url is invalid'); } diff --git a/src/v0/destinations/customerio/util.js b/src/v0/destinations/customerio/util.js index cadad5620ce..d5696123b04 100644 --- a/src/v0/destinations/customerio/util.js +++ b/src/v0/destinations/customerio/util.js @@ -1,6 +1,7 @@ const get = require('get-value'); const set = require('set-value'); const truncate = require('truncate-utf8-bytes'); +const validator = require('validator'); const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib'); const { MAX_BATCH_SIZE, configFieldsToCheck } = require('./config'); const { @@ -10,7 +11,6 @@ const { getFieldValueFromMessage, defaultDeleteRequestConfig, isAppleFamily, - validateEmail, } = require('../../util'); const { EventType, SpecedTraits, TraitsMapping } = require('../../../constants'); @@ -166,26 +166,19 @@ const identifyResponseBuilder = (userId, message) => { const aliasResponseBuilder = (message, userId) => { // ref : https://customer.io/docs/api/#operation/merge - if (!userId && !message.previousId) { - throw new InstrumentationError('Both userId and previousId is mandatory for merge operation'); + if (!userId || !message.previousId) { + throw new InstrumentationError('Both userId and previousId are mandatory for merge operation'); } const endpoint = MERGE_USER_ENDPOINT; const requestConfig = defaultPostRequestConfig; - let cioProperty = 'id'; - if (validateEmail(userId)) { - cioProperty = 'email'; - } - // eslint-disable-next-line @typescript-eslint/naming-convention - let prev_cioProperty = 'id'; - if (validateEmail(message.previousId)) { - prev_cioProperty = 'email'; - } + const cioProperty = validator.isEmail(userId) ? 'email' : 'id'; + const prevCioProperty = validator.isEmail(message.previousId) ? 'email' : 'id'; const rawPayload = { primary: { [cioProperty]: userId, }, secondary: { - [prev_cioProperty]: message.previousId, + [prevCioProperty]: message.previousId, }, }; @@ -208,11 +201,8 @@ const groupResponseBuilder = (message) => { cio_relationships: [], }; const id = payload?.userId || payload?.email; - let cioProperty = 'id'; - if (validateEmail(id)) { - cioProperty = 'email'; - } if (id) { + const cioProperty = validator.isEmail(id) ? 'email' : 'id'; rawPayload.cio_relationships.push({ identifiers: { [cioProperty]: id } }); } const requestConfig = defaultPostRequestConfig; diff --git a/src/v0/destinations/customerio/util.test.js b/src/v0/destinations/customerio/util.test.js index 2c308cd262d..ee36bd3f1be 100644 --- a/src/v0/destinations/customerio/util.test.js +++ b/src/v0/destinations/customerio/util.test.js @@ -8,6 +8,7 @@ const { const getTestMessage = () => { let message = { anonymousId: 'anonId', + previousId: 'user0', traits: { email: 'abc@test.com', name: 'rudder', @@ -133,7 +134,7 @@ describe('Unit test cases for customerio aliasResponseBuilder', () => { it('Device token name does not match with event name as well as allowed list', async () => { let expectedOutput = { endpoint: 'https://track.customer.io/api/v1/merge_customers', - rawPayload: { primary: { id: 'user1' }, secondary: { id: undefined } }, + rawPayload: { primary: { id: 'user1' }, secondary: { id: 'user0' } }, requestConfig: { requestFormat: 'JSON', requestMethod: 'POST' }, }; expect(aliasResponseBuilder(getTestMessage(), 'user1')).toEqual(expectedOutput); diff --git a/src/v0/destinations/customerio_audience/config.ts b/src/v0/destinations/customerio_audience/config.ts new file mode 100644 index 00000000000..c6acbcdb6e4 --- /dev/null +++ b/src/v0/destinations/customerio_audience/config.ts @@ -0,0 +1,5 @@ +export const MAX_ITEMS = 1000; + +export const DEFAULT_ID_TYPE = 'id'; + +export const BASE_ENDPOINT = 'https://track.customer.io/api/v1/segments'; diff --git a/src/v0/destinations/customerio_audience/transform.ts b/src/v0/destinations/customerio_audience/transform.ts new file mode 100644 index 00000000000..4bbef334af5 --- /dev/null +++ b/src/v0/destinations/customerio_audience/transform.ts @@ -0,0 +1,62 @@ +import { + SegmentAction, + CustomerIOConnection, + CustomerIODestination, + CustomerIORouterRequest, + ProcessedEvent, +} from './type'; +import { batchResponseBuilder, createEventChunk } from './utils'; +import { handleRtTfSingleEventError } from '../../util'; + +const processRouterDest = async (inputs: CustomerIORouterRequest[], reqMetadata: any) => { + if (!inputs?.length) return []; + + const { destination, connection } = inputs[0]; + + const customerIODestination = destination as CustomerIODestination; + const customerIOConnection = connection as CustomerIOConnection; + + // Process events and separate valid and error cases + const processedEvents = inputs.map((event) => { + try { + return { + success: true, + data: createEventChunk(event), + }; + } catch (error) { + return { + success: false, + error: handleRtTfSingleEventError(event, error, reqMetadata), + }; + } + }); + + // Separate successful and failed events + const successfulEvents = processedEvents + .filter((result) => result.success) + .map((result) => result.data as ProcessedEvent); + + const errorEvents = processedEvents + .filter((result) => !result.success) + .map((result) => result.error); + + // Split successful events into delete and insert/update lists + const deleteRespList = successfulEvents + .filter((event) => event.eventAction === SegmentAction.DELETE) + .map(({ payload, metadata }) => ({ payload, metadata })); + + const insertOrUpdateRespList = successfulEvents + .filter((event) => event.eventAction !== SegmentAction.DELETE) + .map(({ payload, metadata }) => ({ payload, metadata })); + + const batchSuccessfulRespList = batchResponseBuilder( + insertOrUpdateRespList, + deleteRespList, + customerIODestination, + customerIOConnection, + ); + + return [...batchSuccessfulRespList, ...errorEvents]; +}; + +export { processRouterDest }; diff --git a/src/v0/destinations/customerio_audience/type.ts b/src/v0/destinations/customerio_audience/type.ts new file mode 100644 index 00000000000..cfffa6608b1 --- /dev/null +++ b/src/v0/destinations/customerio_audience/type.ts @@ -0,0 +1,125 @@ +import { z } from 'zod'; + +import { + Connection, + Destination, + DestinationConnectionConfig, + MessageTypeSchema, + Metadata, + RouterTransformationRequestData, +} from '../../../types'; + +import { + BatchedRequest, + BatchedRequestBody, + BatchRequestOutput, +} from '../../../types/destinationTransformation'; + +// Basic response type for audience list operations +export type RespList = { + payload: { + ids: (string | number)[]; + }; + metadata: Partial; +}; + +// Types for API request components +export type SegmentationPayload = { + ids: (string | number)[]; +}; + +export type SegmentationParam = { + id_type: string; +}; + +export type SegmentationHeaders = { + 'Content-Type': string; + Authorization: string; +}; + +export const SegmentAction = { + INSERT: 'insert', + UPDATE: 'update', + DELETE: 'delete', +} as const; + +export const CustomerIODestinationConfigSchema = z + .object({ + apiKey: z.string(), + appApiKey: z.string(), + siteId: z.string(), + }) + .passthrough(); + +// CustomerIO specific configuration types +export type CustomerIODestinationConfig = z.infer; + +export const CustomerIOConnectionConfigSchema = z + .object({ + audienceId: z.union([z.string().nonempty(), z.number()]), + identifierMappings: z.array(z.object({ from: z.string(), to: z.string() })).nonempty(), + }) + .passthrough(); + +export type CustomerIOConnectionConfig = z.infer; + +const SegmentActionSchema = z.nativeEnum(SegmentAction); + +// Message type specific to CustomerIO +export const CustomerIOMessageSchema = z + .object({ + type: z.literal(MessageTypeSchema.enum.record), + action: SegmentActionSchema, + identifiers: z + .record(z.string(), z.union([z.string(), z.number()])) + .superRefine((identifiers, ctx) => { + if (Object.keys(identifiers).length === 0) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: 'cannot be empty', + }); + } else if (Object.keys(identifiers).length !== 1) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: 'only one identifier is supported', + }); + } + }), + }) + .passthrough(); + +export type SegmentActionType = z.infer; + +export type CustomerIOMessage = z.infer; + +// Final exported types using generics from base types +export type CustomerIODestination = Destination; +export type CustomerIOConnection = Connection< + DestinationConnectionConfig +>; + +export type CustomerIORouterRequest = RouterTransformationRequestData< + CustomerIOMessage, + CustomerIODestination, + CustomerIOConnection +>; + +// Remove the duplicate types and use the generic ones instead +export type CustomerIOBatchResponse = BatchRequestOutput< + SegmentationPayload, + SegmentationHeaders, + SegmentationParam, + CustomerIODestination +>; + +export type CustomerIOBatchedRequest = BatchedRequest< + SegmentationPayload, + SegmentationHeaders, + SegmentationParam +>; + +export type CustomerIOBatchedRequestBody = BatchedRequestBody; + +export type ProcessedEvent = RespList & { + eventAction: SegmentActionType; +}; diff --git a/src/v0/destinations/customerio_audience/utils.test.ts b/src/v0/destinations/customerio_audience/utils.test.ts new file mode 100644 index 00000000000..c940e0d3804 --- /dev/null +++ b/src/v0/destinations/customerio_audience/utils.test.ts @@ -0,0 +1,164 @@ +import { batchResponseBuilder, createEventChunk } from './utils'; +import { InstrumentationError, ConfigurationError } from '@rudderstack/integrations-lib'; +describe('utils', () => { + describe('batchResponseBuilder', () => { + const mockDestination = { + Config: { + siteId: 'test-site', + apiKey: 'test-key', + }, + }; + + const mockConnection = { + config: { + destination: { + identifierMappings: [{ to: 'email' }], + audienceId: '123', + }, + }, + }; + + const testCases = [ + { + name: 'should build batch responses for insert and delete', + input: { + insertOrUpdateRespList: [{ payload: { ids: ['user1'] }, metadata: { sourceId: '1' } }], + deleteRespList: [{ payload: { ids: ['user2'] }, metadata: { sourceId: '2' } }], + }, + expected: { + length: 2, + firstEndpoint: 'https://track.customer.io/api/v1/segments/123/add_customers', + secondEndpoint: 'https://track.customer.io/api/v1/segments/123/remove_customers', + }, + }, + { + name: 'should handle empty lists', + input: { + insertOrUpdateRespList: [], + deleteRespList: [], + }, + expected: { + length: 0, + }, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + test(name, () => { + const result = batchResponseBuilder( + input.insertOrUpdateRespList, + input.deleteRespList, + mockDestination as any, + mockConnection as any, + ); + + expect(result).toHaveLength(expected.length); + if (expected.length > 0) { + expect(result[0].batchedRequest.endpoint).toBe(expected.firstEndpoint); + expect(result[1].batchedRequest.endpoint).toBe(expected.secondEndpoint); + } + }); + + describe('createEventChunk', () => { + const testCases = [ + { + name: 'should create valid event chunk when audienceId is a string', + input: { + message: { + type: 'record', + action: 'insert', + identifiers: { email: 'test@test.com' }, + }, + connection: { + config: { + destination: { + identifierMappings: [{ to: 'email', from: 'email' }], + audienceId: '123', + }, + }, + }, + metadata: { sourceId: '1' }, + }, + expected: { + payload: { ids: ['test@test.com'] }, + eventAction: 'insert', + metadata: { sourceId: '1' }, + }, + }, + { + name: 'should create valid event chunk when audienceId is a number', + input: { + message: { + type: 'record', + action: 'insert', + identifiers: { email: 'test@test.com' }, + }, + connection: { + config: { + destination: { + identifierMappings: [{ to: 'email', from: 'email' }], + audienceId: 123, + }, + }, + }, + metadata: { sourceId: '1' }, + }, + expected: { + payload: { ids: ['test@test.com'] }, + eventAction: 'insert', + metadata: { sourceId: '1' }, + }, + }, + { + name: 'should throw InstrumentationError for invalid message', + input: { + message: { + action: null, + identifiers: {}, + }, + connection: { + config: { + destination: { + identifierMappings: [{ to: 'email', from: 'email' }], + audienceId: '123', + }, + }, + }, + }, + throws: InstrumentationError, + }, + { + name: 'should throw ConfigurationError for invalid connection config', + input: { + message: { + type: 'record', + action: 'insert', + identifiers: { email: 'test@test.com' }, + }, + connection: { + config: { + destination: { + identifierMappings: [], + audienceId: null, + }, + }, + }, + }, + throws: ConfigurationError, + }, + ]; + + testCases.forEach(({ name, input, expected, throws }) => { + test(name, () => { + if (throws) { + expect(() => createEventChunk(input as any)).toThrow(throws); + } else { + const result = createEventChunk(input as any); + expect(result).toEqual(expected); + } + }); + }); + }); + }); + }); +}); diff --git a/src/v0/destinations/customerio_audience/utils.ts b/src/v0/destinations/customerio_audience/utils.ts new file mode 100644 index 00000000000..ed80f6816a2 --- /dev/null +++ b/src/v0/destinations/customerio_audience/utils.ts @@ -0,0 +1,160 @@ +import { + base64Convertor, + ConfigurationError, + formatZodError, + InstrumentationError, +} from '@rudderstack/integrations-lib'; +import { BatchUtils } from '@rudderstack/workflow-engine'; +import { BASE_ENDPOINT, DEFAULT_ID_TYPE, MAX_ITEMS } from './config'; +import { + CustomerIOConnection, + CustomerIODestination, + CustomerIORouterRequest, + RespList, + SegmentationHeaders, + SegmentationParam, + SegmentationPayload, + CustomerIOBatchResponse, + SegmentActionType, + CustomerIOConnectionConfigSchema, + CustomerIOMessageSchema, + ProcessedEvent, +} from './type'; +import { Metadata } from '../../../types'; + +const getIdType = (connection: CustomerIOConnection): string => + connection.config.destination.identifierMappings[0]?.to || DEFAULT_ID_TYPE; + +const getSegmentId = (connection: CustomerIOConnection): string | number => + connection.config.destination.audienceId; + +const getHeaders = (destination: CustomerIODestination): SegmentationHeaders => ({ + 'Content-Type': 'application/json', + Authorization: `Basic ${base64Convertor(`${destination.Config.siteId}:${destination.Config.apiKey}`)}`, +}); + +const getParams = (connection: CustomerIOConnection): SegmentationParam => ({ + id_type: getIdType(connection), +}); + +const getMergedPayload = (batch: RespList[]): SegmentationPayload => ({ + ids: batch.flatMap((input) => input.payload.ids), +}); + +const getMergedMetadata = (batch: RespList[]): Partial[] => + batch.map((input) => input.metadata); + +const buildBatchedResponse = ( + payload: SegmentationPayload, + endpoint: string, + headers: SegmentationHeaders, + params: SegmentationParam, + metadata: Partial[], + destination: CustomerIODestination, +): CustomerIOBatchResponse => ({ + batchedRequest: { + body: { + JSON: payload, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + version: '1', + type: 'REST', + method: 'POST', + endpoint, + headers, + params, + files: {}, + }, + metadata, + batched: true, + statusCode: 200, + destination, +}); + +const processBatch = ( + respList: RespList[], + endpoint: string, + destination: CustomerIODestination, + connection: CustomerIOConnection, +): CustomerIOBatchResponse[] => { + if (!respList?.length) { + return []; + } + + const headers = getHeaders(destination); + const params = getParams(connection); + const batches = BatchUtils.chunkArrayBySizeAndLength(respList, { maxItems: MAX_ITEMS }); + + return batches.items.map((batch) => { + const mergedPayload = getMergedPayload(batch); + const mergedMetadata = getMergedMetadata(batch); + return buildBatchedResponse( + mergedPayload, + endpoint, + headers, + params, + mergedMetadata, + destination, + ); + }); +}; + +export const batchResponseBuilder = ( + insertOrUpdateRespList: RespList[], + deleteRespList: RespList[], + destination: CustomerIODestination, + connection: CustomerIOConnection, +): CustomerIOBatchResponse[] => { + const segmentId = getSegmentId(connection); + + const insertResponses = processBatch( + insertOrUpdateRespList, + `${BASE_ENDPOINT}/${segmentId}/add_customers`, + destination, + connection, + ); + + const deleteResponses = processBatch( + deleteRespList, + `${BASE_ENDPOINT}/${segmentId}/remove_customers`, + destination, + connection, + ); + + return [...insertResponses, ...deleteResponses]; +}; + +const getEventAction = (event: CustomerIORouterRequest): string => event.message.action; + +const validateEvent = (event: CustomerIORouterRequest): boolean => { + const { message, connection } = event; + + const connectionValidation = CustomerIOConnectionConfigSchema.safeParse( + connection?.config.destination, + ); + + if (!connectionValidation.success) { + throw new ConfigurationError(formatZodError(connectionValidation.error)); + } + const messageValidation = CustomerIOMessageSchema.safeParse(message); + + if (!messageValidation.success) { + throw new InstrumentationError(formatZodError(messageValidation.error)); + } + + return true; +}; + +export const createEventChunk = (event: CustomerIORouterRequest): ProcessedEvent => { + validateEvent(event); + const eventAction = getEventAction(event); + const id = Object.values(event.message.identifiers)[0]; + + return { + payload: { ids: [id] }, + metadata: event.metadata, + eventAction: eventAction as SegmentActionType, + }; +}; diff --git a/src/v0/destinations/facebook_conversions/config.js b/src/v0/destinations/facebook_conversions/config.js index 2bbe9ab0170..d88e9d698c3 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/v20.0/${datasetId}/events?access_token=${accessToken}`; + `https://graph.facebook.com/v22.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 f2598921652..b8411af1e00 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 = 'v20.0'; +const VERSION = 'v22.0'; const CONFIG_CATEGORIES = { USERDATA: { diff --git a/src/v0/destinations/fb/config.js b/src/v0/destinations/fb/config.js index d84fa7d6727..80d0749bb1d 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 = 'v20.0'; +const VERSION = 'v22.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 5a3f0742e12..dfce02acd72 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/v20.0'; +const BASE_URL = 'https://graph.facebook.com/v22.0'; function getEndPoint(audienceId) { return `${BASE_URL}/${audienceId}/users`; diff --git a/src/v0/destinations/fb_custom_audience/recordTransform.js b/src/v0/destinations/fb_custom_audience/recordTransform.js index db1fbeec595..719a53619e3 100644 --- a/src/v0/destinations/fb_custom_audience/recordTransform.js +++ b/src/v0/destinations/fb_custom_audience/recordTransform.js @@ -23,54 +23,68 @@ const { generateAppSecretProof, } = require('./util'); -const processRecordEventArray = ( - recordChunksArray, - userSchema, - isHashRequired, - disableFormat, - paramsPayload, - prepareParams, - destination, - operation, - audienceId, -) => { +/** + * Processes a single record and updates the data element. + * @param {Object} record - The record to process. + * @param {Array} userSchema - The schema defining user properties. + * @param {boolean} isHashRequired - Whether hashing is required. + * @param {boolean} disableFormat - Whether formatting is disabled. + * @returns {Object} - The processed data element and metadata. + */ +const processRecord = (record, userSchema, isHashRequired, disableFormat) => { + const { fields } = record.message; + let dataElement = []; + let nullUserData = true; + + userSchema.forEach((eachProperty) => { + const userProperty = fields[eachProperty]; + let updatedProperty = userProperty; + + if (isHashRequired && !disableFormat) { + updatedProperty = ensureApplicableFormat(eachProperty, userProperty); + } + + dataElement = getUpdatedDataElement(dataElement, isHashRequired, eachProperty, updatedProperty); + + if (dataElement[dataElement.length - 1]) { + nullUserData = false; + } + }); + + if (nullUserData) { + stats.increment('fb_custom_audience_event_having_all_null_field_values_for_a_user', { + destinationId: record.destination.ID, + nullFields: userSchema, + }); + } + + return { dataElement, metadata: record.metadata }; +}; + +/** + * Processes an array of record chunks and prepares the payload for sending. + * @param {Array} recordChunksArray - The array of record chunks. + * @param {Object} config - Configuration object containing userSchema, isHashRequired, disableFormat, etc. + * @param {Object} destination - The destination configuration. + * @param {string} operation - The operation to perform (e.g., 'add', 'remove'). + * @param {string} audienceId - The audience ID. + * @returns {Array} - The response events to send. + */ +const processRecordEventArray = (recordChunksArray, config, destination, operation, audienceId) => { + const { userSchema, isHashRequired, disableFormat, paramsPayload, prepareParams } = config; const toSendEvents = []; const metadata = []; + recordChunksArray.forEach((recordArray) => { - const data = []; - recordArray.forEach((input) => { - const { fields } = input.message; - let dataElement = []; - let nullUserData = true; - - userSchema.forEach((eachProperty) => { - const userProperty = fields[eachProperty]; - let updatedProperty = userProperty; - - if (isHashRequired && !disableFormat) { - updatedProperty = ensureApplicableFormat(eachProperty, userProperty); - } - - dataElement = getUpdatedDataElement( - dataElement, - isHashRequired, - eachProperty, - updatedProperty, - ); - - if (dataElement[dataElement.length - 1]) { - nullUserData = false; - } - }); - - if (nullUserData) { - stats.increment('fb_custom_audience_event_having_all_null_field_values_for_a_user', { - destinationId: destination.ID, - nullFields: userSchema, - }); - } - data.push(dataElement); - metadata.push(input.metadata); + const data = recordArray.map((input) => { + const { dataElement, metadata: recordMetadata } = processRecord( + input, + userSchema, + isHashRequired, + disableFormat, + ); + metadata.push(recordMetadata); + return dataElement; }); const prepareFinalPayload = lodash.cloneDeep(paramsPayload); @@ -90,16 +104,19 @@ const processRecordEventArray = ( }; const builtResponse = responseBuilderSimple(wrappedResponse, audienceId); - toSendEvents.push(builtResponse); }); }); - const response = getSuccessRespEvents(toSendEvents, metadata, destination, true); - - return response; + return getSuccessRespEvents(toSendEvents, metadata, destination, true); }; +/** + * Prepares the payload for the given events and configuration. + * @param {Array} events - The events to process. + * @param {Object} config - The configuration object. + * @returns {Array} - The final response payload. + */ function preparePayload(events, config) { const { audienceId, userSchema, isRaw, type, subType, isHashRequired, disableFormat } = config; const { destination } = events[0]; @@ -138,64 +155,32 @@ function preparePayload(events, config) { record.message.action?.toLowerCase(), ); - let insertResponse; - let deleteResponse; - let updateResponse; - - if (groupedRecordsByAction.delete) { - const deleteRecordChunksArray = returnArrayOfSubarrays( - groupedRecordsByAction.delete, - MAX_USER_COUNT, - ); - deleteResponse = processRecordEventArray( - deleteRecordChunksArray, - cleanUserSchema, - isHashRequired, - disableFormat, - paramsPayload, - prepareParams, - destination, - 'remove', - audienceId, - ); - } - - if (groupedRecordsByAction.insert) { - const insertRecordChunksArray = returnArrayOfSubarrays( - groupedRecordsByAction.insert, - MAX_USER_COUNT, - ); - - insertResponse = processRecordEventArray( - insertRecordChunksArray, - cleanUserSchema, - isHashRequired, - disableFormat, - paramsPayload, - prepareParams, - destination, - 'add', - audienceId, - ); - } + const processAction = (action, operation) => { + if (groupedRecordsByAction[action]) { + const recordChunksArray = returnArrayOfSubarrays( + groupedRecordsByAction[action], + MAX_USER_COUNT, + ); + return processRecordEventArray( + recordChunksArray, + { + userSchema: cleanUserSchema, + isHashRequired, + disableFormat, + paramsPayload, + prepareParams, + }, + destination, + operation, + audienceId, + ); + } + return null; + }; - if (groupedRecordsByAction.update) { - const updateRecordChunksArray = returnArrayOfSubarrays( - groupedRecordsByAction.update, - MAX_USER_COUNT, - ); - updateResponse = processRecordEventArray( - updateRecordChunksArray, - cleanUserSchema, - isHashRequired, - disableFormat, - paramsPayload, - prepareParams, - destination, - 'add', - audienceId, - ); - } + const deleteResponse = processAction('delete', 'remove'); + const insertResponse = processAction('insert', 'add'); + const updateResponse = processAction('update', 'add'); const errorResponse = getErrorResponse(groupedRecordsByAction); @@ -203,7 +188,6 @@ function preparePayload(events, config) { deleteResponse, insertResponse, updateResponse, - errorResponse, ); if (finalResponse.length === 0) { @@ -214,6 +198,11 @@ function preparePayload(events, config) { return finalResponse; } +/** + * Processes record inputs for V1 flow. + * @param {Array} groupedRecordInputs - The grouped record inputs. + * @returns {Array} - The processed payload. + */ function processRecordInputsV1(groupedRecordInputs) { const { destination } = groupedRecordInputs[0]; const { message } = groupedRecordInputs[0]; @@ -239,11 +228,15 @@ function processRecordInputsV1(groupedRecordInputs) { }); } +/** + * Processes record inputs for V2 flow. + * @param {Array} groupedRecordInputs - The grouped record inputs. + * @returns {Array} - The processed payload. + */ const processRecordInputsV2 = (groupedRecordInputs) => { const { connection, message } = groupedRecordInputs[0]; const { isHashRequired, disableFormat, type, subType, isRaw, audienceId } = connection.config.destination; - // Ref: https://www.notion.so/rudderstacks/VDM-V2-Final-Config-and-Record-EventPayload-8cc80f3d88ad46c7bc43df4b87a0bbff const identifiers = message?.identifiers; let userSchema; if (identifiers) { @@ -267,6 +260,11 @@ const processRecordInputsV2 = (groupedRecordInputs) => { }); }; +/** + * Processes record inputs based on the flow type. + * @param {Array} groupedRecordInputs - The grouped record inputs. + * @returns {Array} - The processed payload. + */ function processRecordInputs(groupedRecordInputs) { const event = groupedRecordInputs[0]; // First check for rETL flow and second check for ES flow diff --git a/src/v0/destinations/fb_custom_audience/util.test.js b/src/v0/destinations/fb_custom_audience/util.test.js index 5c8eb15b71a..6e966887ad8 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/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', diff --git a/src/v0/destinations/ga4_v2/customMappingsHandler.js b/src/v0/destinations/ga4_v2/customMappingsHandler.js index b5818d6fff1..2bdfd375e25 100644 --- a/src/v0/destinations/ga4_v2/customMappingsHandler.js +++ b/src/v0/destinations/ga4_v2/customMappingsHandler.js @@ -23,7 +23,6 @@ const { isEmptyObject, removeUndefinedAndNullValues, isHybridModeEnabled, - getIntegrationsObj, applyCustomMappings, } = require('../../util'); const { trackCommonConfig, ConfigCategory, mappingConfig } = require('../ga4/config'); @@ -145,7 +144,6 @@ 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_v2'); if (ga4Payload.events[0].params) { ga4Payload.events[0].params = removeInvalidParams( diff --git a/src/v0/destinations/ga4_v2/transform.test.ts b/src/v0/destinations/ga4_v2/transform.test.ts new file mode 100644 index 00000000000..02babb75199 --- /dev/null +++ b/src/v0/destinations/ga4_v2/transform.test.ts @@ -0,0 +1,133 @@ +import { process } from './transform'; +import { ProcessorTransformationRequest } from '../../../types'; +import { handleCustomMappings } from './customMappingsHandler'; +import { processEvents as ga4Process } from '../ga4/transform'; + +// Mock dependencies +jest.mock('./customMappingsHandler'); +jest.mock('../ga4/transform'); +jest.mock('../ga4/utils'); + +describe('process', () => { + const mockHandleCustomMappings = handleCustomMappings as jest.Mock; + const mockGa4Process = ga4Process as jest.Mock; + + beforeEach(() => { + jest.restoreAllMocks(); + + jest.clearAllMocks(); + }); + + const testCases = [ + { + name: 'should process track events with custom mappings', + input: { + message: { + type: 'track', + event: 'test_event', + }, + destination: { + Config: { + configData: JSON.stringify({ + PROPERTY: 'test-property', + DATA_STREAM: { type: 'gtag', value: 'G-123456' }, + MEASUREMENT_PROTOCOL_SECRET: 'secret', + }), + }, + }, + } as unknown as ProcessorTransformationRequest, + expectedConfig: { + propertyId: 'test-property', + typesOfClient: 'gtag', + measurementId: 'G-123456', + apiSecret: 'secret', + configData: expect.any(String), + }, + shouldCallCustomMappings: true, + shouldCallGa4Process: false, + }, + { + name: 'should process non-track events with ga4Process', + input: { + message: { + type: 'identify', + }, + destination: { + Config: { + configData: JSON.stringify({ + PROPERTY: 'test-property', + DATA_STREAM: { type: 'firebase', value: 'app-id' }, + MEASUREMENT_PROTOCOL_SECRET: 'secret', + }), + }, + }, + } as unknown as ProcessorTransformationRequest, + expectedConfig: { + propertyId: 'test-property', + typesOfClient: 'firebase', + firebaseAppId: 'app-id', + apiSecret: 'secret', + configData: expect.any(String), + }, + shouldCallCustomMappings: false, + shouldCallGa4Process: true, + }, + ]; + + test.each(testCases)( + '$name', + ({ input, expectedConfig, shouldCallCustomMappings, shouldCallGa4Process }) => { + process(input); + + if (shouldCallCustomMappings) { + expect(mockHandleCustomMappings).toHaveBeenCalledWith( + input.message, + expect.objectContaining(expectedConfig), + ); + } else { + expect(mockHandleCustomMappings).not.toHaveBeenCalled(); + } + + if (shouldCallGa4Process) { + expect(mockGa4Process).toHaveBeenCalledWith({ event: input, destType: 'ga4_v2' }); + } else { + expect(mockGa4Process).not.toHaveBeenCalled(); + } + }, + ); + + const errorTestCases = [ + { + name: 'should throw error when message type is missing', + input: { + message: {}, + destination: { + Config: { + configData: JSON.stringify({ + PROPERTY: 'test-property', + DATA_STREAM: { type: 'gtag', value: 'G-123456' }, + MEASUREMENT_PROTOCOL_SECRET: 'secret', + }), + }, + }, + } as unknown as ProcessorTransformationRequest, + expectedError: 'Message Type is not present. Aborting message.', + }, + { + name: 'should throw error when configData is not a string', + input: { + message: { type: 'track' }, + destination: { + Config: { + configData: { invalid: 'object' }, + }, + }, + } as unknown as ProcessorTransformationRequest, + expectedError: 'Config data is not a string', + }, + ]; + + test.each(errorTestCases)('$name', ({ input, expectedError }) => { + expect(() => process(input)).toThrow(expectedError); + }); +}); diff --git a/src/v0/destinations/ga4_v2/transform.ts b/src/v0/destinations/ga4_v2/transform.ts index 06d4bd90236..ee2516c5ba3 100644 --- a/src/v0/destinations/ga4_v2/transform.ts +++ b/src/v0/destinations/ga4_v2/transform.ts @@ -1,9 +1,5 @@ -import { - InstrumentationError, - isDefinedAndNotNull, - RudderStackEvent, -} from '@rudderstack/integrations-lib'; -import { ProcessorTransformationRequest } from '../../../types'; +import { InstrumentationError, isDefinedAndNotNull } from '@rudderstack/integrations-lib'; +import { ProcessorTransformationRequest, RudderMessage } from '../../../types'; import { handleCustomMappings } from './customMappingsHandler'; import { processEvents as ga4Process } from '../ga4/transform'; import { basicConfigvalidaiton } from '../ga4/utils'; @@ -12,6 +8,9 @@ export function process(event: ProcessorTransformationRequest) { const { message, destination } = event; const { Config } = destination; if (isDefinedAndNotNull(Config.configData)) { + if (typeof Config.configData !== 'string') { + throw new InstrumentationError('Config data is not a string'); + } const configDetails = JSON.parse(Config.configData); Config.propertyId = configDetails.PROPERTY; Config.typesOfClient = configDetails.DATA_STREAM.type; @@ -23,7 +22,7 @@ export function process(event: ProcessorTransformationRequest) { Config.apiSecret = configDetails.MEASUREMENT_PROTOCOL_SECRET; } - const eventPayload = message as RudderStackEvent; + const eventPayload = message as RudderMessage; if (!eventPayload.type) { throw new InstrumentationError('Message Type is not present. Aborting message.'); diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/config.js b/src/v0/destinations/google_adwords_enhanced_conversions/config.js index 8a3f8ab673d..8afc126749e 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/config.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/config.js @@ -1,8 +1,8 @@ const { getMappingConfig } = require('../../util'); -const API_VERSION = 'v17'; +const API_VERSION = 'v18'; -const BASE_ENDPOINT = 'https://googleads.googleapis.com/v17/customers'; +const BASE_ENDPOINT = `https://googleads.googleapis.com/${API_VERSION}/customers`; const CONFIG_CATEGORIES = { TRACK_CONFIG: { type: 'track', name: 'trackConfig' }, diff --git a/src/v0/destinations/google_adwords_offline_conversions/config.js b/src/v0/destinations/google_adwords_offline_conversions/config.js index 6eec1068a6b..62b56109010 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/config.js +++ b/src/v0/destinations/google_adwords_offline_conversions/config.js @@ -1,6 +1,6 @@ const { getMappingConfig } = require('../../util'); -const API_VERSION = 'v16'; +const API_VERSION = 'v18'; const BASE_ENDPOINT = `https://googleads.googleapis.com/${API_VERSION}/customers/:customerId`; @@ -65,4 +65,5 @@ module.exports = { trackAddStoreAddressConversionsMapping: MAPPING_CONFIG[CONFIG_CATEGORIES.TRACK_STORE_ADDRESS_IDENTIFIER.name], consentConfigMap, + API_VERSION, }; diff --git a/src/v0/destinations/google_adwords_offline_conversions/data/TrackAddStoreConversionsConfig.json b/src/v0/destinations/google_adwords_offline_conversions/data/TrackAddStoreConversionsConfig.json index 9c88e59ddb3..9bfd0bc179f 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/data/TrackAddStoreConversionsConfig.json +++ b/src/v0/destinations/google_adwords_offline_conversions/data/TrackAddStoreConversionsConfig.json @@ -17,7 +17,8 @@ ], "required": true, "metadata": { - "type": "toNumber" + "type": "toNumber", + "regex": "^([1-9]\\d*(\\.\\d+)?|0\\.\\d+)$" } }, { diff --git a/src/v0/destinations/google_adwords_offline_conversions/helper.test.js b/src/v0/destinations/google_adwords_offline_conversions/helper.test.js index 2ac5c6cfa04..a94097245d9 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/helper.test.js +++ b/src/v0/destinations/google_adwords_offline_conversions/helper.test.js @@ -2,6 +2,14 @@ const moment = require('moment-timezone'); const { formatTimestamp } = require('./helper'); describe('google adwords offline conversions - helper', () => { + beforeAll(() => { + jest.spyOn(console, 'warn').mockImplementation(() => {}); + }); + + afterAll(() => { + console.warn.mockRestore(); + }); + it('should correctly format to IST', () => { moment.tz.setDefault('Asia/Calcutta'); expect(formatTimestamp('2019-10-14 11:15:18.299Z')).toEqual('2019-10-14 16:45:18+05:30'); diff --git a/src/v0/destinations/google_adwords_offline_conversions/transform.js b/src/v0/destinations/google_adwords_offline_conversions/transform.js index 2648f03e8a3..bef7af00017 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/transform.js +++ b/src/v0/destinations/google_adwords_offline_conversions/transform.js @@ -18,7 +18,6 @@ const { getClickConversionPayloadAndEndpoint, getConsentsDataFromIntegrationObj, getCallConversionPayload, - updateConversion, } = require('./utils'); const helper = require('./helper'); @@ -49,17 +48,19 @@ const getConversions = (message, metadata, { Config }, event, conversionType) => filteredCustomerId, eventLevelConsentsData, ); - convertedPayload.payload.conversions[0] = updateConversion( - convertedPayload.payload.conversions[0], - ); payload = convertedPayload.payload; endpoint = convertedPayload.endpoint; } else if (conversionType === 'store') { - payload = getStoreConversionPayload(message, Config, filteredCustomerId); + payload = getStoreConversionPayload( + message, + Config, + filteredCustomerId, + eventLevelConsentsData, + ); endpoint = STORE_CONVERSION_CONFIG.replace(':customerId', filteredCustomerId); } else { // call conversions - payload = getCallConversionPayload(message, Config, eventLevelConsentsData); + payload = getCallConversionPayload(message, eventLevelConsentsData); endpoint = CALL_CONVERSION.replace(':customerId', filteredCustomerId); } diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.js b/src/v0/destinations/google_adwords_offline_conversions/utils.js index 2d47095eea7..24a2e471c60 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.js @@ -227,14 +227,10 @@ function getExisitingUserIdentifier(userIdentifierInfo, defaultUserIdentifier) { return result; } -const getCallConversionPayload = (message, Config, eventLevelConsentsData) => { +const getCallConversionPayload = (message, eventLevelConsentsData) => { const payload = constructPayload(message, trackCallConversionsMapping); // here conversions[0] should be present because there are some mandatory properties mapped in the mapping json. - payload.conversions[0].consent = finaliseConsent( - consentConfigMap, - eventLevelConsentsData, - Config, - ); + payload.conversions[0].consent = finaliseConsent(consentConfigMap, eventLevelConsentsData); return payload; }; @@ -242,7 +238,7 @@ const getCallConversionPayload = (message, Config, eventLevelConsentsData) => { * This Function create the add conversion payload * and returns the payload */ -const getAddConversionPayload = (message, Config) => { +const getAddConversionPayload = (message, Config, eventLevelConsentsData) => { const { properties } = message; const { validateOnly, hashUserIdentifier, defaultUserIdentifier } = Config; const payload = constructPayload(message, trackAddStoreConversionsMapping); @@ -299,19 +295,19 @@ const getAddConversionPayload = (message, Config) => { } } // add consent support for store conversions. Note: No event level consent supported. - const consentObject = finaliseConsent(consentConfigMap, {}, Config); + const consentObject = finaliseConsent(consentConfigMap, eventLevelConsentsData); // create property should be present because there are some mandatory properties mapped in the mapping json. set(payload, 'operations.create.consent', consentObject); return payload; }; -const getStoreConversionPayload = (message, Config, event) => { +const getStoreConversionPayload = (message, Config, event, eventLevelConsentsData) => { const { validateOnly } = Config; const payload = { event, isStoreConversion: true, createJobPayload: getCreateJobPayload(message), - addConversionPayload: getAddConversionPayload(message, Config), + addConversionPayload: getAddConversionPayload(message, Config, eventLevelConsentsData), executeJobPayload: { validate_only: validateOnly }, }; return payload; @@ -346,6 +342,24 @@ const populateUserIdentifier = ({ email, phone, properties, payload, UserIdentif } return copiedPayload; }; + +/** + * remove redundant ids + * @param {*} conversionCopy + */ +const updateConversion = (conversion) => { + const conversionCopy = cloneDeep(conversion); + if (conversionCopy.gclid) { + delete conversionCopy.wbraid; + delete conversionCopy.gbraid; + } else if (conversionCopy.wbraid && conversionCopy.gbraid) { + throw new InstrumentationError(`You can't use both wbraid and gbraid.`); + } else if (conversionCopy.wbraid || conversionCopy.gbraid) { + delete conversionCopy.userIdentifiers; + } + return conversionCopy; +}; + const getClickConversionPayloadAndEndpoint = ( message, Config, @@ -420,9 +434,10 @@ const getClickConversionPayloadAndEndpoint = ( } // add consent support for click conversions - const consentObject = finaliseConsent(consentConfigMap, eventLevelConsent, Config); + const consentObject = finaliseConsent(consentConfigMap, eventLevelConsent); // here conversions[0] is expected to be present there are some mandatory properties mapped in the mapping json. set(payload, 'conversions[0].consent', consentObject); + payload.conversions[0] = updateConversion(payload.conversions[0]); return { payload, endpoint }; }; @@ -431,25 +446,6 @@ const getConsentsDataFromIntegrationObj = (message) => { return integrationObj?.consents || {}; }; -/** - * remove redundant ids - * @param {*} conversionCopy - */ -const updateConversion = (conversion) => { - const conversionCopy = cloneDeep(conversion); - if (conversionCopy.gclid) { - delete conversionCopy.wbraid; - delete conversionCopy.gbraid; - } - if (conversionCopy.wbraid && conversionCopy.gbraid) { - throw new InstrumentationError(`You can't use both wbraid and gbraid.`); - } - if (conversionCopy.wbraid || conversionCopy.gbraid) { - delete conversionCopy.userIdentifiers; - } - return conversionCopy; -}; - module.exports = { validateDestinationConfig, generateItemListFromProducts, diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.test.js b/src/v0/destinations/google_adwords_offline_conversions/utils.test.js index b6c66537829..bdcbc881310 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.test.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.test.js @@ -6,6 +6,8 @@ const { getCallConversionPayload, } = require('./utils'); +const API_VERSION = 'v18'; + const getTestMessage = () => { let message = { event: 'testEventName', @@ -163,7 +165,7 @@ describe('getExisitingUserIdentifier util tests', () => { describe('getClickConversionPayloadAndEndpoint util tests', () => { it('getClickConversionPayloadAndEndpoint flow check when default field identifier is present', () => { let expectedOutput = { - endpoint: 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, payload: { conversions: [ { @@ -193,7 +195,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => { delete fittingPayload.traits.email; delete fittingPayload.properties.email; let expectedOutput = { - endpoint: 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, payload: { conversions: [ { @@ -225,7 +227,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => { delete fittingPayload.traits.phone; delete fittingPayload.properties.email; let expectedOutput = { - endpoint: 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, payload: { conversions: [ { @@ -263,7 +265,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => { }, ]; let expectedOutput = { - endpoint: 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, payload: { conversions: [ { @@ -317,7 +319,7 @@ describe('getConsentsDataFromIntegrationObj', () => { }); describe('getCallConversionPayload', () => { - it('should call conversion payload with consent object', () => { + it('should call conversion payload with consent object and set default consent for adUserData', () => { const message = { properties: { callerId: '1234', @@ -325,17 +327,9 @@ describe('getCallConversionPayload', () => { conversionDateTime: '2022-01-01 12:32:45-08:00', }, }; - const result = getCallConversionPayload( - message, - { - userDataConsent: 'GRANTED', - personalizationConsent: 'DENIED', - }, - { - adUserData: 'GRANTED', - adPersonalization: 'GRANTED', - }, - ); + const result = getCallConversionPayload(message, { + adPersonalization: 'GRANTED', + }); expect(result).toEqual({ conversions: [ { @@ -343,7 +337,7 @@ describe('getCallConversionPayload', () => { callerId: '1234', consent: { adPersonalization: 'GRANTED', - adUserData: 'GRANTED', + adUserData: 'UNSPECIFIED', }, conversionDateTime: '2022-01-01 12:32:45-08:00', }, @@ -358,14 +352,10 @@ describe('getCallConversionPayload', () => { conversionDateTime: '2022-01-01 12:32:45-08:00', }, }; - const result = getCallConversionPayload( - message, - { - userDataConsent: 'GRANTED', - personalizationConsent: 'DENIED', - }, - {}, - ); + const result = getCallConversionPayload(message, { + adUserData: 'GRANTED', + adPersonalization: 'DENIED', + }); expect(result).toEqual({ conversions: [ { diff --git a/src/v0/destinations/google_adwords_remarketing_lists/config.js b/src/v0/destinations/google_adwords_remarketing_lists/config.js index 1e943aee562..7c89b6bc357 100644 --- a/src/v0/destinations/google_adwords_remarketing_lists/config.js +++ b/src/v0/destinations/google_adwords_remarketing_lists/config.js @@ -1,6 +1,6 @@ const { getMappingConfig } = require('../../util'); -const API_VERSION = 'v17'; +const API_VERSION = 'v18'; const BASE_ENDPOINT = `https://googleads.googleapis.com/${API_VERSION}/customers`; const CONFIG_CATEGORIES = { diff --git a/src/v0/destinations/google_adwords_remarketing_lists/util.test.js b/src/v0/destinations/google_adwords_remarketing_lists/util.test.js index a41c00f12f4..2ba4948566b 100644 --- a/src/v0/destinations/google_adwords_remarketing_lists/util.test.js +++ b/src/v0/destinations/google_adwords_remarketing_lists/util.test.js @@ -1,6 +1,8 @@ const { populateIdentifiers, responseBuilder, getOperationAudienceId } = require('./util'); const { API_VERSION } = require('./config'); -const accessToken = 'abcd1234'; +const { generateRandomString } = require('@rudderstack/integrations-lib'); + +const accessToken = generateRandomString(); const developerToken = 'ijkl9101'; const body = { operations: [ @@ -68,7 +70,7 @@ const expectedResponse = { method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: `Bearer ${accessToken}`, 'Content-Type': 'application/json', 'developer-token': 'ijkl9101', }, diff --git a/src/v0/destinations/google_cloud_function/util.js b/src/v0/destinations/google_cloud_function/util.js index 8f85460902c..a960f02ab04 100644 --- a/src/v0/destinations/google_cloud_function/util.js +++ b/src/v0/destinations/google_cloud_function/util.js @@ -30,7 +30,6 @@ function generateBatchedPayload(events) { let batchEventResponse = events.map((event) => event.message); // Batch event into dest batch structure events.forEach((ev) => { - // batchResponseList.push(ev.message.body.JSON); metadata.push(ev.metadata); }); batchEventResponse = { diff --git a/src/v0/destinations/hs/HSTransform-v2.js b/src/v0/destinations/hs/HSTransform-v2.js index 3dd9f87ea4a..e4578a6c5b7 100644 --- a/src/v0/destinations/hs/HSTransform-v2.js +++ b/src/v0/destinations/hs/HSTransform-v2.js @@ -5,6 +5,7 @@ const { ConfigurationError, InstrumentationError, } = require('@rudderstack/integrations-lib'); +const validator = require('validator'); const { MappedToDestinationKey, GENERIC_TRUE_VALUES } = require('../../../constants'); const { defaultPostRequestConfig, @@ -72,6 +73,11 @@ const addHsAuthentication = (response, Config) => { const processIdentify = async ({ message, destination, metadata }, propertyMap) => { const { Config } = destination; let traits = getFieldValueFromMessage(message, 'traits'); + // since hubspot does not allow imvalid emails, we need to + // validate the email before sending it to hubspot + if (traits?.email && !validator.isEmail(traits.email)) { + throw new InstrumentationError(`Email "${traits.email}" is invalid`); + } const mappedToDestination = get(message, MappedToDestinationKey); const operation = get(message, 'context.hubspotOperation'); const externalIdObj = getDestinationExternalIDObjectForRetl(message, 'HS'); @@ -153,6 +159,7 @@ const processIdentify = async ({ message, destination, metadata }, propertyMap) // update endpoint = IDENTIFY_CRM_UPDATE_CONTACT.replace(':contactId', contactId); response.operation = 'updateContacts'; + response.method = defaultPatchRequestConfig.requestMethod; } else { // contact do not exist // create diff --git a/src/v0/destinations/hs/transform.js b/src/v0/destinations/hs/transform.js index b6ca213f031..68747bae6d8 100644 --- a/src/v0/destinations/hs/transform.js +++ b/src/v0/destinations/hs/transform.js @@ -86,7 +86,7 @@ const processBatchRouter = async (inputs, reqMetadata) => { try { if (mappedToDestination && GENERIC_TRUE_VALUES.includes(mappedToDestination?.toString())) { // skip splitting the batches to inserts and updates if object it is an association - if (objectType.toLowerCase() !== 'association') { + if (objectType?.toLowerCase() !== 'association') { propertyMap = await getProperties(destination, metadata); // get info about existing objects and splitting accordingly. tempInputs = await splitEventsForCreateUpdate(tempInputs, destination, metadata); diff --git a/src/v0/destinations/hs/util.js b/src/v0/destinations/hs/util.js index 56ec6e41675..b2aa61ed505 100644 --- a/src/v0/destinations/hs/util.js +++ b/src/v0/destinations/hs/util.js @@ -23,7 +23,6 @@ const { isNull, validateEventName, defaultBatchRequestConfig, - defaultPostRequestConfig, getSuccessRespEvents, } = require('../../util'); const { @@ -608,8 +607,8 @@ const performHubSpotSearch = async ( /* searchResults = { id: 'existing_contact_id', - property: 'existing_contact_email', // when email is identifier - hs_additional_emails: ['secondary_email'] // when email is identifier + property: 'existing_contact_email', // when email is identifier + hs_additional_emails: ['secondary_email'] // when email is identifier } */ return searchResults; }; @@ -838,9 +837,9 @@ const addExternalIdToHSTraits = (message) => { const externalIdObj = message.context?.externalId?.[0]; if (externalIdObj.useSecondaryObject) { /* this condition help us to NOT override the primary key value with the secondary key value - example: + example: for `email` as primary key and `hs_additonal_emails` as secondary key we don't want to override `email` with `hs_additional_emails`. - neither we want to map anything for `hs_additional_emails` as this property can not be set + neither we want to map anything for `hs_additional_emails` as this property can not be set */ return; } @@ -859,7 +858,7 @@ const convertToResponseFormat = (successRespListWithDontBatchTrue) => { batchedResponse.batchedRequest.endpoint = endpoint; batchedResponse.batchedRequest.body = message.body; batchedResponse.batchedRequest.params = message.params; - batchedResponse.batchedRequest.method = defaultPostRequestConfig.requestMethod; + batchedResponse.batchedRequest.method = message.method; batchedResponse.metadata = [metadata]; batchedResponse.destination = destination; diff --git a/src/v0/destinations/intercom/config.js b/src/v0/destinations/intercom/config.js deleted file mode 100644 index ae29eebc1eb..00000000000 --- a/src/v0/destinations/intercom/config.js +++ /dev/null @@ -1,53 +0,0 @@ -const { getMappingConfig } = require('../../util'); - -const BASE_ENDPOINT = 'https://api.intercom.io'; - -// track events | Track -const TRACK_ENDPOINT = `${BASE_ENDPOINT}/events`; -// Create, Update a user with a company | Identify -const IDENTIFY_ENDPOINT = `${BASE_ENDPOINT}/users`; -// create, update, delete a company | Group -const GROUP_ENDPOINT = `${BASE_ENDPOINT}/companies`; - -const ConfigCategory = { - TRACK: { - endpoint: TRACK_ENDPOINT, - name: 'INTERCOMTrackConfig', - }, - IDENTIFY: { - endpoint: IDENTIFY_ENDPOINT, - name: 'INTERCOMIdentifyConfig', - }, - GROUP: { - endpoint: GROUP_ENDPOINT, - name: 'INTERCOMGroupConfig', - }, -}; - -const MappingConfig = getMappingConfig(ConfigCategory, __dirname); - -const ReservedTraitsProperties = [ - 'userId', - 'email', - 'phone', - 'name', - 'createdAt', - 'firstName', - 'lastName', - 'firstname', - 'lastname', - 'company', -]; - -const ReservedCompanyProperties = ['id', 'name', 'industry']; - -// ref:- https://developers.intercom.com/intercom-api-reference/v1.4/reference/event-metadata-types -const MetadataTypes = { richLink: ['url', 'value'], monetaryAmount: ['amount', 'currency'] }; - -module.exports = { - ConfigCategory, - MappingConfig, - ReservedCompanyProperties, - ReservedTraitsProperties, - MetadataTypes, -}; diff --git a/src/v0/destinations/intercom/data/INTERCOMGroupConfig.json b/src/v0/destinations/intercom/data/INTERCOMGroupConfig.json deleted file mode 100644 index 6857c4e1045..00000000000 --- a/src/v0/destinations/intercom/data/INTERCOMGroupConfig.json +++ /dev/null @@ -1,53 +0,0 @@ -[ - { - "destKey": "company_id", - "sourceKeys": "groupId", - "required": true - }, - { - "destKey": "name", - "sourceKeys": "name", - "sourceFromGenericMap": true, - "required": false - }, - { - "destKey": "plan", - "sourceKeys": ["traits.plan", "context.traits.plan"], - "required": false - }, - { - "destKey": "size", - "sourceKeys": ["traits.size", "context.traits.size"], - "metadata": { - "type": "toNumber" - }, - "required": false - }, - { - "destKey": "website", - "sourceKeys": "website", - "sourceFromGenericMap": true, - "required": false - }, - { - "destKey": "industry", - "sourceKeys": ["traits.industry", "context.traits.industry"], - "required": false - }, - { - "destKey": "monthly_spend", - "sourceKeys": ["traits.monthlySpend", "context.traits.monthlySpend"], - "metadata": { - "type": "toNumber" - }, - "required": false - }, - { - "destKey": "remote_created_at", - "sourceKeys": ["traits.remoteCreatedAt", "context.traits.remoteCreatedAt"], - "metadata": { - "type": "toNumber" - }, - "required": false - } -] diff --git a/src/v0/destinations/intercom/data/INTERCOMIdentifyConfig.json b/src/v0/destinations/intercom/data/INTERCOMIdentifyConfig.json deleted file mode 100644 index 726a741161e..00000000000 --- a/src/v0/destinations/intercom/data/INTERCOMIdentifyConfig.json +++ /dev/null @@ -1,46 +0,0 @@ -[ - { - "destKey": "user_id", - "sourceKeys": [ - "userId", - "traits.userId", - "traits.id", - "context.traits.userId", - "context.traits.id" - ], - "required": false - }, - { - "destKey": "email", - "sourceKeys": ["traits.email", "context.traits.email"], - "required": false - }, - { - "destKey": "phone", - "sourceKeys": ["traits.phone", "context.traits.phone"], - "required": false - }, - { - "destKey": "name", - "sourceKeys": ["traits.name", "context.traits.name"], - "required": false - }, - { - "destKey": "signed_up_at", - "sourceKeys": ["traits.createdAt", "context.traits.createdAt"], - "required": false, - "metadata": { - "type": "secondTimestamp" - } - }, - { - "destKey": "last_seen_user_agent", - "sourceKeys": "context.userAgent", - "required": false - }, - { - "destKey": "custom_attributes", - "sourceKeys": ["traits", "context.traits"], - "required": false - } -] diff --git a/src/v0/destinations/intercom/data/INTERCOMTrackConfig.json b/src/v0/destinations/intercom/data/INTERCOMTrackConfig.json deleted file mode 100644 index f33c9a8a982..00000000000 --- a/src/v0/destinations/intercom/data/INTERCOMTrackConfig.json +++ /dev/null @@ -1,36 +0,0 @@ -[ - { - "destKey": "user_id", - "sourceKeys": [ - "userId", - "traits.userId", - "traits.id", - "context.traits.userId", - "context.traits.id" - ], - "required": false - }, - { - "destKey": "email", - "sourceKeys": ["traits.email", "context.traits.email"], - "required": false - }, - { - "destKey": "event_name", - "sourceKeys": "event", - "required": true - }, - { - "destKey": "created", - "sourceKeys": "timestamp", - "sourceFromGenericMap": true, - "required": true, - "metadata": { - "type": "secondTimestamp" - } - }, - { - "destKey": "metadata", - "sourceKeys": "properties" - } -] diff --git a/src/v0/destinations/intercom/transform.js b/src/v0/destinations/intercom/transform.js deleted file mode 100644 index 212eaba13b5..00000000000 --- a/src/v0/destinations/intercom/transform.js +++ /dev/null @@ -1,252 +0,0 @@ -const md5 = require('md5'); -const get = require('get-value'); -const { InstrumentationError } = require('@rudderstack/integrations-lib'); -const { EventType, MappedToDestinationKey } = require('../../../constants'); -const { - ConfigCategory, - MappingConfig, - ReservedTraitsProperties, - ReservedCompanyProperties, -} = require('./config'); -const { - constructPayload, - removeUndefinedAndNullValues, - defaultRequestConfig, - defaultPostRequestConfig, - getFieldValueFromMessage, - addExternalIdToTraits, - simpleProcessRouterDest, - flattenJson, -} = require('../../util'); -const { separateReservedAndRestMetadata } = require('./util'); -const { JSON_MIME_TYPE } = require('../../util/constant'); - -function getCompanyAttribute(company) { - const companiesList = []; - if (company.name || company.id) { - const customAttributes = {}; - Object.keys(company).forEach((key) => { - // the key is not in ReservedCompanyProperties - if (!ReservedCompanyProperties.includes(key)) { - const val = company[key]; - if (val !== Object(val)) { - customAttributes[key] = val; - } else { - customAttributes[key] = JSON.stringify(val); - } - } - }); - - companiesList.push({ - company_id: company.id || md5(company.name), - custom_attributes: removeUndefinedAndNullValues(customAttributes), - name: company.name, - industry: company.industry, - }); - } - return companiesList; -} - -function validateIdentify(message, payload, config) { - const finalPayload = payload; - - finalPayload.update_last_request_at = - config.updateLastRequestAt !== undefined ? config.updateLastRequestAt : true; - if (payload.user_id || payload.email) { - if (payload.name === undefined || payload.name === '') { - const firstName = getFieldValueFromMessage(message, 'firstName'); - const lastName = getFieldValueFromMessage(message, 'lastName'); - if (firstName && lastName) { - finalPayload.name = `${firstName} ${lastName}`; - } else { - finalPayload.name = firstName || lastName; - } - } - - if (get(finalPayload, 'custom_attributes.company')) { - finalPayload.companies = getCompanyAttribute(finalPayload.custom_attributes.company); - } - - if (finalPayload.custom_attributes) { - ReservedTraitsProperties.forEach((trait) => { - delete finalPayload.custom_attributes[trait]; - }); - finalPayload.custom_attributes = flattenJson(finalPayload.custom_attributes); - } - - return finalPayload; - } - throw new InstrumentationError('Either of `email` or `userId` is required for Identify call'); -} - -function validateTrack(payload) { - if (!payload.user_id && !payload.email) { - throw new InstrumentationError('Either of `email` or `userId` is required for Track call'); - } - // pass only string, number, boolean properties - if (payload.metadata) { - // reserved metadata contains JSON objects that does not requires flattening - const { reservedMetadata, restMetadata } = separateReservedAndRestMetadata(payload.metadata); - return { ...payload, metadata: { ...reservedMetadata, ...flattenJson(restMetadata) } }; - } - - return payload; -} - -const checkIfEmailOrUserIdPresent = (message, Config) => { - const { context, anonymousId } = message; - let { userId } = message; - if (Config.sendAnonymousId && !userId) { - userId = anonymousId; - } - return !!(userId || context.traits?.email); -}; - -function attachUserAndCompany(message, Config) { - const email = message.context?.traits?.email; - const { userId, anonymousId, traits, groupId } = message; - const requestBody = {}; - if (userId) { - requestBody.user_id = userId; - } - if (Config.sendAnonymousId && !userId) { - requestBody.user_id = anonymousId; - } - if (email) { - requestBody.email = email; - } - const companyObj = { - company_id: groupId, - }; - if (traits?.name) { - companyObj.name = traits.name; - } - requestBody.companies = [companyObj]; - const response = defaultRequestConfig(); - response.method = defaultPostRequestConfig.requestMethod; - response.endpoint = ConfigCategory.IDENTIFY.endpoint; - response.headers = { - 'Content-Type': JSON_MIME_TYPE, - Authorization: `Bearer ${Config.apiKey}`, - Accept: JSON_MIME_TYPE, - 'Intercom-Version': '1.4', - }; - response.body.JSON = requestBody; - return response; -} - -function buildCustomAttributes(message, payload) { - const finalPayload = payload; - const { traits } = message; - const customAttributes = {}; - const companyReservedKeys = [ - 'remoteCreatedAt', - 'monthlySpend', - 'industry', - 'website', - 'size', - 'plan', - 'name', - ]; - - if (traits) { - Object.keys(traits).forEach((key) => { - if (!companyReservedKeys.includes(key) && key !== 'userId') { - customAttributes[key] = traits[key]; - } - }); - } - - if (Object.keys(customAttributes).length > 0) { - finalPayload.custom_attributes = flattenJson(customAttributes); - } - - return finalPayload; -} - -function validateAndBuildResponse(message, payload, category, destination) { - const respList = []; - const response = defaultRequestConfig(); - response.method = defaultPostRequestConfig.requestMethod; - response.endpoint = category.endpoint; - response.headers = { - 'Content-Type': JSON_MIME_TYPE, - Authorization: `Bearer ${destination.Config.apiKey}`, - Accept: JSON_MIME_TYPE, - 'Intercom-Version': '1.4', - }; - response.userId = message.anonymousId; - const messageType = message.type.toLowerCase(); - switch (messageType) { - case EventType.IDENTIFY: - response.body.JSON = removeUndefinedAndNullValues( - validateIdentify(message, payload, destination.Config), - ); - break; - case EventType.TRACK: - response.body.JSON = removeUndefinedAndNullValues(validateTrack(payload)); - break; - case EventType.GROUP: { - response.body.JSON = removeUndefinedAndNullValues(buildCustomAttributes(message, payload)); - respList.push(response); - if (checkIfEmailOrUserIdPresent(message, destination.Config)) { - const attachUserAndCompanyResponse = attachUserAndCompany(message, destination.Config); - attachUserAndCompanyResponse.userId = message.anonymousId; - respList.push(attachUserAndCompanyResponse); - } - break; - } - default: - throw new InstrumentationError(`Message type ${messageType} not supported`); - } - - return messageType === EventType.GROUP ? respList : response; -} - -function processSingleMessage(message, destination) { - if (!message.type) { - throw new InstrumentationError('Message Type is not present. Aborting message.'); - } - const { sendAnonymousId } = destination.Config; - const messageType = message.type.toLowerCase(); - let category; - - switch (messageType) { - case EventType.IDENTIFY: - category = ConfigCategory.IDENTIFY; - break; - case EventType.TRACK: - category = ConfigCategory.TRACK; - break; - case EventType.GROUP: - category = ConfigCategory.GROUP; - break; - default: - throw new InstrumentationError(`Message type ${messageType} not supported`); - } - - // build the response and return - let payload; - if (get(message, MappedToDestinationKey)) { - addExternalIdToTraits(message); - payload = getFieldValueFromMessage(message, 'traits'); - } else { - payload = constructPayload(message, MappingConfig[category.name]); - } - if (category !== ConfigCategory.GROUP && sendAnonymousId && !payload.user_id) { - payload.user_id = message.anonymousId; - } - return validateAndBuildResponse(message, payload, category, destination); -} - -function process(event) { - const response = processSingleMessage(event.message, event.destination); - return response; -} - -const processRouterDest = async (inputs, reqMetadata) => { - const respList = await simpleProcessRouterDest(inputs, process, reqMetadata); - return respList; -}; - -module.exports = { process, processRouterDest }; diff --git a/src/v0/destinations/intercom/util.js b/src/v0/destinations/intercom/util.js deleted file mode 100644 index 24a2934f7e0..00000000000 --- a/src/v0/destinations/intercom/util.js +++ /dev/null @@ -1,32 +0,0 @@ -const { MetadataTypes } = require('./config'); - -/** - * Separates reserved metadata from rest of the metadata based on the metadata types - * ref:- https://developers.intercom.com/intercom-api-reference/v1.4/reference/event-metadata-types - * @param {*} metadata - * @returns - */ -function separateReservedAndRestMetadata(metadata) { - const reservedMetadata = {}; - const restMetadata = {}; - if (metadata) { - Object.entries(metadata).forEach(([key, value]) => { - if (value && typeof value === 'object') { - const hasMonetaryAmountKeys = MetadataTypes.monetaryAmount.every((type) => type in value); - const hasRichLinkKeys = MetadataTypes.richLink.every((type) => type in value); - if (hasMonetaryAmountKeys || hasRichLinkKeys) { - reservedMetadata[key] = value; - } else { - restMetadata[key] = value; - } - } else { - restMetadata[key] = value; - } - }); - } - - // Return the separated metadata objects - return { reservedMetadata, restMetadata }; -} - -module.exports = { separateReservedAndRestMetadata }; diff --git a/src/v0/destinations/intercom/util.test.js b/src/v0/destinations/intercom/util.test.js deleted file mode 100644 index 99dbdd1f7ec..00000000000 --- a/src/v0/destinations/intercom/util.test.js +++ /dev/null @@ -1,176 +0,0 @@ -const { separateReservedAndRestMetadata } = require('./util'); - -describe('separateReservedAndRestMetadata utility test', () => { - it('separate reserved and rest metadata', () => { - const metadata = { - property1: 1, - property2: 'test', - property3: true, - property4: { - property1: 1, - property2: 'test', - property3: { - subProp1: { - a: 'a', - b: 'b', - }, - subProp2: ['a', 'b'], - }, - }, - property5: {}, - property6: [], - property7: null, - property8: undefined, - revenue: { - amount: 1232, - currency: 'inr', - test: 123, - }, - price: { - amount: 3000, - currency: 'USD', - }, - article: { - url: 'https://example.org/ab1de.html', - value: 'the dude abides', - }, - }; - const expectedReservedMetadata = { - revenue: { - amount: 1232, - currency: 'inr', - test: 123, - }, - price: { - amount: 3000, - currency: 'USD', - }, - article: { - url: 'https://example.org/ab1de.html', - value: 'the dude abides', - }, - }; - const expectedRestMetadata = { - property1: 1, - property2: 'test', - property3: true, - property4: { - property1: 1, - property2: 'test', - property3: { - subProp1: { - a: 'a', - b: 'b', - }, - subProp2: ['a', 'b'], - }, - }, - property5: {}, - property6: [], - property7: null, - property8: undefined, - }; - const { reservedMetadata, restMetadata } = separateReservedAndRestMetadata(metadata); - - expect(expectedReservedMetadata).toEqual(reservedMetadata); - expect(expectedRestMetadata).toEqual(restMetadata); - }); - - it('reserved metadata types not present in input metadata', () => { - const metadata = { - property1: 1, - property2: 'test', - property3: true, - property4: { - property1: 1, - property2: 'test', - property3: { - subProp1: { - a: 'a', - b: 'b', - }, - subProp2: ['a', 'b'], - }, - }, - property5: {}, - property6: [], - property7: null, - property8: undefined, - }; - const expectedRestMetadata = { - property1: 1, - property2: 'test', - property3: true, - property4: { - property1: 1, - property2: 'test', - property3: { - subProp1: { - a: 'a', - b: 'b', - }, - subProp2: ['a', 'b'], - }, - }, - property5: {}, - property6: [], - property7: null, - property8: undefined, - }; - const { reservedMetadata, restMetadata } = separateReservedAndRestMetadata(metadata); - - expect({}).toEqual(reservedMetadata); - expect(expectedRestMetadata).toEqual(restMetadata); - }); - - it('metadata input contains only reserved metadata types', () => { - const metadata = { - revenue: { - amount: 1232, - currency: 'inr', - test: 123, - }, - price: { - amount: 3000, - currency: 'USD', - }, - article: { - url: 'https://example.org/ab1de.html', - value: 'the dude abides', - }, - }; - const expectedReservedMetadata = { - revenue: { - amount: 1232, - currency: 'inr', - test: 123, - }, - price: { - amount: 3000, - currency: 'USD', - }, - article: { - url: 'https://example.org/ab1de.html', - value: 'the dude abides', - }, - }; - const { reservedMetadata, restMetadata } = separateReservedAndRestMetadata(metadata); - - expect(expectedReservedMetadata).toEqual(reservedMetadata); - expect({}).toEqual(restMetadata); - }); - - it('empty metadata object', () => { - const metadata = {}; - const { reservedMetadata, restMetadata } = separateReservedAndRestMetadata(metadata); - expect({}).toEqual(reservedMetadata); - expect({}).toEqual(restMetadata); - }); - - it('null/undefined metadata', () => { - const metadata = null; - const { reservedMetadata, restMetadata } = separateReservedAndRestMetadata(metadata); - expect({}).toEqual(reservedMetadata); - expect({}).toEqual(restMetadata); - }); -}); diff --git a/src/v0/destinations/iterable/config.js b/src/v0/destinations/iterable/config.js index 125367875f2..e60e444c18a 100644 --- a/src/v0/destinations/iterable/config.js +++ b/src/v0/destinations/iterable/config.js @@ -76,11 +76,31 @@ const constructEndpoint = (dataCenter, category) => { return `${baseUrl}${category.endpoint}`; }; +const BULK_ENDPOINTS = ['/api/users/bulkUpdate', '/api/events/trackBulk']; + const IDENTIFY_MAX_BATCH_SIZE = 1000; const IDENTIFY_MAX_BODY_SIZE_IN_BYTES = 4000000; const TRACK_MAX_BATCH_SIZE = 8000; +const ITERABLE_RESPONSE_USER_ID_PATHS = [ + 'invalidUserIds', + 'failedUpdates.invalidUserIds', + 'failedUpdates.notFoundUserIds', + 'failedUpdates.forgottenUserIds', + 'failedUpdates.conflictUserIds', + 'failedUpdates.invalidDataUserIds', +]; + +const ITERABLE_RESPONSE_EMAIL_PATHS = [ + 'invalidEmails', + 'failedUpdates.invalidEmails', + 'failedUpdates.notFoundEmails', + 'failedUpdates.forgottenEmails', + 'failedUpdates.conflictEmails', + 'failedUpdates.invalidDataEmails', +]; + module.exports = { mappingConfig, ConfigCategory, @@ -88,4 +108,7 @@ module.exports = { TRACK_MAX_BATCH_SIZE, IDENTIFY_MAX_BATCH_SIZE, IDENTIFY_MAX_BODY_SIZE_IN_BYTES, + ITERABLE_RESPONSE_USER_ID_PATHS, + ITERABLE_RESPONSE_EMAIL_PATHS, + BULK_ENDPOINTS, }; diff --git a/src/v0/destinations/iterable/transform.js b/src/v0/destinations/iterable/transform.js index dd67deef69e..c676097c96a 100644 --- a/src/v0/destinations/iterable/transform.js +++ b/src/v0/destinations/iterable/transform.js @@ -1,6 +1,7 @@ const lodash = require('lodash'); const get = require('get-value'); const { InstrumentationError } = require('@rudderstack/integrations-lib'); +const logger = require('../../../logger'); const { getCatalogEndpoint, hasMultipleResponses, @@ -28,6 +29,7 @@ const { const { JSON_MIME_TYPE } = require('../../util/constant'); const { mappingConfig, ConfigCategory } = require('./config'); const { EventType, MappedToDestinationKey } = require('../../../constants'); +const { MD5 } = require('../../../cdk/v2/bindings/default'); /** * Common payload builder function for all events @@ -108,10 +110,16 @@ const responseBuilder = (message, category, destination) => { * @returns */ const responseBuilderForRegisterDeviceOrBrowserTokenEvents = (message, destination) => { - const { device } = message.context; + const { device, os } = message.context; const category = device?.token ? ConfigCategory.IDENTIFY_DEVICE : ConfigCategory.IDENTIFY_BROWSER; - const response = responseBuilder(message, category, destination); + + const categoryWithEndpoint = getCategoryWithEndpoint(category, destination.Config.dataCenter); + const response = responseBuilder(message, categoryWithEndpoint, destination); response.headers.api_key = destination.Config.registerDeviceOrBrowserApiKey; + logger.info('{{ITERABLE::}} registerDeviceApiCalled', { + destinationId: destination.ID, + token: MD5(device?.token || os?.token || 'no token'), + }); return response; }; diff --git a/src/v0/destinations/iterable/util.js b/src/v0/destinations/iterable/util.js index b918600253f..c68583afb62 100644 --- a/src/v0/destinations/iterable/util.js +++ b/src/v0/destinations/iterable/util.js @@ -69,6 +69,11 @@ const validateMandatoryField = (payload) => { } }; +const getCategoryWithEndpoint = (categoryConfig, dataCenter) => ({ + ...categoryConfig, + endpoint: constructEndpoint(dataCenter, categoryConfig), +}); + /** * Check for register device and register browser events * @param {*} message @@ -80,18 +85,13 @@ const hasMultipleResponses = (message, category, config) => { const { context } = message; const isIdentifyEvent = message.type === EventType.IDENTIFY; - const isIdentifyCategory = category === ConfigCategory.IDENTIFY; - const hasToken = context && (context.device?.token || context.os?.token); + const isIdentifyCategory = category.action === ConfigCategory.IDENTIFY.action; + const hasToken = Boolean(context && (context.device?.token || context.os?.token)); const hasRegisterDeviceOrBrowserKey = Boolean(config.registerDeviceOrBrowserApiKey); return isIdentifyEvent && isIdentifyCategory && hasToken && hasRegisterDeviceOrBrowserKey; }; -const getCategoryWithEndpoint = (categoryConfig, dataCenter) => ({ - ...categoryConfig, - endpoint: constructEndpoint(dataCenter, categoryConfig), -}); - /** * Returns category value * @param {*} message @@ -483,6 +483,7 @@ const batchUpdateUserEvents = (updateUserEvents, registerDeviceOrBrowserTokenEve /** * Processes chunks of catalog events, extracts the necessary data, and prepares batched requests for further processing + * ref : https://api.iterable.com/api/docs#catalogs_bulkUpdateCatalogItems * @param {*} catalogEventsChunks * @returns */ @@ -600,12 +601,12 @@ const batchTrackEvents = (trackEvents) => { */ const prepareBatchRequests = (filteredEvents) => { const { - trackEvents, - catalogEvents, - errorRespList, - updateUserEvents, - eventResponseList, - registerDeviceOrBrowserTokenEvents, + trackEvents, // track + catalogEvents, // identify + errorRespList, // track + updateUserEvents, // identify + eventResponseList, // track + registerDeviceOrBrowserTokenEvents, // identify } = filteredEvents; const updateUserBatchedResponseList = @@ -759,4 +760,6 @@ module.exports = { registerDeviceTokenEventPayloadBuilder, registerBrowserTokenEventPayloadBuilder, getCategoryWithEndpoint, + prepareAndSplitUpdateUserBatchesBasedOnPayloadSize, + getMergeNestedObjects, }; diff --git a/src/v0/destinations/iterable/util.test.js b/src/v0/destinations/iterable/util.test.js index 098960ac775..2fadfbe44f1 100644 --- a/src/v0/destinations/iterable/util.test.js +++ b/src/v0/destinations/iterable/util.test.js @@ -7,208 +7,194 @@ const { updateUserEventPayloadBuilder, registerDeviceTokenEventPayloadBuilder, registerBrowserTokenEventPayloadBuilder, + hasMultipleResponses, + getCategoryWithEndpoint, + getCategoryUsingEventName, + prepareAndSplitUpdateUserBatchesBasedOnPayloadSize, + getMergeNestedObjects, } = require('./util'); +const { ConfigCategory, constructEndpoint } = require('./config'); -const { ConfigCategory } = require('./config'); - -const getTestMessage = () => { - let message = { - event: 'testEventName', - anonymousId: 'anonId', - traits: { - email: 'abc@test.com', - name: 'rudder', - address: { - city: 'kolkata', - country: 'India', - }, - createdAt: '2014-05-21T15:54:20Z', - timestamp: '2014-05-21T15:54:20Z', +const testMessage = { + event: 'testEventName', + anonymousId: 'anonId', + traits: { + email: 'abc@test.com', + name: 'rudder', + address: { + city: 'kolkata', + country: 'India', }, - properties: { - category: 'test', - email: 'test@test.com', - templateId: 1234, - campaignId: 5678, - name: 'pageName', + createdAt: '2014-05-21T15:54:20Z', + timestamp: '2014-05-21T15:54:20Z', + }, + properties: { + category: 'test', + email: 'test@test.com', + templateId: 1234, + campaignId: 5678, + name: 'pageName', + }, + context: { + device: { + token: 1234, }, - context: { - device: { - token: 1234, - }, - os: { - token: 5678, - }, - mappedToDestination: false, - externalId: [ - { - id: '12345', - identifierType: 'test_identifier', - }, - ], + os: { + token: 5678, }, - }; - return message; + mappedToDestination: false, + externalId: [ + { + id: '12345', + identifierType: 'test_identifier', + }, + ], + }, }; -const getTestConfig = () => { - let config = { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: true, - trackCategorisedPages: false, - trackNamedPages: false, - }; - return config; +const testConfig = { + apiKey: '12345', + mapToSingleEvent: false, + trackAllPages: true, + trackCategorisedPages: false, + trackNamedPages: false, }; -const getTestEcommMessage = () => { - let message = { - event: 'testEventName', - anonymousId: 'anonId', - traits: { - userId: 'userId', - email: 'abc@test.com', - name: 'rudder', - address: { - city: 'kolkata', - country: 'India', - }, - createdAt: '2014-05-21T15:54:20Z', - timestamp: '2014-05-21T15:54:20Z', +const testEcommMessage = { + event: 'testEventName', + anonymousId: 'anonId', + traits: { + userId: 'userId', + email: 'abc@test.com', + name: 'rudder', + address: { + city: 'kolkata', + country: 'India', }, - properties: { - product_id: 1234, - sku: 'abcd', - name: 'no product array present', - category: 'categoryTest1, categoryTest2', - price: '10', - quantity: '2', - total: '20', - campaignId: '1111', - templateId: '2222', + createdAt: '2014-05-21T15:54:20Z', + timestamp: '2014-05-21T15:54:20Z', + }, + properties: { + product_id: 1234, + sku: 'abcd', + name: 'no product array present', + category: 'categoryTest1, categoryTest2', + price: '10', + quantity: '2', + total: '20', + campaignId: '1111', + templateId: '2222', + }, + context: { + device: { + token: 1234, }, - context: { - device: { - token: 1234, - }, - os: { - token: 5678, - }, - mappedToDestination: false, - externalId: [ - { - id: '12345', - identifierType: 'test_identifier', - }, - ], + os: { + token: 5678, }, - }; - return message; + mappedToDestination: false, + externalId: [ + { + id: '12345', + identifierType: 'test_identifier', + }, + ], + }, }; describe('iterable utils test', () => { - describe('Unit test cases for iterable registerDeviceTokenEventPayloadBuilder', () => { - it('for no device type', async () => { - let expectedOutput = { - device: { - dataFields: { - campaignId: 5678, - category: 'test', - email: 'test@test.com', - name: 'pageName', - templateId: 1234, - }, - platform: 'GCM', - token: 1234, - }, - email: 'abc@test.com', - preferUserId: true, - userId: 'anonId', - }; - expect(registerDeviceTokenEventPayloadBuilder(getTestMessage(), getTestConfig())).toEqual( - expectedOutput, - ); - }); - it('For apple family device type', async () => { - const fittingPayload = { ...getTestMessage() }; - fittingPayload.context.device.type = 'ios'; - let expectedOutput = { - device: { - dataFields: { - campaignId: 5678, - category: 'test', - email: 'test@test.com', - name: 'pageName', - templateId: 1234, - }, - platform: 'APNS', - token: 1234, - }, - email: 'abc@test.com', - preferUserId: true, - userId: 'anonId', - }; - expect(registerDeviceTokenEventPayloadBuilder(fittingPayload, getTestConfig())).toEqual( - expectedOutput, - ); - }); + describe('Unit test cases for iterable constructEndpoint', () => { + test.each([ + { + dataCenter: 'USDC', + category: { endpoint: 'users/update' }, + expected: 'https://api.iterable.com/api/users/update', + }, + { + dataCenter: 'EUDC', + category: { endpoint: 'users/update' }, + expected: 'https://api.eu.iterable.com/api/users/update', + }, + { + dataCenter: 'INVALID', + category: { endpoint: 'events/track' }, + expected: 'https://api.iterable.com/api/events/track', + }, + ])( + 'should construct endpoint for dataCenter=$dataCenter and category=$category', + ({ dataCenter, category, expected }) => { + const result = constructEndpoint(dataCenter, category); + expect(result).toBe(expected); + }, + ); + }); - it('For non apple family device type', async () => { - let fittingPayload = { ...getTestMessage() }; - fittingPayload.context.device.type = 'android'; - let expectedOutput = { - device: { - dataFields: { - campaignId: 5678, - category: 'test', - email: 'test@test.com', - name: 'pageName', - templateId: 1234, + describe('Unit test cases for iterable registerDeviceTokenEventPayloadBuilder', () => { + test.each([ + { + deviceType: undefined, + expectedPlatform: 'GCM', + }, + { + deviceType: 'ios', + expectedPlatform: 'APNS', + }, + { + deviceType: 'android', + expectedPlatform: 'GCM', + }, + ])( + 'should build payload for deviceType=$deviceType with platform=$expectedPlatform', + ({ deviceType, expectedPlatform }) => { + const message = { ...testMessage }; + if (deviceType) { + message.context.device.type = deviceType; + } + const expectedOutput = { + device: { + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, + platform: expectedPlatform, + token: 1234, }, - platform: 'GCM', - token: 1234, - }, - email: 'abc@test.com', - preferUserId: true, - userId: 'anonId', - }; - expect(registerDeviceTokenEventPayloadBuilder(fittingPayload, getTestConfig())).toEqual( - expectedOutput, - ); - }); + email: 'abc@test.com', + preferUserId: true, + userId: 'anonId', + }; + expect(registerDeviceTokenEventPayloadBuilder(message, testConfig)).toEqual(expectedOutput); + }, + ); }); + describe('Unit test cases for iterable registerBrowserTokenEventPayloadBuilder', () => { - it('flow check', async () => { - let expectedOutput = { browserToken: 5678, email: 'abc@test.com', userId: 'anonId' }; - expect(registerBrowserTokenEventPayloadBuilder(getTestMessage())).toEqual(expectedOutput); + it('should build payload for browser token', () => { + const expectedOutput = { browserToken: 5678, email: 'abc@test.com', userId: 'anonId' }; + expect(registerBrowserTokenEventPayloadBuilder(testMessage)).toEqual(expectedOutput); }); }); + describe('Unit test cases for iterable updateUserEventPayloadBuilder', () => { - it('flow check without externalId', async () => { - let expectedOutput = { - dataFields: { + test.each([ + { + mappedToDestination: false, + externalId: undefined, + expectedDataFields: { address: { city: 'kolkata', country: 'India' }, createdAt: '2014-05-21T15:54:20Z', email: 'abc@test.com', name: 'rudder', timestamp: '2014-05-21T15:54:20Z', }, - email: 'abc@test.com', - mergeNestedObjects: true, - preferUserId: true, - userId: 'anonId', - }; - expect( - updateUserEventPayloadBuilder(getTestMessage(), ConfigCategory.IDENTIFY, getTestConfig()), - ).toEqual(expectedOutput); - }); - - it('flow check with externalId', async () => { - let fittingPayload = { ...getTestMessage() }; - fittingPayload.context.mappedToDestination = true; - let expectedOutput = { - dataFields: { + }, + { + mappedToDestination: true, + externalId: '12345', + expectedDataFields: { address: { city: 'kolkata', country: 'India' }, createdAt: '2014-05-21T15:54:20Z', email: 'abc@test.com', @@ -216,29 +202,55 @@ describe('iterable utils test', () => { test_identifier: '12345', timestamp: '2014-05-21T15:54:20Z', }, - email: 'abc@test.com', - mergeNestedObjects: true, - preferUserId: true, - userId: 'anonId', - }; - expect( - updateUserEventPayloadBuilder(fittingPayload, ConfigCategory.IDENTIFY, getTestConfig()), - ).toEqual(expectedOutput); - }); + }, + ])( + 'should build payload with mappedToDestination=$mappedToDestination and externalId=$externalId', + ({ mappedToDestination, externalId, expectedDataFields }) => { + const message = { ...testMessage }; + message.context.mappedToDestination = mappedToDestination; + if (externalId) { + message.context.externalId[0].id = externalId; + } + const expectedOutput = { + dataFields: expectedDataFields, + email: 'abc@test.com', + mergeNestedObjects: true, + preferUserId: true, + userId: 'anonId', + }; + expect(updateUserEventPayloadBuilder(message, ConfigCategory.IDENTIFY, testConfig)).toEqual( + expectedOutput, + ); + }, + ); }); - describe('Unit test cases for iterbale pageEventPayloadBuilder', () => { - it('For trackAllPages', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: true, + + describe('Unit test cases for iterable pageEventPayloadBuilder', () => { + test.each([ + { + config: { trackAllPages: true, trackCategorisedPages: false, trackNamedPages: false }, + eventName: 'pageName page', + }, + { + config: { trackAllPages: false, trackCategorisedPages: true, trackNamedPages: false }, + eventName: 'pageName page', + }, + { + config: { trackAllPages: false, trackCategorisedPages: false, trackNamedPages: true }, + eventName: 'pageName page', + }, + { + config: { + mapToSingleEvent: true, + trackAllPages: false, trackCategorisedPages: false, - trackNamedPages: false, + trackNamedPages: true, }, - Enabled: true, - }; - let expectedOutput = { + eventName: 'Loaded a Page', + }, + ])('should build page event payload with config=$config', ({ config, eventName }) => { + const destination = { Config: { ...testConfig, ...config }, Enabled: true }; + const expectedOutput = { campaignId: 5678, createdAt: 1400687660000, dataFields: { @@ -249,554 +261,812 @@ describe('iterable utils test', () => { templateId: 1234, }, email: 'test@test.com', - eventName: 'pageName page', + eventName, templateId: 1234, userId: 'anonId', }; expect( - pageEventPayloadBuilder( - { ...getTestMessage(), type: 'page' }, - destination, - ConfigCategory.PAGE, - ), + pageEventPayloadBuilder({ ...testMessage, type: 'page' }, destination, ConfigCategory.PAGE), ).toEqual(expectedOutput); }); + }); - it('For trackCategorisedPages', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: false, - trackCategorisedPages: true, - trackNamedPages: false, + describe('Unit test cases for iterable screenEventPayloadBuilder', () => { + test.each([ + { + description: 'For trackAllPages', + destination: { + Config: { + apiKey: '12345', + mapToSingleEvent: false, + trackAllPages: true, + trackCategorisedPages: false, + trackNamedPages: false, + }, + Enabled: true, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'pageName screen', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'pageName page', - templateId: 1234, - userId: 'anonId', - }; - expect( - pageEventPayloadBuilder( - { ...getTestMessage(), type: 'page' }, - destination, - ConfigCategory.PAGE, - ), - ).toEqual(expectedOutput); - }); - - it('For trackNamedPages', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: false, - trackCategorisedPages: false, - trackNamedPages: true, + }, + { + description: 'For trackCategorisedPages', + destination: { + Config: { + apiKey: '12345', + mapToSingleEvent: false, + trackAllPages: false, + trackCategorisedPages: true, + trackNamedPages: false, + }, + Enabled: true, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'pageName screen', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'pageName page', - templateId: 1234, - userId: 'anonId', - }; - expect( - pageEventPayloadBuilder( - { ...getTestMessage(), type: 'page' }, - destination, - ConfigCategory.PAGE, - ), - ).toEqual(expectedOutput); - }); - - it('For mapToSingleEvent', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: true, - trackAllPages: false, - trackCategorisedPages: false, - trackNamedPages: true, + }, + { + description: 'For trackNamedPages', + destination: { + Config: { + apiKey: '12345', + mapToSingleEvent: false, + trackAllPages: false, + trackCategorisedPages: false, + trackNamedPages: true, + }, + Enabled: true, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'pageName screen', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'Loaded a Page', - templateId: 1234, - userId: 'anonId', - }; - expect( - pageEventPayloadBuilder( - { ...getTestMessage(), type: 'page' }, - destination, - ConfigCategory.PAGE, - ), - ).toEqual(expectedOutput); - }); - - it('For non-mapToSingleEvent', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: false, - trackCategorisedPages: false, - trackNamedPages: true, + }, + { + description: 'For mapToSingleEvent', + destination: { + Config: { + apiKey: '12345', + mapToSingleEvent: true, + trackAllPages: false, + trackCategorisedPages: false, + trackNamedPages: true, + }, + Enabled: true, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'Loaded a Screen', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'pageName page', - templateId: 1234, - userId: 'anonId', - }; - expect( - pageEventPayloadBuilder( - { ...getTestMessage(), type: 'page' }, - destination, - ConfigCategory.PAGE, - ), - ).toEqual(expectedOutput); - }); - }); - describe('Unit test cases for iterbale screenEventPayloadBuilder', () => { - it('For trackAllPages', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: true, - trackCategorisedPages: false, - trackNamedPages: false, + }, + { + description: 'For non-mapToSingleEvent', + destination: { + Config: { + apiKey: '12345', + mapToSingleEvent: false, + trackAllPages: false, + trackCategorisedPages: false, + trackNamedPages: true, + }, + Enabled: true, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'pageName screen', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'pageName screen', - templateId: 1234, - userId: 'anonId', - }; - expect( - screenEventPayloadBuilder( - { ...getTestMessage(), type: 'screen' }, - destination, - ConfigCategory.SCREEN, - ), - ).toEqual(expectedOutput); + }, + ])('$description', ({ destination, expectedOutput }) => { + const message = { ...testMessage, type: 'screen' }; + const result = screenEventPayloadBuilder(message, destination, ConfigCategory.SCREEN); + expect(result).toEqual(expectedOutput); }); + }); - it('For trackCategorisedPages', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: false, - trackCategorisedPages: true, - trackNamedPages: false, - }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + describe('Unit test cases for iterable trackEventPayloadBuilder', () => { + test.each([ + { + description: 'Valid payload with all fields', + message: testMessage, + category: ConfigCategory.TRACK, + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'testEventName', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'pageName screen', - templateId: 1234, - userId: 'anonId', - }; - expect( - screenEventPayloadBuilder( - { ...getTestMessage(), type: 'screen' }, - destination, - ConfigCategory.SCREEN, - ), - ).toEqual(expectedOutput); - }); - - it('For trackNamedPages', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: false, - trackCategorisedPages: false, - trackNamedPages: true, + }, + { + description: 'Payload without campaignId and templateId', + message: { + ...testMessage, + properties: { + ...testMessage.properties, + campaignId: undefined, + templateId: undefined, + }, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { - campaignId: 5678, - category: 'test', + category: ConfigCategory.TRACK, + expectedOutput: { + campaignId: undefined, + createdAt: 1400687660000, + dataFields: { + campaignId: undefined, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: undefined, + }, email: 'test@test.com', - name: 'pageName', - templateId: 1234, + eventName: 'testEventName', + templateId: undefined, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'pageName screen', - templateId: 1234, - userId: 'anonId', - }; - expect( - screenEventPayloadBuilder( - { ...getTestMessage(), type: 'screen' }, - destination, - ConfigCategory.SCREEN, - ), - ).toEqual(expectedOutput); - }); - - it('For mapToSingleEvent', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: true, - trackAllPages: false, - trackCategorisedPages: false, - trackNamedPages: true, + }, + { + description: 'Payload without email', + message: { + ...testMessage, + properties: { + ...testMessage.properties, + email: undefined, + }, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + category: ConfigCategory.TRACK, + expectedOutput: { campaignId: 5678, - category: 'test', - email: 'test@test.com', - name: 'pageName', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: undefined, + name: 'pageName', + templateId: 1234, + }, + email: undefined, + eventName: 'testEventName', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'Loaded a Screen', - templateId: 1234, - userId: 'anonId', - }; - expect( - screenEventPayloadBuilder( - { ...getTestMessage(), type: 'screen' }, - destination, - ConfigCategory.SCREEN, - ), - ).toEqual(expectedOutput); - }); - - it('For non-mapToSingleEvent', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: false, - trackCategorisedPages: false, - trackNamedPages: true, + }, + { + description: 'Payload without userId', + message: { + ...testMessage, + anonymousId: undefined, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + category: ConfigCategory.TRACK, + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'testEventName', templateId: 1234, + userId: undefined, }, - email: 'test@test.com', - eventName: 'pageName screen', - templateId: 1234, - userId: 'anonId', - }; - expect( - screenEventPayloadBuilder( - { ...getTestMessage(), type: 'screen' }, - destination, - ConfigCategory.SCREEN, - ), - ).toEqual(expectedOutput); + }, + ])('$description', ({ message, category, expectedOutput }) => { + const result = trackEventPayloadBuilder(message, category); + expect(result).toEqual(expectedOutput); }); - }); - describe('Unit test cases for iterable trackEventPayloadBuilder', () => { - it('flow check', async () => { - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { - campaignId: 5678, - category: 'test', - email: 'test@test.com', - name: 'pageName', - templateId: 1234, - }, - email: 'test@test.com', - eventName: 'testEventName', - templateId: 1234, - userId: 'anonId', + + test('should throw an error if neither email nor userId is present', () => { + const invalidMessage = { + ...testMessage, + properties: { ...testMessage.properties, email: undefined }, + anonymousId: undefined, }; - expect(trackEventPayloadBuilder(getTestMessage(), ConfigCategory.TRACK)).toEqual( - expectedOutput, + + expect(() => trackEventPayloadBuilder(invalidMessage, ConfigCategory.TRACK)).toThrow( + 'userId or email is mandatory for this request', ); }); }); + describe('Unit test cases for iterable purchaseEventPayloadBuilder', () => { - it('flow check without product array', async () => { - let expectedOutput = { - campaignId: 1111, - createdAt: 1400687660000, - dataFields: { - campaignId: '1111', - category: 'categoryTest1, categoryTest2', - name: 'no product array present', - price: '10', - product_id: 1234, - quantity: '2', - sku: 'abcd', - templateId: '2222', - total: '20', - }, - items: [ - { - categories: ['categoryTest1', ' categoryTest2'], - id: 1234, + test.each([ + { + description: 'Valid payload without product array', + message: testEcommMessage, + category: ConfigCategory.TRACK_PURCHASE, + config: testConfig, + expectedOutput: { + campaignId: 1111, + createdAt: 1400687660000, + dataFields: { + campaignId: '1111', + category: 'categoryTest1, categoryTest2', name: 'no product array present', - price: 10, - quantity: 2, + price: '10', + product_id: 1234, + quantity: '2', sku: 'abcd', + templateId: '2222', + total: '20', }, - ], - templateId: 2222, - total: 20, - user: { + items: [ + { + categories: ['categoryTest1', ' categoryTest2'], + id: 1234, + name: 'no product array present', + price: 10, + quantity: 2, + sku: 'abcd', + }, + ], + templateId: 2222, + total: 20, + user: { + dataFields: { + address: { city: 'kolkata', country: 'India' }, + createdAt: '2014-05-21T15:54:20Z', + email: 'abc@test.com', + name: 'rudder', + timestamp: '2014-05-21T15:54:20Z', + userId: 'userId', + }, + email: 'abc@test.com', + mergeNestedObjects: true, + preferUserId: true, + userId: 'userId', + }, + }, + }, + { + description: 'Valid payload with product array', + message: { + ...testEcommMessage, + properties: { + ...testEcommMessage.properties, + products: [ + { + product_id: 1234, + sku: 'abcd', + name: 'product 1', + category: 'categoryTest1, categoryTest2', + price: '10', + quantity: '2', + total: '20', + }, + ], + }, + }, + category: ConfigCategory.TRACK_PURCHASE, + config: testConfig, + expectedOutput: { + campaignId: 1111, + createdAt: 1400687660000, dataFields: { - address: { city: 'kolkata', country: 'India' }, - createdAt: '2014-05-21T15:54:20Z', + campaignId: '1111', + category: 'categoryTest1, categoryTest2', + name: 'no product array present', + price: '10', + product_id: 1234, + products: [ + { + category: 'categoryTest1, categoryTest2', + name: 'product 1', + price: '10', + product_id: 1234, + quantity: '2', + sku: 'abcd', + total: '20', + }, + ], + quantity: '2', + sku: 'abcd', + templateId: '2222', + total: '20', + }, + items: [ + { + categories: ['categoryTest1', ' categoryTest2'], + id: 1234, + name: 'product 1', + price: 10, + quantity: 2, + sku: 'abcd', + }, + ], + templateId: 2222, + total: 20, + user: { + dataFields: { + address: { city: 'kolkata', country: 'India' }, + createdAt: '2014-05-21T15:54:20Z', + email: 'abc@test.com', + name: 'rudder', + timestamp: '2014-05-21T15:54:20Z', + userId: 'userId', + }, email: 'abc@test.com', - name: 'rudder', - timestamp: '2014-05-21T15:54:20Z', + mergeNestedObjects: true, + preferUserId: true, userId: 'userId', }, - email: 'abc@test.com', - mergeNestedObjects: true, - preferUserId: true, - userId: 'userId', }, + }, + ])('$description', ({ message, category, config, expectedOutput }) => { + const result = purchaseEventPayloadBuilder(message, category, config); + expect(result).toEqual(expectedOutput); + }); + + test('should throw an error if neither email nor userId is present', () => { + const invalidMessage = { + ...testEcommMessage, + traits: { ...testEcommMessage.traits, email: undefined, userId: undefined }, + anonymousId: undefined, }; - expect( - purchaseEventPayloadBuilder( - getTestEcommMessage(), - ConfigCategory.TRACK_PURCHASE, - getTestConfig(), - ), - ).toEqual(expectedOutput); + + expect(() => + purchaseEventPayloadBuilder(invalidMessage, ConfigCategory.TRACK_PURCHASE, testConfig), + ).toThrow('userId or email is mandatory for this request'); }); + }); - it('flow check with product array', async () => { - let fittingPayload = { ...getTestEcommMessage() }; - fittingPayload.properties.products = [ - { - product_id: 1234, - sku: 'abcd', - name: 'no product array present', - category: 'categoryTest1, categoryTest2', - price: '10', - quantity: '2', - total: '20', - }, - ]; - let expectedOutput = { - campaignId: 1111, - createdAt: 1400687660000, - dataFields: { - campaignId: '1111', - category: 'categoryTest1, categoryTest2', - name: 'no product array present', - price: '10', - product_id: 1234, - products: [ + describe('Unit test cases for iterable updateCartEventPayloadBuilder', () => { + test.each([ + { + description: 'Valid payload without product array', + message: testEcommMessage, + config: testConfig, + expectedOutput: { + items: [ { - category: 'categoryTest1, categoryTest2', + categories: ['categoryTest1', ' categoryTest2'], + id: 1234, name: 'no product array present', - price: '10', - product_id: 1234, - quantity: '2', + price: 10, + quantity: 2, sku: 'abcd', - total: '20', }, ], - quantity: '2', - sku: 'abcd', - templateId: '2222', - total: '20', + user: { + dataFields: { + address: { city: 'kolkata', country: 'India' }, + createdAt: '2014-05-21T15:54:20Z', + email: 'abc@test.com', + name: 'rudder', + timestamp: '2014-05-21T15:54:20Z', + userId: 'userId', + }, + email: 'abc@test.com', + mergeNestedObjects: true, + preferUserId: true, + userId: 'userId', + }, }, - items: [ - { - categories: ['categoryTest1', ' categoryTest2'], - id: 1234, - name: 'no product array present', - price: 10, - quantity: 2, - sku: 'abcd', + }, + { + description: 'Valid payload with product array', + message: { + ...testEcommMessage, + properties: { + ...testEcommMessage.properties, + products: [ + { + product_id: 1234, + sku: 'abcd', + name: 'product 1', + category: 'categoryTest1, categoryTest2', + price: '10', + quantity: '2', + total: '20', + }, + ], }, - ], - templateId: 2222, - total: 20, - user: { - dataFields: { - address: { city: 'kolkata', country: 'India' }, - createdAt: '2014-05-21T15:54:20Z', + }, + config: testConfig, + expectedOutput: { + items: [ + { + categories: ['categoryTest1', ' categoryTest2'], + id: 1234, + name: 'product 1', + price: 10, + quantity: 2, + sku: 'abcd', + }, + ], + user: { + dataFields: { + address: { city: 'kolkata', country: 'India' }, + createdAt: '2014-05-21T15:54:20Z', + email: 'abc@test.com', + name: 'rudder', + timestamp: '2014-05-21T15:54:20Z', + userId: 'userId', + }, email: 'abc@test.com', - name: 'rudder', - timestamp: '2014-05-21T15:54:20Z', + mergeNestedObjects: true, + preferUserId: true, userId: 'userId', }, - email: 'abc@test.com', - mergeNestedObjects: true, - preferUserId: true, - userId: 'userId', }, + }, + ])('$description', ({ message, config, expectedOutput }) => { + const result = updateCartEventPayloadBuilder(message, config); + expect(result).toEqual(expectedOutput); + }); + + test('should throw an error if neither email nor userId is present', () => { + const invalidMessage = { + ...testEcommMessage, + traits: { ...testEcommMessage.traits, email: undefined, userId: undefined }, + anonymousId: undefined, }; - expect( - purchaseEventPayloadBuilder(fittingPayload, ConfigCategory.TRACK_PURCHASE, getTestConfig()), - ).toEqual(expectedOutput); + + expect(() => updateCartEventPayloadBuilder(invalidMessage, testConfig)).toThrow( + 'userId or email is mandatory for this request', + ); }); }); - describe('Unit test cases for iterable updateCartEventPayloadBuilder', () => { - it('flow check without product array', async () => { - let expectedOutput = { - items: [ - { - categories: ['categoryTest1', ' categoryTest2'], - id: 1234, - name: 'no product array present', - price: 10, - quantity: 2, - sku: 'abcd', + + describe('Unit test cases for iterable hasMultipleResponses', () => { + test.each([ + { + description: 'should return false when message type is not identify', + message: { + type: 'track', + context: { + device: { token: '123' }, + os: { token: '456' }, }, - ], - user: { - dataFields: { - address: { city: 'kolkata', country: 'India' }, - createdAt: '2014-05-21T15:54:20Z', - email: 'abc@test.com', - name: 'rudder', - timestamp: '2014-05-21T15:54:20Z', - userId: 'userId', + }, + category: getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'), + config: { registerDeviceOrBrowserApiKey: 'test-key' }, + expected: false, + }, + { + description: 'should return false when category is not identify', + message: { + type: 'identify', + context: { + device: { token: '123' }, + os: { token: '456' }, }, - email: 'abc@test.com', - mergeNestedObjects: true, - preferUserId: true, - userId: 'userId', }, - }; - expect( - updateCartEventPayloadBuilder(getTestEcommMessage(), ConfigCategory.UPDATE_CART), - ).toEqual(expectedOutput); + category: getCategoryWithEndpoint(ConfigCategory.PAGE, 'USDC'), + config: { registerDeviceOrBrowserApiKey: 'test-key' }, + expected: false, + }, + { + description: 'should return false when no device/os token is present', + message: { + type: 'identify', + context: { + device: {}, + os: {}, + }, + }, + category: getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'), + config: { registerDeviceOrBrowserApiKey: 'test-key' }, + expected: false, + }, + { + description: + 'should return false when registerDeviceOrBrowserApiKey is not present in config', + message: { + type: 'identify', + context: { + device: { token: '123' }, + os: { token: '456' }, + }, + }, + category: getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'), + config: {}, + expected: false, + }, + { + description: 'should return true when all conditions are met with device token', + message: { + type: 'identify', + context: { + device: { token: '123' }, + }, + }, + category: getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'), + config: { + dataCenter: 'USDC', + registerDeviceOrBrowserApiKey: 'test-key', + }, + expected: true, + }, + { + description: 'should return true when all conditions are met with os token', + message: { + type: 'identify', + context: { + os: { token: '456' }, + }, + }, + category: getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'), + config: { + dataCenter: 'USDC', + registerDeviceOrBrowserApiKey: 'test-key', + }, + expected: true, + }, + ])('$description', ({ message, category, config, expected }) => { + const result = hasMultipleResponses(message, category, config); + expect(result).toBe(expected); }); + }); - it('flow check with product array', async () => { - let fittingPayload = { ...getTestEcommMessage() }; - fittingPayload.properties.products = [ - { - product_id: 1234, - sku: 'abcd', - name: 'no product array present', - category: 'categoryTest1, categoryTest2', - price: '10', - quantity: '2', - total: '20', - }, - ]; - let expectedOutput = { - items: [ + describe('Unit test cases for iterable getCategoryUsingEventName', () => { + test.each([ + { + description: 'should return TRACK_PURCHASE category when event is "order completed"', + message: { + event: 'order completed', + properties: { + total: 100, + }, + }, + dataCenter: 'USDC', + expected: { + name: 'IterableTrackPurchaseConfig', + action: 'trackPurchase', + endpoint: 'https://api.iterable.com/api/commerce/trackPurchase', + }, + }, + { + description: 'should return UPDATE_CART category when event is "product added"', + message: { + event: 'product added', + properties: { + total: 100, + }, + }, + dataCenter: 'USDC', + expected: { + ...ConfigCategory.UPDATE_CART, + endpoint: 'https://api.iterable.com/api/commerce/updateCart', + }, + }, + { + description: 'should return UPDATE_CART category when event is "product removed"', + message: { + event: 'PRODUCT REMOVED', + properties: { + total: 100, + }, + }, + dataCenter: 'EUDC', + expected: { + ...ConfigCategory.UPDATE_CART, + endpoint: 'https://api.eu.iterable.com/api/commerce/updateCart', + }, + }, + { + description: 'should return TRACK category when event is a generic event', + message: { + event: 'custom event', + properties: { + total: 100, + }, + }, + dataCenter: 'USDC', + expected: { + ...ConfigCategory.TRACK, + endpoint: 'https://api.iterable.com/api/events/track', + }, + }, + ])('$description', ({ message, dataCenter, expected }) => { + const result = getCategoryUsingEventName(message, dataCenter); + expect(result).toEqual(expected); + }); + }); + describe('Unit test cases for iterable prepareAndSplitUpdateUserBatchesBasedOnPayloadSize', () => { + test.each([ + { + description: 'should split events into multiple batches when payload size exceeds limit', + chunk: [ { - categories: ['categoryTest1', ' categoryTest2'], - id: 1234, - name: 'no product array present', - price: 10, - quantity: 2, - sku: 'abcd', + metadata: { jobId: '1' }, + destination: 'dest1', + message: { body: { JSON: { id: '1', data: 'a'.repeat(3000000) } } }, + }, + { + metadata: { jobId: '2' }, + destination: 'dest1', + message: { body: { JSON: { id: '2', data: 'b'.repeat(3000000) } } }, }, ], - user: { - dataFields: { - address: { city: 'kolkata', country: 'India' }, - createdAt: '2014-05-21T15:54:20Z', - email: 'abc@test.com', - name: 'rudder', - timestamp: '2014-05-21T15:54:20Z', - userId: 'userId', + registerDeviceOrBrowserTokenEvents: { + 1: { deviceToken: 'token1' }, + 2: { deviceToken: 'token2' }, + }, + expectedBatches: [ + { + users: [{ id: '1', data: 'a'.repeat(3000000) }], + metadata: [{ jobId: '1' }], + nonBatchedRequests: [{ deviceToken: 'token1' }], + destination: 'dest1', }, - email: 'abc@test.com', - mergeNestedObjects: true, - preferUserId: true, - userId: 'userId', + { + users: [{ id: '2', data: 'b'.repeat(3000000) }], + metadata: [{ jobId: '2' }], + nonBatchedRequests: [{ deviceToken: 'token2' }], + destination: 'dest1', + }, + ], + }, + { + description: 'should return empty batches array for empty input chunk', + chunk: [], + registerDeviceOrBrowserTokenEvents: {}, + expectedBatches: [], + }, + { + description: 'should create batches with users, metadata, and non-batched requests arrays', + chunk: [ + { + metadata: { jobId: '1' }, + destination: 'dest1', + message: { body: { JSON: { id: '1' } } }, + }, + { + metadata: { jobId: '2' }, + destination: 'dest1', + message: { body: { JSON: { id: '2' } } }, + }, + ], + registerDeviceOrBrowserTokenEvents: {}, + expectedBatches: [ + { + users: [{ id: '1' }, { id: '2' }], + metadata: [{ jobId: '1' }, { jobId: '2' }], + nonBatchedRequests: [], + destination: 'dest1', + }, + ], + }, + { + description: 'should add device/browser token events to nonBatchedRequests array', + chunk: [ + { + metadata: { jobId: '1' }, + destination: 'dest1', + message: { body: { JSON: { id: '1' } } }, + }, + ], + registerDeviceOrBrowserTokenEvents: { + 1: { deviceToken: 'token1' }, }, - }; - expect(updateCartEventPayloadBuilder(fittingPayload, ConfigCategory.UPDATE_CART)).toEqual( - expectedOutput, + expectedBatches: [ + { + users: [{ id: '1' }], + metadata: [{ jobId: '1' }], + nonBatchedRequests: [{ deviceToken: 'token1' }], + destination: 'dest1', + }, + ], + }, + { + description: 'should create final batch even if size limit not reached', + chunk: [ + { + metadata: { jobId: '1' }, + destination: 'dest1', + message: { body: { JSON: { id: '1' } } }, + }, + ], + registerDeviceOrBrowserTokenEvents: { + 1: { deviceToken: 'token1' }, + }, + expectedBatches: [ + { + users: [{ id: '1' }], + metadata: [{ jobId: '1' }], + nonBatchedRequests: [{ deviceToken: 'token1' }], + destination: 'dest1', + }, + ], + }, + ])('$description', ({ chunk, registerDeviceOrBrowserTokenEvents, expectedBatches }) => { + const result = prepareAndSplitUpdateUserBatchesBasedOnPayloadSize( + chunk, + registerDeviceOrBrowserTokenEvents, ); + + expect(result).toEqual(expectedBatches); + }); + }); + + describe('Unit test cases for iterable getMergeNestedObjects', () => { + test.each([ + { + description: 'should return true when mergeNestedObjects is undefined', + config: {}, + expected: true, + }, + { + description: 'should return true when mergeNestedObjects is true', + config: { mergeNestedObjects: true }, + expected: true, + }, + { + description: 'should return false when mergeNestedObjects is false', + config: { mergeNestedObjects: false }, + expected: false, + }, + ])('$description', ({ config, expected }) => { + const result = getMergeNestedObjects(config); + expect(result).toBe(expected); }); }); }); diff --git a/src/v0/destinations/klaviyo/util.js b/src/v0/destinations/klaviyo/util.js index 4421764d953..42e1d8a8012 100644 --- a/src/v0/destinations/klaviyo/util.js +++ b/src/v0/destinations/klaviyo/util.js @@ -1,5 +1,6 @@ const set = require('set-value'); const lodash = require('lodash'); +const { parsePhoneNumberFromString } = require('libphonenumber-js'); const { NetworkError, InstrumentationError } = require('@rudderstack/integrations-lib'); const { WhiteListedTraits } = require('../../../constants'); const { @@ -32,6 +33,24 @@ const { const REVISION_CONSTANT = '2023-02-22'; +/** + * This function is used to check if the phone number is in E.164 format. It uses libphonenumber-js library to parse the phone number + * @param {*} phoneNumber + * @returns boolean + */ +function isValidE164PhoneNumber(phoneNumber) { + try { + // Remove all non-numeric characters from the phone number like spaces, hyphens, etc. + const sanitizedPhoneNumber = phoneNumber.replace(/[^\d+]/g, ''); + const parsedNumber = parsePhoneNumberFromString(sanitizedPhoneNumber); + // Check if the number is valid and properly formatted in E.164. + return parsedNumber && parsedNumber.format('E.164') === sanitizedPhoneNumber; + } catch (error) { + // If parsing fails, it's not a valid E.164 number, i.e doesn't start with '+' and country code + return false; + } +} + /** * This function calls the create user endpoint ref: https://developers.klaviyo.com/en/reference/create_profile * If the user doesn't exist, it creates a profile for the user and return 201 status code and the response which contains all the profile data @@ -414,6 +433,12 @@ const constructProfile = (message, destination, isIdentifyCall) => { message, MAPPING_CONFIG[CONFIG_CATEGORIES.PROFILEV2.name], ); + if ( + isDefinedAndNotNull(profileAttributes.phone_number) && + !isValidE164PhoneNumber(profileAttributes.phone_number) + ) { + throw new InstrumentationError('Phone number is not in E.164 format.'); + } const { enforceEmailAsPrimary, flattenProperties } = destination.Config; let customPropertyPayload = {}; const { meta, metadataFields } = getProfileMetadataAndMetadataFields(message); diff --git a/src/v0/destinations/lambda/transform.js b/src/v0/destinations/lambda/transform.js index efc68b89d6f..5f6cbfda8b9 100644 --- a/src/v0/destinations/lambda/transform.js +++ b/src/v0/destinations/lambda/transform.js @@ -1,6 +1,5 @@ const _ = require('lodash'); -const { getErrorRespEvents } = require('@rudderstack/integrations-lib'); -const { getSuccessRespEvents } = require('../../util'); +const { getSuccessRespEvents, getErrorRespEvents } = require('../../util'); const { ConfigurationError } = require('@rudderstack/integrations-lib'); const DEFAULT_INVOCATION_TYPE = 'Event'; // asynchronous invocation diff --git a/src/v0/destinations/marketo/networkHandler.js b/src/v0/destinations/marketo/networkHandler.js index ac555accfe2..f3bb4c9da70 100644 --- a/src/v0/destinations/marketo/networkHandler.js +++ b/src/v0/destinations/marketo/networkHandler.js @@ -1,13 +1,12 @@ -const v0Utils = require('../../util'); const { marketoResponseHandler } = require('./util'); const { proxyRequest, prepareProxyRequest } = require('../../../adapters/network'); const { processAxiosResponse } = require('../../../adapters/utils/networkUtils'); +const { authCache } = require('./transform'); const responseHandler = (responseParams) => { - const { destinationResponse, destType, rudderJobMetadata } = responseParams; + const { destinationResponse, rudderJobMetadata } = responseParams; const message = 'Request Processed Successfully'; const { status } = destinationResponse; - const authCache = v0Utils.getDestAuthCacheInstance(destType); // check for marketo application level failures marketoResponseHandler( destinationResponse, diff --git a/src/v0/destinations/marketo/transform.js b/src/v0/destinations/marketo/transform.js index accca1d4490..683d4bd8ffb 100644 --- a/src/v0/destinations/marketo/transform.js +++ b/src/v0/destinations/marketo/transform.js @@ -7,17 +7,10 @@ const { InstrumentationError, ConfigurationError, UnauthorizedError, - getErrorRespEvents, } = require('@rudderstack/integrations-lib'); const stats = require('../../../util/stats'); const { EventType, MappedToDestinationKey } = require('../../../constants'); -const { - identifyConfig, - formatConfig, - LEAD_LOOKUP_METRIC, - ACTIVITY_METRIC, - FETCH_TOKEN_METRIC, -} = require('./config'); +const { identifyConfig, formatConfig, LEAD_LOOKUP_METRIC, ACTIVITY_METRIC } = require('./config'); const { addExternalIdToTraits, getDestinationExternalIDInfoForRetl, @@ -32,52 +25,17 @@ const { isDefinedAndNotNull, generateErrorObject, handleRtTfSingleEventError, + getErrorRespEvents, } = require('../../util'); const Cache = require('../../util/cache'); const { USER_LEAD_CACHE_TTL, AUTH_CACHE_TTL, JSON_MIME_TYPE } = require('../../util/constant'); -const { - marketoResponseHandler, - sendGetRequest, - sendPostRequest, - getResponseHandlerData, -} = require('./util'); +const { sendGetRequest, sendPostRequest, getResponseHandlerData, getAuthToken } = require('./util'); const logger = require('../../../logger'); const userIdLeadCache = new Cache(USER_LEAD_CACHE_TTL); // 1 day const emailLeadCache = new Cache(USER_LEAD_CACHE_TTL); // 1 day const authCache = new Cache(AUTH_CACHE_TTL); // 1 hr -// ////////////////////////////////////////////////////////////////////// -// BASE URL REF: https://developers.marketo.com/rest-api/base-url/ -// ////////////////////////////////////////////////////////////////////// - -// calls Marketo Auth API and fetches bearer token -// fails the transformer if auth fails -// ------------------------ -// Ref: https://developers.marketo.com/rest-api/authentication/#creating_an_access_token -const getAuthToken = async (formattedDestination, metadata) => - authCache.get(formattedDestination.ID, async () => { - const { accountId, clientId, clientSecret } = formattedDestination; - const clientResponse = await sendGetRequest( - `https://${accountId}.mktorest.com/identity/oauth/token`, - { - params: { - client_id: clientId, - client_secret: clientSecret, - grant_type: 'client_credentials', - }, - }, - metadata, - ); - const data = marketoResponseHandler(clientResponse, 'During fetching auth token'); - if (data) { - stats.increment(FETCH_TOKEN_METRIC, { status: 'success' }); - return { value: data.access_token, age: data.expires_in }; - } - stats.increment(FETCH_TOKEN_METRIC, { status: 'failed' }); - return null; - }); - // lookup Marketo with userId or anonymousId // Marketo will create the lead // fails transformer if lookup fails - fields are not created in Marketo @@ -460,7 +418,7 @@ const processEvent = async ({ message, destination, metadata }, token) => { }; const process = async (event) => { - const token = await getAuthToken(formatConfig(event.destination), event.metadata); + const token = await getAuthToken(authCache, formatConfig(event.destination), event.metadata); if (!token) { throw new UnauthorizedError('Authorization failed'); } @@ -473,7 +431,7 @@ const processRouterDest = async (inputs, reqMetadata) => { // If destination information is not present Error should be thrown let token; try { - token = await getAuthToken(formatConfig(inputs[0].destination), inputs[0].metadata); + token = await getAuthToken(authCache, formatConfig(inputs[0].destination), inputs[0].metadata); // If token is null track/identify calls cannot be executed. if (!token) { diff --git a/src/v0/destinations/marketo/util.js b/src/v0/destinations/marketo/util.js index aee872efac0..1a88653a544 100644 --- a/src/v0/destinations/marketo/util.js +++ b/src/v0/destinations/marketo/util.js @@ -6,6 +6,7 @@ const { UnhandledStatusCodeError, InstrumentationError, } = require('@rudderstack/integrations-lib'); +const stats = require('../../../util/stats'); const { httpGET, httpPOST } = require('../../../adapters/network'); const { getDynamicErrorType, @@ -59,7 +60,7 @@ const MARKETO_THROTTLED_CODES = ['502', '606', '607', '608', '615']; // '1049', // ]; -const { DESTINATION } = require('./config'); +const { DESTINATION, FETCH_TOKEN_METRIC } = require('./config'); const logger = require('../../../logger'); // handles marketo application level failures @@ -72,12 +73,14 @@ const marketoApplicationErrorHandler = (marketoResponse, sourceMessage, destinat 400, marketoResponse, ); - } else if (errors && MARKETO_THROTTLED_CODES.includes(errors[0].code)) { + } + if (errors && MARKETO_THROTTLED_CODES.includes(errors[0].code)) { throw new ThrottledError( `Request Failed for ${destination}, ${errors[0].message} (Throttled).${sourceMessage}`, marketoResponse, ); - } else if (errors && MARKETO_RETRYABLE_CODES.includes(errors[0].code)) { + } + if (errors && MARKETO_RETRYABLE_CODES.includes(errors[0].code)) { throw new RetryableError( `Request Failed for ${destination}, ${errors[0].message} (Retryable).${sourceMessage}`, 500, @@ -283,7 +286,35 @@ const getResponseHandlerData = (clientResponse, lookupMessage, formattedDestinat authCache, ); +// ////////////////////////////////////////////////////////////////////// +// BASE URL REF: https://developers.marketo.com/rest-api/base-url/ +// ////////////////////////////////////////////////////////////////////// + +// calls Marketo Auth API and fetches bearer token +// fails the transformer if auth fails +// ------------------------ +// Ref: https://developers.marketo.com/rest-api/authentication/#creating_an_access_token +const getAuthToken = async (authCache, formattedDestination, metadata) => + authCache.get(formattedDestination.ID, async () => { + const { accountId, clientId, clientSecret } = formattedDestination; + const clientResponse = await sendGetRequest( + `https://${accountId}.mktorest.com/identity/oauth/token`, + { + params: { + client_id: clientId, + client_secret: clientSecret, + grant_type: 'client_credentials', + }, + }, + metadata, + ); + const data = marketoResponseHandler(clientResponse, 'During fetching auth token'); + stats.increment(FETCH_TOKEN_METRIC, { status: 'success' }); + return { value: data.access_token, age: data.expires_in }; + }); + module.exports = { + getAuthToken, marketoResponseHandler, sendGetRequest, sendPostRequest, diff --git a/src/v0/destinations/marketo/util.test.js b/src/v0/destinations/marketo/util.test.js new file mode 100644 index 00000000000..b8ac7970664 --- /dev/null +++ b/src/v0/destinations/marketo/util.test.js @@ -0,0 +1,157 @@ +const { getAuthToken } = require('./util'); +const { httpGET } = require('../../../adapters/network'); +const stats = require('../../../util/stats'); +const { + RetryableError, + filter, + UnhandledStatusCodeError, + ThrottledError, +} = require('@rudderstack/integrations-lib'); + +jest.mock('../../../adapters/network'); +jest.mock('../../../util/stats'); + +describe('getAuthToken', () => { + const mockAuthCache = { + get: jest.fn().mockImplementation(async (key, fn) => fn()), + }; + + const mockFormattedDestination = { + ID: 'test-dest-id', + accountId: 'test-account', + clientId: 'test-client', + clientSecret: 'test-secret', + }; + + const mockMetadata = { + jobId: 'test-job', + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + const testCases = [ + { + name: 'should successfully get auth token', + mockResponse: { + success: true, + response: { + data: { + access_token: 'test-token', + expires_in: 3600, + }, + status: 200, + }, + }, + expectedResult: { + value: 'test-token', + age: 3600, + }, + expectedStats: { + increment: { + metric: 'marketo_fetch_token', + tags: { status: 'success' }, + }, + }, + }, + { + name: 'should handle expired token', + mockResponse: { + success: true, + response: { + data: { + access_token: 'expired-token', + expires_in: 0, + }, + status: 200, + }, + }, + expectedError: new RetryableError( + 'Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token', + 500, + ), + }, + { + name: 'should handle throttled status code', + mockResponse: { + response: { + data: { + errors: [ + { + code: '606', + }, + ], + }, + status: 200, + }, + }, + expectedError: new ThrottledError( + 'Request Failed for marketo, undefined (Throttled).During fetching auth token', + ), + }, + { + name: 'should handle unknown status code', + mockResponse: { + response: { + data: { + errors: [ + { + code: 'unknown-code', + }, + ], + }, + status: 200, + }, + }, + expectedError: new UnhandledStatusCodeError('Error occurred During fetching auth token', { + data: { + errors: [{ code: 'unknown-code' }], + }, + }), + }, + ]; + + filter(testCases).forEach( + ({ name, mockResponse, expectedResult, expectedError, expectedStats }) => { + it(name, async () => { + httpGET.mockResolvedValueOnce(mockResponse); + + if (expectedError) { + await expect( + getAuthToken(mockAuthCache, mockFormattedDestination, mockMetadata), + ).rejects.toThrow(expectedError); + } else { + const result = await getAuthToken(mockAuthCache, mockFormattedDestination, mockMetadata); + expect(result).toEqual(expectedResult); + } + + expect(httpGET).toHaveBeenCalledWith( + 'https://test-account.mktorest.com/identity/oauth/token', + { + params: { + client_id: 'test-client', + client_secret: 'test-secret', + grant_type: 'client_credentials', + }, + }, + { + destType: 'marketo', + feature: 'transformation', + endpointPath: '/v1/leads', + requestMethod: 'GET', + module: 'router', + metadata: mockMetadata, + }, + ); + + if (expectedStats) { + expect(stats.increment).toHaveBeenCalledWith( + expectedStats.increment.metric, + expectedStats.increment.tags, + ); + } + }); + }, + ); +}); diff --git a/src/v0/destinations/marketo_static_list/networkHandler.js b/src/v0/destinations/marketo_static_list/networkHandler.js index 086378cf6ac..2b59c36fafd 100644 --- a/src/v0/destinations/marketo_static_list/networkHandler.js +++ b/src/v0/destinations/marketo_static_list/networkHandler.js @@ -1,14 +1,13 @@ const { marketoResponseHandler } = require('../marketo/util'); const { proxyRequest, prepareProxyRequest } = require('../../../adapters/network'); -const v0Utils = require('../../util'); const { processAxiosResponse } = require('../../../adapters/utils/networkUtils'); const { DESTINATION } = require('./config'); +const { authCache } = require('./util'); const responseHandler = (responseParams) => { - const { destinationResponse, destType, rudderJobMetadata } = responseParams; + const { destinationResponse, rudderJobMetadata } = responseParams; const message = 'Request Processed Successfully'; const { status } = destinationResponse; - const authCache = v0Utils.getDestAuthCacheInstance(destType); // check for marketo application level failures marketoResponseHandler( destinationResponse, diff --git a/src/v0/destinations/marketo_static_list/testData/constants.js b/src/v0/destinations/marketo_static_list/testData/constants.js index 2c420c6bc2a..673db80ac6e 100644 --- a/src/v0/destinations/marketo_static_list/testData/constants.js +++ b/src/v0/destinations/marketo_static_list/testData/constants.js @@ -1,16 +1,20 @@ +const { generateRandomString } = require('@rudderstack/integrations-lib'); + +const clientSecret = generateRandomString(); +const ACCESS_TOKEN = generateRandomString(); const EXTERNAL_ID = 'marketoStaticListId'; -const TOKEN = 'Bearer access_token_success'; +const AUTH_HEADER_TOKEN = `Bearer ${ACCESS_TOKEN}`; const CONTENT_TYPE = 'application/json'; const DEST_CONFIG = { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', - staticListId: 1234, + clientId: 'marketo_static_list_client_id_success', + clientSecret, + accountId: 'marketo_static_list_unit_test_success', + staticListId: 1122, }; const DEST_DEFINITION = { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', - Name: 'MARKETO', - DisplayName: 'Marketo', + Name: 'MARKETO_STATIC_LIST', + DisplayName: 'Marketo Static List', transformAt: 'processor', transformAtV1: 'processor', }; @@ -18,12 +22,7 @@ const DEST_OBJECT = { ID: '1zwa1wKshSt81YksKmUdJnr4IOK', Name: 'test_marketo_rc', DestinationDefinition: DEST_DEFINITION, - Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', - staticListId: 1122, - }, + Config: DEST_CONFIG, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -36,7 +35,8 @@ const MESSAGE_SOURCES_CONTEXT = { module.exports = { EXTERNAL_ID, - TOKEN, + ACCESS_TOKEN, + AUTH_HEADER_TOKEN, CONTENT_TYPE, DEST_OBJECT, DEST_DEFINITION, diff --git a/src/v0/destinations/marketo_static_list/testData/testData.js b/src/v0/destinations/marketo_static_list/testData/testData.js index 45328436ce7..a94a97f4d9c 100644 --- a/src/v0/destinations/marketo_static_list/testData/testData.js +++ b/src/v0/destinations/marketo_static_list/testData/testData.js @@ -1,6 +1,6 @@ const { EXTERNAL_ID, - TOKEN, + AUTH_HEADER_TOKEN, CONTENT_TYPE, DEST_OBJECT, DEST_DEFINITION, @@ -128,9 +128,9 @@ const recordOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=1001&id=1003', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/id001/leads.json?id=1001&id=1003', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -162,9 +162,9 @@ const recordOutput = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=2001', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/id002/leads.json?id=2001', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -193,9 +193,9 @@ const recordOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=1002', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/id002/leads.json?id=1002', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -1375,9 +1375,9 @@ const largeRecordOutput = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=351&id=352&id=353&id=354&id=355&id=356&id=357&id=358&id=359&id=360&id=361&id=362&id=363&id=364&id=365&id=366&id=367&id=368&id=369&id=370&id=371&id=372&id=373&id=374&id=375&id=376&id=377&id=378&id=379&id=380&id=381&id=382&id=383&id=384&id=385&id=386&id=387&id=388&id=389&id=390&id=391&id=392&id=393&id=394&id=395&id=396&id=397&id=398&id=399&id=400&id=401&id=402&id=403&id=404&id=405&id=406&id=407&id=408&id=409&id=410&id=411&id=412&id=413&id=414&id=415&id=416&id=417&id=418&id=419&id=420&id=421&id=422&id=423&id=424&id=425&id=426&id=427&id=428&id=429&id=430&id=431&id=432&id=433&id=434&id=435&id=436&id=437&id=438&id=439&id=440&id=441&id=442&id=443&id=444&id=445&id=446&id=447&id=448&id=449&id=450', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=351&id=352&id=353&id=354&id=355&id=356&id=357&id=358&id=359&id=360&id=361&id=362&id=363&id=364&id=365&id=366&id=367&id=368&id=369&id=370&id=371&id=372&id=373&id=374&id=375&id=376&id=377&id=378&id=379&id=380&id=381&id=382&id=383&id=384&id=385&id=386&id=387&id=388&id=389&id=390&id=391&id=392&id=393&id=394&id=395&id=396&id=397&id=398&id=399&id=400&id=401&id=402&id=403&id=404&id=405&id=406&id=407&id=408&id=409&id=410&id=411&id=412&id=413&id=414&id=415&id=416&id=417&id=418&id=419&id=420&id=421&id=422&id=423&id=424&id=425&id=426&id=427&id=428&id=429&id=430&id=431&id=432&id=433&id=434&id=435&id=436&id=437&id=438&id=439&id=440&id=441&id=442&id=443&id=444&id=445&id=446&id=447&id=448&id=449&id=450', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -1703,9 +1703,9 @@ const largeRecordOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299&id=300', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299&id=300', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -1722,9 +1722,9 @@ const largeRecordOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -2803,9 +2803,9 @@ const mixedBatchOutput = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=911&id=912&id=913&id=914&id=915&id=916&id=917&id=918&id=919&id=920', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=911&id=912&id=913&id=914&id=915&id=916&id=917&id=918&id=919&id=920', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -2861,9 +2861,9 @@ const mixedBatchOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=901&id=902&id=903&id=904&id=905&id=906&id=907&id=908&id=909&id=910', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=901&id=902&id=903&id=904&id=905&id=906&id=907&id=908&id=909&id=910', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -2919,9 +2919,9 @@ const mixedBatchOutput = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=704&id=705&id=706', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=704&id=705&id=706', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -2938,9 +2938,9 @@ const mixedBatchOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=501&id=502&id=503', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=501&id=502&id=503', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -2977,9 +2977,9 @@ const mixedBatchOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -2996,9 +2996,9 @@ const mixedBatchOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -3037,12 +3037,7 @@ const recordEventGenerator = (id, action, externalId) => { ID: '1zwa1wKshSt81YksKmUdJnr4IOK', Name: 'test_marketo_rc', DestinationDefinition: DEST_DEFINITION, - Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', - staticListId: 1122, - }, + Config: DEST_CONFIG, Enabled: true, Transformations: [], IsProcessorEnabled: true, diff --git a/src/v0/destinations/marketo_static_list/transform.js b/src/v0/destinations/marketo_static_list/transform.js index 810b528bbf1..c6f55c473cf 100644 --- a/src/v0/destinations/marketo_static_list/transform.js +++ b/src/v0/destinations/marketo_static_list/transform.js @@ -1,26 +1,20 @@ const lodash = require('lodash'); const cloneDeep = require('lodash/cloneDeep'); -const { - InstrumentationError, - UnauthorizedError, - getErrorRespEvents, -} = require('@rudderstack/integrations-lib'); +const { InstrumentationError, UnauthorizedError } = require('@rudderstack/integrations-lib'); const { defaultPostRequestConfig, defaultDeleteRequestConfig, generateErrorObject, simpleProcessRouterDest, + getErrorRespEvents, } = require('../../util'); -const { AUTH_CACHE_TTL, JSON_MIME_TYPE } = require('../../util/constant'); -const { getIds, validateMessageType } = require('./util'); +const { JSON_MIME_TYPE } = require('../../util/constant'); +const { getIds, validateMessageType, authCache } = require('./util'); const { getDestinationExternalID, defaultRequestConfig } = require('../../util'); const { formatConfig, MAX_LEAD_IDS_SIZE } = require('./config'); -const Cache = require('../../util/cache'); -const { getAuthToken } = require('../marketo/transform'); +const { getAuthToken } = require('../marketo/util'); const { processRecordInputs } = require('./transformV2'); -const authCache = new Cache(AUTH_CACHE_TTL); // 1 hr - const responseBuilder = (endPoint, leadIds, operation, token) => { let updatedEndpoint = endPoint; if (leadIds.length > 0) { @@ -93,7 +87,7 @@ const processEvent = (event) => { // eslint-disable-next-line @typescript-eslint/no-unused-vars const process = async (event, _processParams) => { - const token = await getAuthToken(formatConfig(event.destination), event.metadata); + const token = await getAuthToken(authCache, formatConfig(event.destination), event.metadata); if (!token) { throw new UnauthorizedError('Authorization failed'); } @@ -108,7 +102,7 @@ const processRouterDest = async (inputs, reqMetadata) => { const { destination, metadata } = inputs[0]; try { - const token = await getAuthToken(formatConfig(destination), metadata); + const token = await getAuthToken(authCache, formatConfig(destination), metadata); if (!token) { throw new UnauthorizedError('Could not retrieve authorisation token'); } diff --git a/src/v0/destinations/marketo_static_list/transform.test.js b/src/v0/destinations/marketo_static_list/transform.test.js deleted file mode 100644 index 3c387c42957..00000000000 --- a/src/v0/destinations/marketo_static_list/transform.test.js +++ /dev/null @@ -1,138 +0,0 @@ -const { processRouterDest } = require('./transform'); -const axios = require('axios'); -const MockAxiosAdapter = require('axios-mock-adapter'); -const { - recordInputs, - audiencelistInputs, - reqMetadata, - recordOutput, - largeRecordOutput, - mixedBatchOutput, - recordEventGenerator, -} = require('./testData/testData'); - -const mockAdapter = new MockAxiosAdapter(axios, { onNoMatch: 'throwException' }); -beforeAll(() => { - mockAdapter - .onGet('https://marketo_acct_id_success.mktorest.com/identity/oauth/token') - .reply(200, { access_token: 'access_token_success' }); -}); -describe('Unit cases covering the router flow for both record and audiencelist event types', () => { - it('Sending a small batch of only record events (4 events)', async () => { - const inputs = recordInputs; - const result = await processRouterDest(inputs, reqMetadata); - - // assert that the result is as expected - expect(result.length).toEqual(3); - expect(result[0].batchedRequest.length).toEqual(1); // 1 batched request for 2 record events - expect(result[1].batchedRequest.length).toEqual(1); // 1 batched request for 1 record events - expect(result[2].batchedRequest.length).toEqual(1); // 1 batched request for 1 record events - expect(result[0].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=1001&id=1003', - ); // 1 api call for 2 leadIds - expect(result[1].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=2001', - ); // 1 api call for 1 leadId - expect(result[2].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=1002', - ); // 1 api call for 1 leadId - expect(result[1].batchedRequest[0].method).toEqual('DELETE'); // DELETE requests are sent first - expect(result[0].metadata.length).toEqual(2); // 2 metadata objects for 2 record events - expect(result[1].metadata.length).toEqual(1); // 1 metadata object for 1 record event - expect(result[2].metadata.length).toEqual(1); // 1 metadata object for 1 record event - expect(result).toEqual(recordOutput); // overall result should be equal to the expected output - }); - - it('Sending a large batch of only record events (450 events: 350 inserts | 100 deletes )', async () => { - const largeRecordInputs = []; - for (let index = 0; index < 350; index++) { - largeRecordInputs.push(recordEventGenerator(index + 1, 'insert', 1122)); - } - for (let index = 350; index < 450; index++) { - largeRecordInputs.push(recordEventGenerator(index + 1, 'delete', 1122)); - } - const result = await processRouterDest(largeRecordInputs, reqMetadata); - - // assert that the result is as expected - /* - Total 3 API calls - 1. 1 API call for 100 DELETE requests - 2. 1 API call for 100 POST requests = limit reached for Marketo, leads split to next API call - 3. 1 API call for 50 POST requests - */ - expect(result.length).toEqual(2); - expect(result[0].batchedRequest.length).toEqual(1); // 1 batched request for 1 record event - expect(result[1].batchedRequest.length).toEqual(2); // 1 batched request for 2 record events - expect(result[0].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=351&id=352&id=353&id=354&id=355&id=356&id=357&id=358&id=359&id=360&id=361&id=362&id=363&id=364&id=365&id=366&id=367&id=368&id=369&id=370&id=371&id=372&id=373&id=374&id=375&id=376&id=377&id=378&id=379&id=380&id=381&id=382&id=383&id=384&id=385&id=386&id=387&id=388&id=389&id=390&id=391&id=392&id=393&id=394&id=395&id=396&id=397&id=398&id=399&id=400&id=401&id=402&id=403&id=404&id=405&id=406&id=407&id=408&id=409&id=410&id=411&id=412&id=413&id=414&id=415&id=416&id=417&id=418&id=419&id=420&id=421&id=422&id=423&id=424&id=425&id=426&id=427&id=428&id=429&id=430&id=431&id=432&id=433&id=434&id=435&id=436&id=437&id=438&id=439&id=440&id=441&id=442&id=443&id=444&id=445&id=446&id=447&id=448&id=449&id=450', - ); - expect(result[1].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299&id=300', - ); - expect(result[1].batchedRequest[1].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', - ); - expect(result[0].batchedRequest[0].method).toEqual('DELETE'); // DELETE requests are sent first - expect(result[1].batchedRequest[0].method).toEqual('POST'); - expect(result[1].batchedRequest[1].method).toEqual('POST'); - expect(result[0].metadata.length).toEqual(100); // 100 metadata objects for 100 record events - expect(result[1].metadata.length).toEqual(350); // 350 metadata objects for 350 record events - expect(result).toEqual(largeRecordOutput); // overall result should be equal to the expected output - }); - - it('Sending a mixed batch of record and audiencelist events (22 events: 10 inserts | 10 deletes | 2 audiencelist (⌐■_■) )', async () => { - const mixedBatchInputs = []; - for (let index = 900; index < 910; index++) { - mixedBatchInputs.push(recordEventGenerator(index + 1, 'insert', 1122)); - } - for (let index = 910; index < 920; index++) { - mixedBatchInputs.push(recordEventGenerator(index + 1, 'delete', 1122)); - } - mixedBatchInputs.push(...audiencelistInputs); - const result = await processRouterDest(mixedBatchInputs, reqMetadata); - - // assert that the result is as expected - /* - Total 4 API calls - 1. 1 API call for 10 DELETE requests - 2. 1 API call for 10 POST requests = limit reached for Marketo, leads split to next API call - 3. 1 API call for 2 POST requests - 4. 1 API call for 2 POST requests - */ - expect(result.length).toEqual(4); - expect(result[0].batchedRequest.length).toEqual(1); // 1 batched request for 1 record event - expect(result[1].batchedRequest.length).toEqual(1); // 1 batched request for 1 record event - expect(result[2].batchedRequest.length).toEqual(2); // 1 batched request for 2 audiencelist events - expect(result[3].batchedRequest.length).toEqual(2); // 1 batched request for 2 audiencelist events - expect(result[0].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=911&id=912&id=913&id=914&id=915&id=916&id=917&id=918&id=919&id=920', - ); - expect(result[1].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=901&id=902&id=903&id=904&id=905&id=906&id=907&id=908&id=909&id=910', - ); - expect(result[2].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=704&id=705&id=706', - ); - expect(result[2].batchedRequest[1].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=501&id=502&id=503', - ); - expect(result[3].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', - ); - expect(result[2].batchedRequest[1].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=501&id=502&id=503', - ); - expect(result[0].batchedRequest[0].method).toEqual('DELETE'); // DELETE requests are sent first - expect(result[1].batchedRequest[0].method).toEqual('POST'); - expect(result[1].batchedRequest[0].method).toEqual('POST'); - expect(result[2].batchedRequest[0].method).toEqual('DELETE'); - expect(result[0].metadata.length).toEqual(10); - expect(result[1].metadata.length).toEqual(10); - expect(result[2].metadata.length).toEqual(1); - expect(result[3].metadata.length).toEqual(1); - expect(result).toEqual(mixedBatchOutput); // overall result should be equal to the expected output - }); -}); -afterAll(() => { - mockAdapter.restore(); -}); diff --git a/src/v0/destinations/marketo_static_list/transformV2.js b/src/v0/destinations/marketo_static_list/transformV2.js index 73d4bec8f81..0c58ab2a5ab 100644 --- a/src/v0/destinations/marketo_static_list/transformV2.js +++ b/src/v0/destinations/marketo_static_list/transformV2.js @@ -1,9 +1,5 @@ const lodash = require('lodash'); -const { - InstrumentationError, - UnauthorizedError, - getErrorRespEvents, -} = require('@rudderstack/integrations-lib'); +const { InstrumentationError, UnauthorizedError } = require('@rudderstack/integrations-lib'); const { defaultPostRequestConfig, defaultDeleteRequestConfig, @@ -11,11 +7,13 @@ const { getSuccessRespEvents, isDefinedAndNotNull, generateErrorObject, + getErrorRespEvents, } = require('../../util'); const { JSON_MIME_TYPE } = require('../../util/constant'); const { MAX_LEAD_IDS_SIZE } = require('./config'); -const { getAuthToken } = require('../marketo/transform'); +const { getAuthToken } = require('../marketo/util'); const { formatConfig } = require('../marketo/config'); +const { authCache } = require('./util'); /** * Generates the final response structure to be sent to the destination @@ -76,7 +74,7 @@ const batchResponseBuilder = (listId, Config, token, leadIds, operation) => { * @returns An array containing the batched responses for the insert and delete actions along with the metadata. */ async function processRecordInputs(groupedRecordInputs, destination, listId) { - const token = await getAuthToken(formatConfig(destination)); + const token = await getAuthToken(authCache, formatConfig(destination)); if (!token) { throw new UnauthorizedError('Authorization failed'); } diff --git a/src/v0/destinations/marketo_static_list/util.js b/src/v0/destinations/marketo_static_list/util.js index c6959cb2564..39cc6c147e3 100644 --- a/src/v0/destinations/marketo_static_list/util.js +++ b/src/v0/destinations/marketo_static_list/util.js @@ -1,5 +1,9 @@ /* eslint-disable unicorn/consistent-destructuring */ const { InstrumentationError } = require('@rudderstack/integrations-lib'); +const Cache = require('../../util/cache'); +const { AUTH_CACHE_TTL } = require('../../util/constant'); + +const authCache = new Cache(AUTH_CACHE_TTL); // 1 hr /** * Fetches the ids from the array of objects @@ -38,4 +42,5 @@ const validateMessageType = (message, allowedTypes) => { module.exports = { getIds, validateMessageType, + authCache, }; diff --git a/src/v0/destinations/mautic/utils.js b/src/v0/destinations/mautic/utils.js index fc9654d2e3a..061c91f3578 100644 --- a/src/v0/destinations/mautic/utils.js +++ b/src/v0/destinations/mautic/utils.js @@ -1,5 +1,6 @@ /* eslint-disable no-return-assign, no-param-reassign, no-restricted-syntax */ const get = require('get-value'); +const validator = require('validator'); const { NetworkError, InstrumentationError, @@ -24,15 +25,7 @@ const { JSON_MIME_TYPE } = require('../../util/constant'); function createAxiosUrl(propertyName, value, baseUrl) { return `${baseUrl}/contacts?where%5B0%5D%5Bcol%5D=${propertyName}&where%5B0%5D%5Bexpr%5D=eq&where%5B0%5D%5Bval%5D=${value}`; } -/** - * @param {*} inputText - * @returns Boolean Value - * for validating email match - */ -function validateEmail(inputText) { - const mailformat = /^[\d%+._a-z-]+@[\d.a-z-]+\.[a-z]{2,3}$/; - return mailformat.test(inputText); -} + /** * @param {*} message * @param {*} lookUpField @@ -126,7 +119,7 @@ const validatePayload = (payload) => { throw new InstrumentationError('The provided phone number is invalid'); } - if (payload.email && !validateEmail(payload.email)) { + if (payload.email && !validator.isEmail(payload.email)) { throw new InstrumentationError('The provided email is invalid'); } return true; @@ -220,7 +213,6 @@ const getEndpoint = (Config) => { }; module.exports = { deduceStateField, - validateEmail, validatePhone, deduceAddressFields, validateGroupCall, diff --git a/src/v0/destinations/moengage/config.js b/src/v0/destinations/moengage/config.js index 95aa6c0f89f..98efac4f166 100644 --- a/src/v0/destinations/moengage/config.js +++ b/src/v0/destinations/moengage/config.js @@ -24,6 +24,7 @@ const endpointIND = { alias: `https://api-03.moengage.com/v1/customer/merge?app_id=`, }; +// moengage supports object types, we added a new mapping for identify, track and device to support object data type const CONFIG_CATEGORIES = { IDENTIFY: { type: 'identify', name: 'MOENGAGEIdentifyConfig' }, TRACK: { type: 'track', name: 'MOENGAGETrackConfig' }, @@ -32,14 +33,26 @@ const CONFIG_CATEGORIES = { type: 'identifyAttr', name: 'MOENGAGEIdentifyAttributesConfig', }, + IDENTIFY_ATTR_OBJ: { + type: 'identifyAttr', + name: 'MOENGAGEIdentifyAttributesObjectConfig', + }, DEVICE_ATTR: { type: 'deviceAttr', name: 'MOENGAGEDeviceAttributesConfig', }, + DEVICE_ATTR_OBJ: { + type: 'deviceAttr', + name: 'MOENGAGEDeviceAttributesObjectConfig', + }, TRACK_ATTR: { type: 'trackAttr', name: 'MOENGAGETrackAttributesConfig', }, + TRACK_ATTR_OBJ: { + type: 'trackAttrObj', + name: 'MOENGAGETrackAttributesObjectConfig', + }, ALIAS: { type: 'alias', name: 'MoEngageAliasConfig' }, }; diff --git a/src/v0/destinations/moengage/data/MOENGAGEDeviceAttributesObjectConfig.json b/src/v0/destinations/moengage/data/MOENGAGEDeviceAttributesObjectConfig.json new file mode 100644 index 00000000000..d7578a4d522 --- /dev/null +++ b/src/v0/destinations/moengage/data/MOENGAGEDeviceAttributesObjectConfig.json @@ -0,0 +1,45 @@ +[ + { + "destKey": "platform", + "sourceKeys": ["context.device.type", "channel"], + "required": true + }, + { + "destKey": "push_id", + "sourceKeys": "context.device.token", + "required": true + }, + { + "destKey": "model", + "sourceKeys": "context.device.model", + "required": false + }, + { + "destKey": "push_preference", + "sourceKeys": ["properties.push_preference", "properties.pushPreference"], + "required": false + }, + { + "destKey": "app_version", + "sourceKeys": "context.app.version", + "required": false + }, + { + "destKey": "os_version", + "sourceKeys": "context.os.version", + "required": false + }, + { + "destKey": "active", + "sourceKeys": "properties.active", + "required": false + }, + { + "destKey": "data", + "sourceKeys": "properties", + "required": false, + "metadata": { + "excludes": ["active", "push_preference", "id", "_id", "pushPreference"] + } + } +] diff --git a/src/v0/destinations/moengage/data/MOENGAGEIdentifyAttributesObjectConfig.json b/src/v0/destinations/moengage/data/MOENGAGEIdentifyAttributesObjectConfig.json new file mode 100644 index 00000000000..5b0d9310c7d --- /dev/null +++ b/src/v0/destinations/moengage/data/MOENGAGEIdentifyAttributesObjectConfig.json @@ -0,0 +1,149 @@ +[ + { + "destKey": "name", + "sourceKeys": ["traits.name", "context.traits.name"], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "first_name", + "sourceKeys": [ + "traits.firstname", + "traits.first_name", + "traits.firstName", + "context.traits.firstname", + "context.traits.first_name", + "context.traits.firstName" + ], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "last_name", + "sourceKeys": [ + "traits.lastname", + "traits.last_name", + "traits.lastName", + "context.traits.lastname", + "context.traits.last_name", + "context.traits.lastName" + ], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "email", + "sourceKeys": ["traits.email", "context.traits.email"], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "age", + "sourceKeys": ["traits.age", "context.traits.age"], + "required": false, + "metadata": { + "type": "toNumber" + } + }, + { + "destKey": "gender", + "sourceKeys": ["traits.gender", "context.traits.gender"], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "mobile", + "sourceKeys": ["traits.mobile", "context.traits.mobile"], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "source", + "sourceKeys": ["traits.source", "context.traits.source"], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "created_time", + "sourceKeys": ["traits.createdAt", "context.traits.createdAt"], + "required": false + }, + { + "destKey": "last_seen", + "sourceKeys": [ + "traits.last_seen", + "context.traits.last_seen", + "traits.lastSeen", + "context.traits.lastSeen" + ], + "required": false + }, + { + "destKey": "transactions", + "sourceKeys": ["traits.transactions", "context.traits.transactions"], + "required": false, + "metadata": { + "type": "toNumber" + } + }, + { + "destKey": "revenue", + "sourceKeys": ["traits.revenue", "context.traits.revenue"], + "required": false, + "metadata": { + "type": "toNumber" + } + }, + { + "destKey": "moe_unsubscribe", + "sourceKeys": [ + "traits.moe_unsubscribe", + "context.traits.moe_unsubscribe", + "traits.moeUnsubscribe", + "context.traits.moeUnsubscribe" + ], + "required": false + }, + { + "destKey": "data", + "sourceKeys": ["traits", "context.traits"], + "required": false, + "metadata": { + "excludes": [ + "_id", + "age", + "email", + "firstName", + "first_name", + "firstname", + "gender", + "id", + "lastName", + "lastSeen", + "last_name", + "last_seen", + "lastname", + "mobile", + "moeUnsubscribe", + "moe_unsubscribe", + "revenue", + "source", + "transactions" + ] + } + } +] diff --git a/src/v0/destinations/moengage/data/MOENGAGETrackAttributesObjectConfig.json b/src/v0/destinations/moengage/data/MOENGAGETrackAttributesObjectConfig.json new file mode 100644 index 00000000000..cb08c38e48e --- /dev/null +++ b/src/v0/destinations/moengage/data/MOENGAGETrackAttributesObjectConfig.json @@ -0,0 +1,35 @@ +[ + { + "destKey": "action", + "sourceKeys": "event", + "required": true + }, + { + "destKey": "attributes", + "sourceKeys": "properties", + "required": false + }, + { + "destKey": "platform", + "sourceKeys": ["context.device.type", "channel"], + "required": false + }, + { + "destKey": "app_version", + "sourceKeys": "context.app.version", + "required": false + }, + { + "destKey": "current_time", + "sourceKeys": ["timestamp", "originalTimestamp"], + "required": false + }, + { + "destKey": "user_timezone_offset", + "sourceKeys": "context.timezone", + "required": false, + "metadata": { + "type": "getOffsetInSec" + } + } +] diff --git a/src/v0/destinations/moengage/transform.js b/src/v0/destinations/moengage/transform.js index 8a16d9c7a71..2b094067592 100644 --- a/src/v0/destinations/moengage/transform.js +++ b/src/v0/destinations/moengage/transform.js @@ -3,6 +3,8 @@ const { ConfigurationError, TransformationError, InstrumentationError, + isObject, + isEmptyObject, } = require('@rudderstack/integrations-lib'); const { EventType } = require('../../../constants'); const { @@ -23,24 +25,92 @@ const { } = require('../../util'); const { JSON_MIME_TYPE } = require('../../util/constant'); -function responseBuilderSimple(message, category, destination) { - const payload = constructPayload(message, MAPPING_CONFIG[category.name]); - const { apiId, region, apiKey } = destination.Config; - const response = defaultRequestConfig(); - // check the region and which api end point should be used +// moengage supports object type, if user enables object data type we merge the custom attributes +// ref: https://help.moengage.com/hc/en-us/articles/29787626775828-Support-for-Object-Data-Type +const mergeCustomAttributes = (attributes) => { + if (!attributes.data) { + return attributes; + } + const { data, ...rest } = attributes; + return isObject(data) ? { ...rest, ...data } : rest; +}; + +// check the region and which api end point should be used +const getCommonDestinationEndpoint = ({ apiId, region, category }) => { switch (region) { case 'EU': - response.endpoint = `${endpointEU[category.type]}${apiId}`; - break; + return `${endpointEU[category.type]}${apiId}`; case 'US': - response.endpoint = `${endpointUS[category.type]}${apiId}`; - break; + return `${endpointUS[category.type]}${apiId}`; case 'IND': - response.endpoint = `${endpointIND[category.type]}${apiId}`; - break; + return `${endpointIND[category.type]}${apiId}`; default: throw new ConfigurationError('The region is not valid'); } +}; + +const createDestinationPayload = ({ message, category, useObjectData }) => { + const payload = {}; + const setPayloadAttributes = (configCategory) => { + payload.attributes = constructPayload(message, MAPPING_CONFIG[configCategory]); + payload.attributes = useObjectData + ? mergeCustomAttributes(payload.attributes) + : flattenJson(payload.attributes); + }; + + switch (category.type) { + case 'identify': + // Track User + payload.type = 'customer'; + setPayloadAttributes( + useObjectData + ? CONFIG_CATEGORIES.IDENTIFY_ATTR_OBJ.name + : CONFIG_CATEGORIES.IDENTIFY_ATTR.name, + ); + return payload; + case 'device': + // Track Device + payload.type = 'device'; + setPayloadAttributes( + useObjectData ? CONFIG_CATEGORIES.DEVICE_ATTR_OBJ.name : CONFIG_CATEGORIES.DEVICE_ATTR.name, + ); + + if (isAppleFamily(payload.attributes?.platform)) { + payload.attributes.platform = 'iOS'; + } + return payload; + case 'track': + // Create Event + payload.type = 'event'; + payload.actions = [ + constructPayload( + message, + useObjectData + ? MAPPING_CONFIG[CONFIG_CATEGORIES.TRACK_ATTR_OBJ.name] + : MAPPING_CONFIG[CONFIG_CATEGORIES.TRACK_ATTR.name], + ), + ]; + + if (isAppleFamily(payload.actions[0]?.platform)) { + payload.actions[0].platform = 'iOS'; + } + return payload; + default: + throw new InstrumentationError(`Event type ${category.type} is not supported`); + } +}; + +function responseBuilderSimple(message, category, destination) { + // preparing base payload with mandatory fields + const basePayload = constructPayload(message, MAPPING_CONFIG[category.name]); + if (!basePayload) { + // fail-safety for developer error + throw new TransformationError('Base payload could not be constructed'); + } + + const { apiId, region, apiKey, useObjectData } = destination.Config; + const response = defaultRequestConfig(); + response.endpoint = getCommonDestinationEndpoint({ apiId, region, category }); response.method = defaultPostRequestConfig.requestMethod; response.headers = { 'Content-Type': JSON_MIME_TYPE, @@ -49,59 +119,19 @@ function responseBuilderSimple(message, category, destination) { // using base64 and prepends it with the string 'Basic '. Authorization: `Basic ${btoa(`${apiId}:${apiKey}`)}`, }; - response.userId = message.anonymousId || message.userId; - if (payload) { - switch (category.type) { - case 'identify': - // Ref: https://docs.moengage.com/docs/data-import-apis#user-api - payload.type = 'customer'; - payload.attributes = constructPayload( - message, - MAPPING_CONFIG[CONFIG_CATEGORIES.IDENTIFY_ATTR.name], - ); - // nested attributes are not by moengage so it is falttened - payload.attributes = flattenJson(payload.attributes); - break; - case 'device': - // Ref: https://docs.moengage.com/docs/data-import-apis#device-api - payload.type = 'device'; - payload.attributes = constructPayload( - message, - MAPPING_CONFIG[CONFIG_CATEGORIES.DEVICE_ATTR.name], - ); - // nested attributes are not by moengage so it is falttened - payload.attributes = flattenJson(payload.attributes); - - // Ref - https://developers.moengage.com/hc/en-us/articles/4413167466260-Device- - if (isAppleFamily(payload.attributes?.platform)) { - payload.attributes.platform = 'iOS'; - } - break; - case 'track': - // Ref: https://docs.moengage.com/docs/data-import-apis#event-api - payload.type = 'event'; - payload.actions = [ - constructPayload(message, MAPPING_CONFIG[CONFIG_CATEGORIES.TRACK_ATTR.name]), - ]; + response.userId = message.userId || message.anonymousId; - // Ref - https://developers.moengage.com/hc/en-us/articles/4413174104852-Event- - if (isAppleFamily(payload.actions[0]?.platform)) { - payload.actions[0].platform = 'iOS'; - } - break; - case EventType.ALIAS: - // clean as per merge user call in moengage - delete response.headers['MOE-APPKEY']; - break; - default: - throw new InstrumentationError(`Event type ${category.type} is not supported`); - } - - response.body.JSON = removeUndefinedAndNullValues(payload); - } else { - // fail-safety for developer error + if (category.type === 'alias') { + delete response.headers['MOE-APPKEY']; + response.body.JSON = removeUndefinedAndNullValues(basePayload); + return response; + } + + const payload = createDestinationPayload({ message, category, useObjectData }); + if (isEmptyObject(payload)) { throw new TransformationError('Payload could not be constructed'); } + response.body.JSON = removeUndefinedAndNullValues({ ...basePayload, ...payload }); return response; } @@ -153,4 +183,9 @@ const processRouterDest = async (inputs, reqMetadata) => { return respList; }; -module.exports = { process, processRouterDest }; +module.exports = { + process, + processRouterDest, + mergeCustomAttributes, + getCommonDestinationEndpoint, +}; diff --git a/src/v0/destinations/moengage/transform.test.js b/src/v0/destinations/moengage/transform.test.js new file mode 100644 index 00000000000..54ad7bc9f50 --- /dev/null +++ b/src/v0/destinations/moengage/transform.test.js @@ -0,0 +1,74 @@ +const { mergeCustomAttributes, getCommonDestinationEndpoint } = require('./transform'); +const { endpointEU, endpointUS, endpointIND } = require('./config'); +const { ConfigurationError } = require('@rudderstack/integrations-lib'); + +describe('mergeCustomAttributes', () => { + test('should return attributes as is if data is not present', () => { + const attributes = { key1: 'value1', key2: 'value2' }; + const result = mergeCustomAttributes(attributes); + expect(result).toEqual(attributes); + }); + + test('should merge data into attributes if data is an object', () => { + const attributes = { key1: 'value1', data: { key2: 'value2', key3: 'value3' } }; + const result = mergeCustomAttributes(attributes); + expect(result).toEqual({ key1: 'value1', key2: 'value2', key3: 'value3' }); + }); + + test('should return attributes without data if data is not an object', () => { + const attributes = { key1: 'value1', data: 'notAnObject' }; + const result = mergeCustomAttributes(attributes); + expect(result).toEqual({ key1: 'value1' }); + }); + + test('should handle empty attributes', () => { + const attributes = {}; + const result = mergeCustomAttributes(attributes); + expect(result).toEqual(attributes); + }); + + test('should handle attributes with empty data object', () => { + const attributes = { key1: 'value1', data: {} }; + const result = mergeCustomAttributes(attributes); + expect(result).toEqual({ key1: 'value1' }); + }); +}); + +describe('getCommonDestinationEndpoint', () => { + test('should return EU endpoint', () => { + const result = getCommonDestinationEndpoint({ + apiId: 'testApiId', + region: 'EU', + category: { type: 'identify' }, + }); + expect(result).toBe(endpointEU.identify + 'testApiId'); + }); + + test('should return US endpoint', () => { + const result = getCommonDestinationEndpoint({ + apiId: 'testApiId', + region: 'US', + category: { type: 'track' }, + }); + expect(result).toBe(endpointUS.track + 'testApiId'); + }); + + test('should return IND endpoint', () => { + const result = getCommonDestinationEndpoint({ + apiId: 'testApiId', + region: 'IND', + category: { type: 'device' }, + }); + expect(result).toBe(endpointIND.device + 'testApiId'); + }); + + test('should throw ConfigurationError for invalid region', () => { + expect(() => { + getCommonDestinationEndpoint({ + apiId: 'testApiId', + region: 'INVALID', + category: { type: 'identify' }, + }); + }).toThrow(new ConfigurationError('The region is not valid')); + }); +}); diff --git a/src/v0/destinations/mp/data/MPEventPropertiesConfig.json b/src/v0/destinations/mp/data/MPEventPropertiesConfig.json index 956b60248eb..bed246bc7be 100644 --- a/src/v0/destinations/mp/data/MPEventPropertiesConfig.json +++ b/src/v0/destinations/mp/data/MPEventPropertiesConfig.json @@ -76,11 +76,11 @@ "destKey": "mp_lib" }, { - "sourceKeys": "context.page.initialReferrer", + "sourceKeys": ["context.page.initialReferrer", "context.page.initial_referrer"], "destKey": "$initial_referrer" }, { - "sourceKeys": "context.page.initialReferringDomain", + "sourceKeys": ["context.page.initialReferringDomain", "context.page.initial_referring_domain"], "destKey": "$initial_referring_domain" }, { diff --git a/src/v0/destinations/mp/data/MPProfilePropertiesIOS.json b/src/v0/destinations/mp/data/MPProfilePropertiesIOS.json index 7220ebda231..0ffffdefc19 100644 --- a/src/v0/destinations/mp/data/MPProfilePropertiesIOS.json +++ b/src/v0/destinations/mp/data/MPProfilePropertiesIOS.json @@ -12,11 +12,11 @@ "destKey": "$ios_version" }, { - "sourceKeys": "context.app.build", + "sourceKeys": "context.app.version", "destKey": "$ios_app_release" }, { - "sourceKeys": "context.app.version", + "sourceKeys": "context.app.build", "destKey": "$ios_app_version" }, { diff --git a/src/v0/destinations/mp/transform.js b/src/v0/destinations/mp/transform.js index 02eca8ed22f..1860f9c9db8 100644 --- a/src/v0/destinations/mp/transform.js +++ b/src/v0/destinations/mp/transform.js @@ -163,9 +163,14 @@ const getEventValueForTrackEvent = (message, destination) => { } const unixTimestamp = toUnixTimestampInMS(message.timestamp || message.originalTimestamp); + + const traits = destination.Config?.dropTraitsInTrackEvent + ? {} + : { ...message?.context?.traits }; + let properties = { ...message.properties, - ...get(message, 'context.traits'), + ...traits, ...mappedProperties, token: destination.Config.token, distinct_id: message.userId || message.anonymousId, diff --git a/src/v0/destinations/mp/util.js b/src/v0/destinations/mp/util.js index b2807d6e119..50a8f9ac2b8 100644 --- a/src/v0/destinations/mp/util.js +++ b/src/v0/destinations/mp/util.js @@ -17,6 +17,7 @@ const { isObject, isDefinedAndNotNullAndNotEmpty, isDefinedAndNotNull, + removeUndefinedValues, } = require('../../util'); const { ConfigCategory, @@ -32,6 +33,30 @@ const mPProfileAndroidConfigJson = mappingConfig[ConfigCategory.PROFILE_ANDROID. const mPProfileIosConfigJson = mappingConfig[ConfigCategory.PROFILE_IOS.name]; const mPSetOnceConfigJson = mappingConfig[ConfigCategory.SET_ONCE.name]; +/** + * This method populates the payload with device fields based on mp mapping + * @param message + * @param rawPayload + * @returns + */ +const populateDeviceFieldsInPayload = (message, rawPayload) => { + const device = get(message, 'context.device'); + let payload = {}; + let updatedRawPayload = { ...rawPayload }; + if (device) { + const deviceTokenArray = isDefinedAndNotNull(device.token) ? [device.token] : undefined; + if (isAppleFamily(device.type)) { + payload = constructPayload(message, mPProfileIosConfigJson); + updatedRawPayload.$ios_devices = deviceTokenArray; + } else if (device.type?.toLowerCase() === 'android') { + payload = constructPayload(message, mPProfileAndroidConfigJson); + updatedRawPayload.$android_devices = deviceTokenArray; + } + updatedRawPayload = removeUndefinedValues(updatedRawPayload); + } + return { ...updatedRawPayload, ...payload }; +}; + /** * this function has been used to create * @param {*} message rudderstack identify payload @@ -75,18 +100,8 @@ const getTransformedJSON = (message, mappingJson, useNewMapping) => { } } - const device = get(message, 'context.device'); - if (device && device.token) { - let payload; - if (isAppleFamily(device.type)) { - payload = constructPayload(message, mPProfileIosConfigJson); - rawPayload.$ios_devices = [device.token]; - } else if (device.type.toLowerCase() === 'android') { - payload = constructPayload(message, mPProfileAndroidConfigJson); - rawPayload.$android_devices = [device.token]; - } - rawPayload = { ...rawPayload, ...payload }; - } + rawPayload = populateDeviceFieldsInPayload(message, rawPayload); + if (message.channel === 'web' && message.context?.userAgent) { const browser = getBrowserInfo(message.context.userAgent); rawPayload.$browser = browser.name; @@ -373,4 +388,5 @@ module.exports = { trimTraits, generatePageOrScreenCustomEventName, recordBatchSizeMetrics, + getTransformedJSON, }; diff --git a/src/v0/destinations/mp/util.test.js b/src/v0/destinations/mp/util.test.js index 3666081f593..98c9b88201d 100644 --- a/src/v0/destinations/mp/util.test.js +++ b/src/v0/destinations/mp/util.test.js @@ -5,9 +5,11 @@ const { buildUtmParams, trimTraits, generatePageOrScreenCustomEventName, + getTransformedJSON, } = require('./util'); const { FEATURE_GZIP_SUPPORT } = require('../../util/constant'); const { ConfigurationError } = require('@rudderstack/integrations-lib'); +const { mappingConfig, ConfigCategory } = require('./config'); const maxBatchSizeMock = 2; @@ -30,7 +32,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{prop:1}]', + batch: JSON.stringify([{ prop: 1 }]), }, }, userId: 'user1', @@ -41,7 +43,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{prop:2}]', + batch: JSON.stringify([{ prop: 2 }]), }, }, userId: 'user2', @@ -52,7 +54,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/groups', body: { JSON_ARRAY: { - batch: '[{prop:3}]', + batch: JSON.stringify([{ prop: 3 }]), }, }, userId: 'user1', @@ -63,7 +65,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/track', body: { JSON_ARRAY: { - batch: '[{prop:4}]', + batch: JSON.stringify([{ prop: 4 }]), }, }, userId: 'user1', @@ -74,7 +76,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/import', body: { JSON_ARRAY: { - batch: '[{prop:5}]', + batch: JSON.stringify([{ prop: 5 }]), }, }, userId: 'user2', @@ -90,7 +92,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{prop:1}]', + batch: JSON.stringify([{ prop: 1 }]), }, }, userId: 'user1', @@ -101,7 +103,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{prop:2}]', + batch: JSON.stringify([{ prop: 2 }]), }, }, userId: 'user2', @@ -114,7 +116,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/groups', body: { JSON_ARRAY: { - batch: '[{prop:3}]', + batch: JSON.stringify([{ prop: 3 }]), }, }, userId: 'user1', @@ -127,7 +129,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/import', body: { JSON_ARRAY: { - batch: '[{prop:5}]', + batch: JSON.stringify([{ prop: 5 }]), }, }, userId: 'user2', @@ -147,7 +149,7 @@ describe('Unit test cases for batchEvents', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{"prop":1}]', + batch: JSON.stringify([{ prop: 1 }]), }, }, headers: {}, @@ -161,7 +163,7 @@ describe('Unit test cases for batchEvents', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{"prop":2}]', + batch: JSON.stringify([{ prop: 2 }]), }, }, headers: {}, @@ -175,7 +177,7 @@ describe('Unit test cases for batchEvents', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{"prop":3}]', + batch: JSON.stringify([{ prop: 3 }]), }, }, headers: {}, @@ -192,7 +194,12 @@ describe('Unit test cases for batchEvents', () => { { batched: true, batchedRequest: { - body: { FORM: {}, JSON: {}, JSON_ARRAY: { batch: '[{"prop":1},{"prop":2}]' }, XML: {} }, + body: { + FORM: {}, + JSON: {}, + JSON_ARRAY: { batch: JSON.stringify([{ prop: 1 }, { prop: 2 }]) }, + XML: {}, + }, endpoint: '/engage', files: {}, headers: {}, @@ -208,7 +215,12 @@ describe('Unit test cases for batchEvents', () => { { batched: true, batchedRequest: { - body: { FORM: {}, JSON: {}, JSON_ARRAY: { batch: '[{"prop":3}]' }, XML: {} }, + body: { + FORM: {}, + JSON: {}, + JSON_ARRAY: { batch: JSON.stringify([{ prop: 3 }]) }, + XML: {}, + }, endpoint: '/engage', files: {}, headers: {}, @@ -235,13 +247,13 @@ describe('Unit test cases for generateBatchedPayloadForArray', () => { it('should generate a batched payload with GZIP payload for /import endpoint when given an array of events', () => { const events = [ { - body: { JSON_ARRAY: { batch: '[{"event": "event1"}]' } }, + body: { JSON_ARRAY: { batch: JSON.stringify([{ event: 'event1' }]) } }, endpoint: '/import', headers: { 'Content-Type': 'application/json' }, params: {}, }, { - body: { JSON_ARRAY: { batch: '[{"event": "event2"}]' } }, + body: { JSON_ARRAY: { batch: JSON.stringify([{ event: 'event2' }]) } }, endpoint: '/import', headers: { 'Content-Type': 'application/json' }, params: {}, @@ -254,7 +266,7 @@ describe('Unit test cases for generateBatchedPayloadForArray', () => { JSON_ARRAY: {}, XML: {}, GZIP: { - payload: '[{"event":"event1"},{"event":"event2"}]', + payload: JSON.stringify([{ event: 'event1' }, { event: 'event2' }]), }, }, endpoint: '/import', @@ -276,13 +288,13 @@ describe('Unit test cases for generateBatchedPayloadForArray', () => { it('should generate a batched payload with JSON_ARRAY body when given an array of events', () => { const events = [ { - body: { JSON_ARRAY: { batch: '[{"event": "event1"}]' } }, + body: { JSON_ARRAY: { batch: JSON.stringify([{ event: 'event1' }]) } }, endpoint: '/endpoint', headers: { 'Content-Type': 'application/json' }, params: {}, }, { - body: { JSON_ARRAY: { batch: '[{"event": "event2"}]' } }, + body: { JSON_ARRAY: { batch: JSON.stringify([{ event: 'event2' }]) } }, endpoint: '/endpoint', headers: { 'Content-Type': 'application/json' }, params: {}, @@ -292,7 +304,7 @@ describe('Unit test cases for generateBatchedPayloadForArray', () => { body: { FORM: {}, JSON: {}, - JSON_ARRAY: { batch: '[{"event":"event1"},{"event":"event2"}]' }, + JSON_ARRAY: { batch: JSON.stringify([{ event: 'event1' }, { event: 'event2' }]) }, XML: {}, }, endpoint: '/endpoint', @@ -489,3 +501,199 @@ describe('generatePageOrScreenCustomEventName', () => { expect(result).toBe(expected); }); }); + +describe('Unit test cases for getTransformedJSON', () => { + it('should transform the message payload to appropriate payload if device.token is present', () => { + const message = { + context: { + app: { + build: '1', + name: 'LeanPlumIntegrationAndroid', + namespace: 'com.android.SampleLeanPlum', + version: '1.0', + }, + device: { + id: '5094f5704b9cf2b3', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'ios', + token: 'test_device_token', + }, + network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true }, + os: { name: 'iOS', version: '8.1.0' }, + timezone: 'Asia/Kolkata', + traits: { userId: 'test_user_id' }, + }, + }; + const result = getTransformedJSON(message, mappingConfig[ConfigCategory.IDENTIFY.name], true); + + const expectedResult = { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $wifi: true, + userId: 'test_user_id', + $ios_devices: ['test_device_token'], + $os: 'iOS', + $ios_device_model: 'Android SDK built for x86', + $ios_version: '8.1.0', + $ios_app_release: '1.0', + $ios_app_version: '1', + }; + + expect(result).toEqual(expectedResult); + }); + + it('should transform the message payload to appropriate payload if device.token is present and device.token is null', () => { + const message = { + context: { + app: { + build: '1', + name: 'LeanPlumIntegrationAndroid', + namespace: 'com.android.SampleLeanPlum', + version: '1.0', + }, + device: { + id: '5094f5704b9cf2b3', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + token: null, + }, + network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true }, + os: { name: 'Android', version: '8.1.0' }, + timezone: 'Asia/Kolkata', + traits: { userId: 'test_user_id' }, + }, + }; + const result = getTransformedJSON(message, mappingConfig[ConfigCategory.IDENTIFY.name], true); + + const expectedResult = { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $wifi: true, + userId: 'test_user_id', + $os: 'Android', + $android_model: 'Android SDK built for x86', + $android_os_version: '8.1.0', + $android_manufacturer: 'Google', + $android_app_version: '1.0', + $android_app_version_code: '1.0', + $android_brand: 'Google', + }; + + expect(result).toEqual(expectedResult); + }); + + it('should transform the message payload to appropriate payload if device.token is not present for apple device', () => { + const message = { + context: { + app: { + build: '1', + name: 'LeanPlumIntegrationAndroid', + namespace: 'com.android.SampleLeanPlum', + version: '1.0', + }, + device: { + id: '5094f5704b9cf2b3', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'ios', + }, + network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true }, + os: { name: 'iOS', version: '8.1.0' }, + timezone: 'Asia/Kolkata', + traits: { userId: 'test_user_id' }, + }, + }; + const result = getTransformedJSON(message, mappingConfig[ConfigCategory.IDENTIFY.name], true); + + const expectedResult = { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $wifi: true, + userId: 'test_user_id', + $os: 'iOS', + $ios_device_model: 'Android SDK built for x86', + $ios_version: '8.1.0', + $ios_app_release: '1.0', + $ios_app_version: '1', + }; + + expect(result).toEqual(expectedResult); + }); + + it('should transform the message payload to appropriate payload if device.token is not present for android device', () => { + const message = { + context: { + app: { + build: '1', + name: 'LeanPlumIntegrationAndroid', + namespace: 'com.android.SampleLeanPlum', + version: '1.0', + }, + device: { + id: '5094f5704b9cf2b3', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + token: undefined, + }, + network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true }, + os: { name: 'Android', version: '8.1.0' }, + timezone: 'Asia/Kolkata', + traits: { userId: 'test_user_id' }, + }, + }; + const result = getTransformedJSON(message, mappingConfig[ConfigCategory.IDENTIFY.name], true); + + const expectedResult = { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $wifi: true, + userId: 'test_user_id', + $os: 'Android', + $android_model: 'Android SDK built for x86', + $android_os_version: '8.1.0', + $android_manufacturer: 'Google', + $android_app_version: '1.0', + $android_app_version_code: '1.0', + $android_brand: 'Google', + }; + + expect(result).toEqual(expectedResult); + }); + + it('should transform the message payload to appropriate payload if device is not present', () => { + const message = { + context: { + app: { + build: '1', + name: 'LeanPlumIntegrationAndroid', + namespace: 'com.android.SampleLeanPlum', + version: '1.0', + }, + network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true }, + os: { name: 'iOS', version: '8.1.0' }, + timezone: 'Asia/Kolkata', + traits: { userId: 'test_user_id' }, + }, + }; + const result = getTransformedJSON(message, mappingConfig[ConfigCategory.IDENTIFY.name], true); + + const expectedResult = { + $carrier: 'Android', + $wifi: true, + userId: 'test_user_id', + }; + + expect(result).toEqual(expectedResult); + }); +}); diff --git a/src/v0/destinations/profitwell/utils.test.js b/src/v0/destinations/profitwell/utils.test.js index d6fa5e7df0f..74efe4b2a9a 100644 --- a/src/v0/destinations/profitwell/utils.test.js +++ b/src/v0/destinations/profitwell/utils.test.js @@ -1,3 +1,4 @@ +const path = require('path'); const { validatePayloadAndRetunImpIds, createMissingSubscriptionResponse, @@ -48,6 +49,8 @@ const getTestMessage = () => { return message; }; +const secretApiKey = path.basename(__dirname) + 1; + describe('profitwell utils test cases', () => { describe('createResponseForSubscribedUser', () => { it('correct flow', async () => { @@ -65,7 +68,7 @@ describe('profitwell utils test cases', () => { }, endpoint: 'https://api.profitwell.com/v2/subscriptions/testId/', files: {}, - headers: { Authorization: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { Authorization: secretApiKey, 'Content-Type': 'application/json' }, method: 'PUT', params: {}, type: 'REST', @@ -73,7 +76,7 @@ describe('profitwell utils test cases', () => { }; expect( createResponseForSubscribedUser(getTestMessage(), 'testId', 'testAlias', { - privateApiKey: 'dummyApiKey', + privateApiKey: secretApiKey, }), ).toEqual(expectedOutput); }); @@ -83,7 +86,7 @@ describe('profitwell utils test cases', () => { fittingPayload.traits.effectiveDate = '2019-10-15T09:35:31.288Z'; expect(() => createResponseForSubscribedUser(fittingPayload, 'testId', 'testAlias', { - privateApiKey: 'dummyApiKey', + privateApiKey: secretApiKey, }), ).toThrow('Invalid timestamp format for effectiveDate. Aborting'); }); @@ -108,7 +111,7 @@ describe('profitwell utils test cases', () => { }, endpoint: 'https://api.profitwell.com/v2/subscriptions/', files: {}, - headers: { Authorization: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { Authorization: secretApiKey, 'Content-Type': 'application/json' }, method: 'POST', params: {}, type: 'REST', @@ -116,7 +119,7 @@ describe('profitwell utils test cases', () => { }; expect( createMissingSubscriptionResponse('testId', 'testAlias', null, null, getTestMessage(), { - privateApiKey: 'dummyApiKey', + privateApiKey: secretApiKey, }), ).toEqual(expectedOutput); }); @@ -126,7 +129,7 @@ describe('profitwell utils test cases', () => { fittingPayload.traits.planInterval = 'test'; expect(() => createMissingSubscriptionResponse('testId', 'testAlias', null, null, fittingPayload, { - privateApiKey: 'dummyApiKey', + privateApiKey: secretApiKey, }), ).toThrow('invalid format for planInterval. Aborting'); }); @@ -136,7 +139,7 @@ describe('profitwell utils test cases', () => { fittingPayload.traits.planInterval = 'test'; expect(() => createMissingSubscriptionResponse('testId', 'testAlias', 124, fittingPayload, { - privateApiKey: 'dummyApiKey', + privateApiKey: secretApiKey, }), ).toThrow('Profitwell subscription_id not found'); }); diff --git a/src/v0/destinations/salesforce/transform.js b/src/v0/destinations/salesforce/transform.js index 7e66dd88106..f25659bfa4f 100644 --- a/src/v0/destinations/salesforce/transform.js +++ b/src/v0/destinations/salesforce/transform.js @@ -3,7 +3,6 @@ const cloneDeep = require('lodash/cloneDeep'); const { InstrumentationError, NetworkInstrumentationError, - getErrorRespEvents, } = require('@rudderstack/integrations-lib'); const { EventType, MappedToDestinationKey } = require('../../../constants'); const { @@ -26,6 +25,7 @@ const { handleRtTfSingleEventError, generateErrorObject, isHttpStatusSuccess, + getErrorRespEvents, } = require('../../util'); const { salesforceResponseHandler, collectAuthorizationInfo, getAuthHeader } = require('./utils'); const { handleHttpRequest } = require('../../../adapters/network'); diff --git a/src/v0/destinations/sendinblue/util.js b/src/v0/destinations/sendinblue/util.js index 3af35cd7b99..813d5c4150b 100644 --- a/src/v0/destinations/sendinblue/util.js +++ b/src/v0/destinations/sendinblue/util.js @@ -1,10 +1,10 @@ const { NetworkError, InstrumentationError } = require('@rudderstack/integrations-lib'); +const validator = require('validator'); const { EMAIL_SUFFIX, getContactDetailsEndpoint } = require('./config'); const { getHashFromArray, getIntegrationsObj, isNotEmpty, - validateEmail, validatePhoneWithCountryCode, getDestinationExternalID, } = require('../../util'); @@ -36,7 +36,7 @@ const checkIfEmailOrPhoneExists = (email, phone) => { }; const validateEmailAndPhone = (email, phone = null) => { - if (email && !validateEmail(email)) { + if (email && !validator.isEmail(email)) { throw new InstrumentationError('The provided email is invalid'); } diff --git a/src/v0/destinations/sfmc/transform.test.js b/src/v0/destinations/sfmc/transform.test.js index e182fb0d78a..12bcce4579e 100644 --- a/src/v0/destinations/sfmc/transform.test.js +++ b/src/v0/destinations/sfmc/transform.test.js @@ -1,4 +1,4 @@ -const { ConfigurationError } = require('@rudderstack/integrations-lib'); +const { ConfigurationError, generateRandomString } = require('@rudderstack/integrations-lib'); const axios = require('axios'); const MockAxiosAdapter = require('axios-mock-adapter'); const { responseBuilderSimple, responseBuilderForMessageEvent } = require('./transform'); @@ -6,7 +6,7 @@ beforeAll(() => { const mock = new MockAxiosAdapter(axios); mock .onPost('https://yourSubDomain.auth.marketingcloudapis.com/v2/token') - .reply(200, '{"access_token":"yourAuthToken"}'); + .reply(200, JSON.stringify({ access_token: 'yourAuthToken' })); }); describe('responseBuilderSimple', () => { @@ -134,7 +134,7 @@ describe('responseBuilderSimple', () => { }, }; const subDomain = 'subdomain'; - const authToken = 'token'; + const authToken = generateRandomString(); const hashMapEventDefinition = { testevent: 'eventDefinitionKey', }; @@ -151,7 +151,7 @@ describe('responseBuilderSimple', () => { ); expect(response.headers).toEqual({ 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: `Bearer ${authToken}`, }); expect(response.body.JSON).toEqual({ ContactKey: '12345', diff --git a/src/v0/destinations/snapchat_conversion/util.js b/src/v0/destinations/snapchat_conversion/util.js index ee0329995c1..b7adaf91a5f 100644 --- a/src/v0/destinations/snapchat_conversion/util.js +++ b/src/v0/destinations/snapchat_conversion/util.js @@ -34,24 +34,14 @@ function getHashedValue(identifier) { } function getNormalizedPhoneNumber(message) { - const regexExp = /^[\da-f]{64}$/gi; - let phoneNumber = getFieldValueFromMessage(message, 'phone'); - if (regexExp.test(phoneNumber)) { - return phoneNumber; - } - let leadingZero = true; - if (phoneNumber) { - for (let i = 0; i < phoneNumber.length; i += 1) { - if (Number.isNaN(parseInt(phoneNumber[i], 10)) || (phoneNumber[i] === '0' && leadingZero)) { - phoneNumber = phoneNumber.replace(phoneNumber[i], ''); - i -= 1; - } else { - leadingZero = false; - } - } - return phoneNumber; - } - return null; + const regexExp = /^[\da-f]{64}$/i; + const phoneNumber = getFieldValueFromMessage(message, 'phone'); + + if (!phoneNumber) return null; + if (regexExp.test(phoneNumber)) return phoneNumber; + + // Remove leading zeros and non-numeric characters + return String(phoneNumber).replace(/\D/g, '').replace(/^0+/, '') || null; } function getDataUseValue(message) { diff --git a/src/v0/destinations/snapchat_conversion/util.test.js b/src/v0/destinations/snapchat_conversion/util.test.js new file mode 100644 index 00000000000..05bd0cdbef0 --- /dev/null +++ b/src/v0/destinations/snapchat_conversion/util.test.js @@ -0,0 +1,365 @@ +const { generateRandomString } = require('@rudderstack/integrations-lib'); +const { + msUnixTimestamp, + getItemIds, + getPriceSum, + getDataUseValue, + getNormalizedPhoneNumber, + getHashedValue, + channelMapping, + generateBatchedPayloadForArray, +} = require('./util'); + +describe('Snapchat Conversion Utils', () => { + describe('getNormalizedPhoneNumber', () => { + const testCases = [ + { + name: 'should remove non-numeric characters and leading zeros from phone number', + input: { traits: { phone: '+1 (234) 567-8900' } }, + expected: '12345678900', + }, + { + name: 'should remove leading zeros from phone number when present', + input: { traits: { phone: '00123456789' } }, + expected: '123456789', + }, + { + name: 'should remove non-numeric characters and leading zeros from mixed alphanumeric input', + input: { traits: { phone: 'abc0123def0456' } }, + expected: '1230456', + }, + { + name: 'should return null when phone number is not present', + input: { traits: {} }, + expected: null, + }, + { + name: 'should return null when message is empty', + input: {}, + expected: null, + }, + { + name: 'should return the original hash when phone is already a 64-char hex', + input: { traits: { phone: 'a'.repeat(64) } }, + expected: 'a'.repeat(64), + }, + { + name: 'should return null when phone normalizes to empty string', + input: { traits: { phone: '000' } }, + expected: null, + }, + { + name: 'should handle integer phone numbers', + input: { traits: { phone: 1234567890 } }, + expected: '1234567890', + }, + { + name: 'should handle object in place of phone number', + input: { traits: { phone: { test: 'test' } } }, + expected: null, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = getNormalizedPhoneNumber(input); + expect(result).toBe(expected); + }); + }); + }); +}); + +describe('msUnixTimestamp', () => { + const testCases = [ + { + name: 'should convert timestamp to milliseconds unix timestamp', + input: new Date('2024-01-01T00:00:00Z'), + expected: + new Date('2024-01-01T00:00:00Z').getTime() * 1000 + + new Date('2024-01-01T00:00:00Z').getMilliseconds(), + }, + { + name: 'should handle different timezone', + input: new Date('2024-01-01T12:30:45+05:30'), + expected: + new Date('2024-01-01T12:30:45+05:30').getTime() * 1000 + + new Date('2024-01-01T12:30:45+05:30').getMilliseconds(), + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + expect(msUnixTimestamp(input)).toBe(expected); + }); + }); +}); + +describe('getHashedValue', () => { + const testCases = [ + { + name: 'should return null for null input', + input: null, + expected: null, + }, + { + name: 'should return null for undefined input', + input: undefined, + expected: null, + }, + { + name: 'should return null for empty string', + input: '', + expected: null, + }, + { + name: 'should return original value if already a 64-char hex', + input: 'a'.repeat(64), + expected: 'a'.repeat(64), + }, + { + name: 'should hash non-hex64 values', + input: 'test', + expectedLength: 64, + expectedPattern: /^[a-f0-9]{64}$/i, + }, + ]; + + testCases.forEach(({ name, input, expected, expectedLength, expectedPattern }) => { + it(name, () => { + const result = getHashedValue(input); + if (expected !== undefined) { + expect(result).toBe(expected); + } + if (expectedLength) { + expect(result).toHaveLength(expectedLength); + } + if (expectedPattern) { + expect(result).toMatch(expectedPattern); + } + }); + }); +}); + +describe('getItemIds', () => { + const testCases = [ + { + name: 'should return null when products is not an array', + input: { properties: {} }, + expected: null, + }, + { + name: 'should return array of product_ids', + input: { + properties: { + products: [{ product_id: '123' }, { product_id: '456' }], + }, + }, + expected: ['123', '456'], + }, + { + name: 'should skip products without product_id', + input: { + properties: { + products: [{ product_id: '123' }, { name: 'test' }, { product_id: '456' }], + }, + }, + expected: ['123', '456'], + }, + { + name: 'should return null when products is null', + input: { properties: { products: null } }, + expected: null, + }, + { + name: 'should handle empty products array', + input: { properties: { products: [] } }, + expected: [], + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + expect(getItemIds(input)).toEqual(expected); + }); + }); +}); + +describe('getPriceSum', () => { + const testCases = [ + { + name: 'should return null when products is not an array', + input: { properties: {} }, + expected: 'null', + }, + { + name: 'should sum prices * quantities', + input: { + properties: { + products: [ + { price: '10.5', quantity: 2 }, + { price: '20.0', quantity: 1 }, + ], + }, + }, + expected: '41', + }, + { + name: 'should use quantity=1 when not specified', + input: { + properties: { + products: [{ price: '10.5' }, { price: '20.0' }], + }, + }, + expected: '30.5', + }, + { + name: 'should skip invalid prices or quantities', + input: { + properties: { + products: [ + { price: 'invalid', quantity: 2 }, + { price: '20.0', quantity: 'invalid' }, + { price: '10.0', quantity: 2 }, + ], + }, + }, + expected: '20', + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + expect(getPriceSum(input)).toBe(expected); + }); + }); +}); + +describe('getDataUseValue', () => { + const testCases = [ + { + name: 'should return null when att is not defined', + input: {}, + expected: null, + }, + { + name: 'should return ["lmu"] when att is 2', + input: { + context: { + device: { + attTrackingStatus: 2, + }, + }, + }, + expected: "['lmu']", + }, + { + name: 'should return null when att is 3', + input: { + context: { + device: { + attTrackingStatus: 3, + }, + }, + }, + expected: null, + }, + { + name: 'should return null for other att values', + input: { + context: { + device: { + attTrackingStatus: 1, + }, + }, + }, + expected: null, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + expect(getDataUseValue(input)).toBe(expected); + }); + }); +}); + +describe('generateBatchedPayloadForArray', () => { + const apiKey = generateRandomString(); + const testCases = [ + { + name: 'should generate batched payload with correct structure', + input: { + events: [{ body: { JSON: { event: 1 } } }, { body: { JSON: { event: 2 } } }], + destination: { + Config: { + apiKey, + }, + }, + }, + expected: { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${apiKey}`, + }, + endpoint: 'https://tr.snapchat.com/v2/conversion', + body: { + JSON_ARRAY: { + batch: JSON.stringify([{ event: 1 }, { event: 2 }]), + }, + }, + }, + }, + { + name: 'should handle empty events array', + input: { + events: [], + destination: { + Config: { + apiKey, + }, + }, + }, + expected: { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${apiKey}`, + }, + endpoint: 'https://tr.snapchat.com/v2/conversion', + body: { + JSON_ARRAY: { + batch: '[]', + }, + }, + }, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = generateBatchedPayloadForArray(input.events, input.destination); + expect(result.headers).toEqual(expected.headers); + expect(result.endpoint).toEqual(expected.endpoint); + expect(result.body.JSON_ARRAY).toEqual(expected.body.JSON_ARRAY); + }); + }); +}); + +describe('channelMapping', () => { + const testCases = [ + { + name: 'should have correct mapping values', + expected: { + web: 'WEB', + mobile: 'MOBILE_APP', + mobile_app: 'MOBILE_APP', + offline: 'OFFLINE', + }, + }, + ]; + + testCases.forEach(({ name, expected }) => { + it(name, () => { + expect(channelMapping).toEqual(expected); + }); + }); +}); diff --git a/src/v0/destinations/twitter_ads/transform.js b/src/v0/destinations/twitter_ads/transform.js index 71536be2d91..74bb1fc4f34 100644 --- a/src/v0/destinations/twitter_ads/transform.js +++ b/src/v0/destinations/twitter_ads/transform.js @@ -80,114 +80,129 @@ function populateEventId(event, requestJson, destination) { } function populateContents(requestJson) { - const reqJson = { ...requestJson }; - if (reqJson.contents) { - const transformedContents = requestJson.contents - .map((obj) => ({ - ...(obj.id && { content_id: obj.id }), - ...(obj.groupId && { content_group_id: obj.groupId }), - ...(obj.name && { content_name: obj.name }), - ...(obj.price && { content_price: parseFloat(obj.price) }), - ...(obj.type && { content_type: obj.type }), - ...(obj.quantity && { num_items: parseInt(obj.quantity, 10) }), - })) - .filter((tfObj) => Object.keys(tfObj).length > 0); - if (transformedContents.length > 0) { - reqJson.contents = transformedContents; - } - } - return reqJson; + const { contents, ...rest } = requestJson; + + if (!Array.isArray(contents)) return requestJson; + + const transformedContents = contents + .map(({ id, groupId, name, price, type, quantity }) => { + const transformed = {}; + if (id) { + transformed.content_id = id; + } + if (groupId) { + transformed.content_group_id = groupId; + } + if (name) { + transformed.content_name = name; + } + if (type) { + transformed.content_type = type; + } + if (price && Number.isFinite(parseFloat(price))) { + const parsedPrice = parseFloat(price); + // content_price should be a string + transformed.content_price = Number.isInteger(parsedPrice) + ? parsedPrice.toFixed(2) + : parsedPrice.toString(); + } + if (quantity && Number.isFinite(parseInt(quantity, 10))) { + transformed.num_items = parseInt(quantity, 10); + } + return Object.keys(transformed).length > 0 ? transformed : null; + }) + .filter(Boolean); // Removes null entries + + return transformedContents.length > 0 ? { ...rest, contents: transformedContents } : rest; } -// process track call -function processTrack(message, metadata, destination) { - let requestJson = constructPayload(message, mappingConfig[ConfigCategories.TRACK.name]); - - requestJson.event_id = - requestJson.event_id || populateEventId(message.event, requestJson, destination); - - requestJson.conversion_time = isDefinedAndNotNull(requestJson.conversion_time) - ? requestJson.conversion_time - : message.timestamp; - +// Separate identifier creation logic for better maintainability +function createIdentifiers(properties) { + if (!properties) { + throw new InstrumentationError( + '[TWITTER ADS]: properties must be present in event. Aborting message', + ); + } const identifiers = []; + const { email, phone, twclid, ip_address: ipAddress, user_agent: userAgent } = properties; - if (message.properties.email) { - let email = message.properties.email.trim(); - if (email) { - email = email.toLowerCase(); - identifiers.push({ hashed_email: sha256(email) }); - } + // Handle email + if (email?.trim()) { + identifiers.push({ + hashed_email: sha256(email.trim().toLowerCase()), + }); } - if (message.properties.phone) { - const phone = message.properties.phone.trim(); - if (phone) { - identifiers.push({ hashed_phone_number: sha256(phone) }); - } + // Handle phone + if (phone?.trim()) { + identifiers.push({ + hashed_phone_number: sha256(phone.trim()), + }); } - if (message.properties.twclid) { - identifiers.push({ twclid: message.properties.twclid }); + // Handle twclid + if (twclid) { + identifiers.push({ twclid }); } - if (message.properties.ip_address) { - const ipAddress = message.properties.ip_address.trim(); - if (ipAddress) { - identifiers.push({ ip_address: ipAddress }); + // Handle IP and user agent + const trimmedIp = ipAddress?.trim(); + const trimmedUserAgent = userAgent?.trim(); + // ip_address or/and user_agent is required to be + // passed in conjunction with another identifier + // ref: https://developer.x.com/en/docs/x-ads-api/measurement/web-conversions/api-reference/conversions + if (trimmedIp && trimmedUserAgent) { + identifiers.push({ + ip_address: trimmedIp, + user_agent: trimmedUserAgent, + }); + } else { + if (identifiers.length === 0) { + throw new InstrumentationError( + '[TWITTER ADS]: one of twclid, phone, email or ip_address with user_agent must be present in properties.', + ); } - } - - if (message.properties.user_agent) { - const userAgent = message.properties.user_agent.trim(); - if (userAgent) { - identifiers.push({ user_agent: userAgent }); + if (trimmedIp) { + identifiers[0].ip_address = trimmedIp; + } + if (trimmedUserAgent) { + identifiers[0].user_agent = trimmedUserAgent; } } - requestJson = populateContents(requestJson); + return identifiers; +} +// process track call +function processTrack(message, metadata, destination) { + const identifiers = createIdentifiers(message.properties); + let requestJson = constructPayload(message, mappingConfig[ConfigCategories.TRACK.name]); requestJson.identifiers = identifiers; - const endpointUrl = prepareUrl(message, destination); - - return buildResponse(message, requestJson, metadata, endpointUrl); -} + // Populate required fields + requestJson.event_id = + requestJson.event_id || populateEventId(message.event, requestJson, destination); -function validateRequest(message) { - const { properties } = message; + requestJson.conversion_time = isDefinedAndNotNull(requestJson.conversion_time) + ? requestJson.conversion_time + : message.timestamp; - if (!properties) { - throw new InstrumentationError( - '[TWITTER ADS]: properties must be present in event. Aborting message', - ); - } + // Add identifiers and transform contents + requestJson = populateContents(requestJson); - if ( - !properties.email && - !properties.phone && - !properties.twclid && - !properties.ip_address && - !properties.user_agent - ) { - throw new InstrumentationError( - '[TWITTER ADS]: one of twclid, phone, email, ip_address or user_agent must be present in properties.', - ); - } + const endpointUrl = prepareUrl(message, destination); + return buildResponse(message, requestJson, metadata, endpointUrl); } function process(event) { const { message, metadata, destination } = event; - validateRequest(message); - const messageType = message.type?.toLowerCase(); - if (messageType === EventType.TRACK) { - return processTrack(message, metadata, destination); + if (messageType !== EventType.TRACK) { + throw new InstrumentationError(`Message type ${messageType} not supported`); } - - throw new InstrumentationError(`Message type ${messageType} not supported`); + return processTrack(message, metadata, destination); } const processRouterDest = async (inputs, reqMetadata) => { diff --git a/src/v0/destinations/zendesk/transform.js b/src/v0/destinations/zendesk/transform.js index 792e8df3506..32abb2b8c97 100644 --- a/src/v0/destinations/zendesk/transform.js +++ b/src/v0/destinations/zendesk/transform.js @@ -118,7 +118,10 @@ const payloadBuilderforUpdatingEmail = async ( const { identities } = res.response.data; if (identities && Array.isArray(identities)) { const identitiesDetails = identities.find( - (identitieslist) => identitieslist.primary === true && identitieslist.value !== userEmail, + (identitieslist) => + identitieslist.primary === true && + identitieslist.type === 'email' && + identitieslist.value !== userEmail, ); if (identitiesDetails?.id && userEmail) { return responseBuilderToUpdatePrimaryAccount( diff --git a/src/v0/sources/adjust/transform.js b/src/v0/sources/adjust/transform.js deleted file mode 100644 index f68e87d4764..00000000000 --- a/src/v0/sources/adjust/transform.js +++ /dev/null @@ -1,62 +0,0 @@ -const lodash = require('lodash'); -const path = require('path'); -const fs = require('fs'); -const { TransformationError } = require('@rudderstack/integrations-lib'); -const logger = require('../../../logger'); -const Message = require('../message'); -const { CommonUtils } = require('../../../util/common'); -const { excludedFieldList } = require('./config'); -const { extractCustomFields, generateUUID } = require('../../util'); -const { convertToISODate } = require('./utils'); - -// ref : https://help.adjust.com/en/article/global-callbacks#general-recommended-placeholders -// import mapping json using JSON.parse to preserve object key order -const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); - -const formatProperties = (input) => { - const { query_parameters: qParams } = input; - logger.debug(`[Adjust] Input event: query_params: ${JSON.stringify(qParams)}`); - if (!qParams) { - throw new TransformationError('Query_parameters is missing'); - } - const formattedOutput = {}; - Object.entries(qParams).forEach(([key, [value]]) => { - formattedOutput[key] = value; - }); - return formattedOutput; -}; - -const processEvent = (inputEvent) => { - const message = new Message(`Adjust`); - const event = lodash.cloneDeep(inputEvent); - const formattedPayload = formatProperties(event); - // event type is always track - const eventType = 'track'; - message.setEventType(eventType); - message.setPropertiesV2(formattedPayload, mapping); - let customProperties = {}; - customProperties = extractCustomFields( - formattedPayload, - customProperties, - 'root', - excludedFieldList, - ); - message.properties = { ...message.properties, ...customProperties }; - - if (formattedPayload.created_at) { - const ts = convertToISODate(formattedPayload.created_at); - message.setProperty('originalTimestamp', ts); - message.setProperty('timestamp', ts); - } - // adjust 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(); - return message; -}; - -// This fucntion just converts the incoming payload to array of already not and sends it to processEvent -const process = (events) => { - const eventsArray = CommonUtils.toArray(events); - return eventsArray.map(processEvent); -}; - -module.exports = { process }; diff --git a/src/v0/sources/adjust/utils.test.js b/src/v0/sources/adjust/utils.test.js deleted file mode 100644 index f5a0caa832b..00000000000 --- a/src/v0/sources/adjust/utils.test.js +++ /dev/null @@ -1,37 +0,0 @@ -const { convertToISODate } = require('./utils'); -const { TransformationError } = require('@rudderstack/integrations-lib'); - -describe('convertToISODate', () => { - // Converts valid numeric timestamp to ISO date string - it('should return ISO date string when given a valid numeric timestamp', () => { - const timestamp = 1633072800; // Example timestamp for 2021-10-01T00:00:00.000Z - const result = convertToISODate(timestamp); - expect(result).toBe('2021-10-01T07:20:00.000Z'); - }); - - // Throws error for non-numeric string input - it('should throw TransformationError when given a non-numeric string', () => { - const invalidTimestamp = 'invalid'; - expect(() => convertToISODate(invalidTimestamp)).toThrow(TransformationError); - }); - - // Converts valid numeric string timestamp to ISO date string - it('should convert valid numeric string timestamp to ISO date string', () => { - const rawTimestamp = '1633072800'; // Corresponds to 2021-10-01T00:00:00.000Z - const result = convertToISODate(rawTimestamp); - expect(result).toBe('2021-10-01T07:20:00.000Z'); - }); - - // Throws error for non-number and non-string input - it('should throw error for non-number and non-string input', () => { - expect(() => convertToISODate({})).toThrow(TransformationError); - expect(() => convertToISODate([])).toThrow(TransformationError); - expect(() => convertToISODate(null)).toThrow(TransformationError); - expect(() => convertToISODate(undefined)).toThrow(TransformationError); - }); - - it('should throw error for timestamp that results in invalid date when multiplied', () => { - const hugeTimestamp = 999999999999999; // This will become invalid when multiplied by 1000 - expect(() => convertToISODate(hugeTimestamp)).toThrow(TransformationError); - }); -}); diff --git a/src/v0/sources/appsflyer/transform.js b/src/v0/sources/appsflyer/transform.js deleted file mode 100644 index 1f21392b67c..00000000000 --- a/src/v0/sources/appsflyer/transform.js +++ /dev/null @@ -1,83 +0,0 @@ -const path = require('path'); -const fs = require('fs'); -const { TransformationError } = require('@rudderstack/integrations-lib'); -const Message = require('../message'); -const { generateUUID } = require('../../util'); - -const mappingJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); - -const { removeUndefinedAndNullValues, isObject, isAppleFamily } = require('../../util'); - -function processEvent(event) { - const messageType = 'track'; - - if (event.event_name) { - const eventName = event.event_name; - const message = new Message(`AF`); - - message.setEventType(messageType); - - message.setEventName(eventName); - - const properties = { ...event }; - message.setProperty('properties', properties); - - // set fields in payload from mapping json - message.setProperties(event, mappingJson); - - // Remove the fields from properties that are already mapped to other fields. - Object.keys(mappingJson).forEach((key) => { - if (message.properties && message.properties[key] !== undefined) { - delete message.properties[key]; - } - }); - - if (!isObject(message.context.device)) { - message.context.device = {}; - } - - if (event.platform) { - if (isAppleFamily(event.platform)) { - message.context.device.advertisingId = event.idfa; - } else if (event.platform.toLowerCase() === 'android') { - message.context.device.advertisingId = event.android_id; - } - // remove idfa from message properties as it is already mapped. - if (message.properties && message.properties.idfa !== undefined) { - delete message.properties.idfa; - } - // remove android_id from message properties as it is already mapped. - if (message.properties && message.properties.android_id !== undefined) { - delete message.properties.android_id; - } - } - if (message.context.device.advertisingId) { - message.context.device.adTrackingEnabled = true; - } - - if (event.appsflyer_id) { - message.context.externalId = [ - { - type: 'appsflyerExternalId', - value: event.appsflyer_id, - }, - ]; - // remove appsflyer_id from message properties as it is already mapped. - if (message.properties && message.properties.appsflyer_id !== undefined) { - delete message.properties.appsflyer_id; - } - } - message.setProperty('anonymousId', generateUUID()); - - return message; - } - throw new TransformationError('Unknwon event type from Appsflyer'); -} - -function process(event) { - const response = processEvent(event); - const returnValue = removeUndefinedAndNullValues(response); - return returnValue; -} - -exports.process = process; diff --git a/src/v0/sources/moengage/transform.js b/src/v0/sources/moengage/transform.js deleted file mode 100644 index e5b3c92bfea..00000000000 --- a/src/v0/sources/moengage/transform.js +++ /dev/null @@ -1,8 +0,0 @@ -function process(events) { - if (events.batch) { - return events.batch; - } - return events; -} - -exports.process = process; diff --git a/src/v0/sources/segment/transform.js b/src/v0/sources/segment/transform.js deleted file mode 100644 index 4fd35f6821c..00000000000 --- a/src/v0/sources/segment/transform.js +++ /dev/null @@ -1,5 +0,0 @@ -function process(events) { - return events; -} - -exports.process = process; diff --git a/src/v0/sources/shopify/transform.js b/src/v0/sources/shopify/transform.js index 8cf39dfa5c2..f1cb0aaecbf 100644 --- a/src/v0/sources/shopify/transform.js +++ b/src/v0/sources/shopify/transform.js @@ -16,7 +16,7 @@ const { const logger = require('../../../logger'); const { RedisDB } = require('../../../util/redis/redisConnector'); const { removeUndefinedAndNullValues, isDefinedAndNotNull } = require('../../util'); -const Message = require('../message'); +const Message = require('../../../sources/message'); const { EventType } = require('../../../constants'); const { INTEGERATION, diff --git a/src/v0/sources/shopify/util.js b/src/v0/sources/shopify/util.js index b7e79e35a16..3665dfff203 100644 --- a/src/v0/sources/shopify/util.js +++ b/src/v0/sources/shopify/util.js @@ -272,6 +272,7 @@ module.exports = { createPropertiesForEcomEvent, extractEmailFromPayload, getAnonymousIdAndSessionId, + getCartToken, checkAndUpdateCartItems, getHashLineItems, getDataFromRedis, diff --git a/src/v0/util/constant.js b/src/v0/util/constant.js index 8f5d6c97a13..ba350c2f395 100644 --- a/src/v0/util/constant.js +++ b/src/v0/util/constant.js @@ -85,6 +85,11 @@ const HTTP_STATUS_CODES = { NETWORK_AUTHENTICATION_REQUIRED: 511, }; +const ERROR_MESSAGES = { + MALFORMED_JSON_IN_REQUEST_BODY: 'Malformed JSON in request body', + REQUEST_BODY_NOT_PRESENT_IN_V2_SPEC_PAYLOAD: 'request.body is not present in V2 spec payload', +}; + module.exports = { API_CALL, AUTH_CACHE_TTL, @@ -94,4 +99,5 @@ module.exports = { FEATURE_FILTER_CODE, FEATURE_GZIP_SUPPORT, VDM_V2_SCHEMA_VERSION, + ERROR_MESSAGES, }; diff --git a/src/v0/util/facebookUtils/networkHandler.js b/src/v0/util/facebookUtils/networkHandler.js index 46ac59a07af..39835f2617e 100644 --- a/src/v0/util/facebookUtils/networkHandler.js +++ b/src/v0/util/facebookUtils/networkHandler.js @@ -212,6 +212,12 @@ const errorDetailsMap = { .setMessage('There have been too many calls to this ad-account.') .build(), }, + 2655: { + default: new ErrorDetailsExtractorBuilder() + .setStatus(400) + .setMessage('Marketing Messaging TOS not accepted.') + .build(), + }, 200: { default: new ErrorDetailsExtractorBuilder() .setStatus(403) diff --git a/src/v0/util/index.js b/src/v0/util/index.js index 0f9abfb0403..36dcdddd5cf 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -23,16 +23,15 @@ const { PlatformError, TransformationError, OAuthSecretError, - getErrorRespEvents, } = require('@rudderstack/integrations-lib'); const { JsonTemplateEngine, PathType } = require('@rudderstack/json-template-engine'); const isString = require('lodash/isString'); const logger = require('../../logger'); const stats = require('../../util/stats'); -const { DestCanonicalNames, DestHandlerMap } = require('../../constants/destinationCanonicalNames'); +const { DestCanonicalNames } = require('../../constants/destinationCanonicalNames'); const { client: errNotificationClient } = require('../../util/errorNotifier'); -const { HTTP_STATUS_CODES, VDM_V2_SCHEMA_VERSION } = require('./constant'); +const { HTTP_STATUS_CODES, VDM_V2_SCHEMA_VERSION, ERROR_MESSAGES } = require('./constant'); const { REFRESH_TOKEN, AUTH_STATUS_INACTIVE, @@ -971,6 +970,7 @@ const handleMetadataForValue = (value, metadata, destKey, integrationsObj = null validateTimestamp, allowedKeyCheck, toArray, + regex, } = metadata; // if value is null and defaultValue is supplied - use that @@ -1044,7 +1044,14 @@ const handleMetadataForValue = (value, metadata, destKey, integrationsObj = null } return [formattedVal]; } - + if (regex) { + const regexPattern = new RegExp(regex); + if (!regexPattern.test(formattedVal)) { + throw new InstrumentationError( + `The value '${formattedVal}' does not match the regex pattern, ${regex}`, + ); + } + } return formattedVal; }; @@ -1655,6 +1662,14 @@ function isAppleFamily(platform) { return false; } +function isAndroidFamily(platform) { + const androidOsNames = ['android']; + if (typeof platform === 'string') { + return androidOsNames.includes(platform?.toLowerCase()); + } + return false; +} + function removeHyphens(str) { if (!isString(str)) { return str; @@ -1711,6 +1726,14 @@ function getValidDynamicFormConfig( return res; } +const getErrorRespEvents = (metadata, statusCode, error, statTags, batched = false) => ({ + metadata, + batched, + statusCode, + error, + statTags, +}); + /** * This method is used to check if the input events sent to router transformation are valid * It is to be used only for router transform destinations @@ -1874,31 +1897,6 @@ const flattenMultilevelPayload = (payload) => { return flattenedPayload; }; -/** - * Gets the destintion's transform.js file used for transformation - * **Note**: The transform.js file is imported from - * `v0/destinations/${dest}/transform` - * @param {*} _version -> version for the transfor - * @param {*} dest destination name - * @returns - * The transform.js instance used for destination transformation - */ -const getDestHandler = (dest) => { - const destName = DestHandlerMap[dest] || dest; - // eslint-disable-next-line import/no-dynamic-require, global-require - return require(`../destinations/${destName}/transform`); -}; - -/** - * Obtain the authCache instance used to store the access token information to send/get information to/from destination - * @param {string} destType destination name - * @returns {Cache | undefined} The instance of "v0/util/cache.js" - */ -const getDestAuthCacheInstance = (destType) => { - const destInf = getDestHandler(destType); - return destInf?.authCache || {}; -}; - /** * This function removes all those variables which are * empty or undefined or null from all levels of object. @@ -1924,12 +1922,6 @@ const refinePayload = (obj) => { return refinedPayload; }; -const validateEmail = (email) => { - const regex = - /^(([^\s"(),.:;<>@[\\\]]+(\.[^\s"(),.:;<>@[\\\]]+)*)|(".+"))@((\[(?:\d{1,3}\.){3}\d{1,3}])|(([\dA-Za-z-]+\.)+[A-Za-z]{2,}))$/; - return !!regex.test(email); -}; - const validatePhoneWithCountryCode = (phone) => { const regex = /^\+(?:[\d{] ?){6,14}\d$/; return !!regex.test(phone); @@ -2362,6 +2354,18 @@ const convertToUuid = (input) => { throw new InstrumentationError(errorMessage); } }; + +const getBodyFromV2SpecPayload = ({ request }) => { + if (request?.body) { + try { + const parsedBody = JSON.parse(request.body); + return parsedBody; + } catch (error) { + throw new TransformationError(ERROR_MESSAGES.MALFORMED_JSON_IN_REQUEST_BODY); + } + } + throw new TransformationError(ERROR_MESSAGES.REQUEST_BODY_NOT_PRESENT_IN_V2_SPEC_PAYLOAD); +}; // ======================================================================== // EXPORTS // ======================================================================== @@ -2395,11 +2399,13 @@ module.exports = { generateErrorObject, generateUUID, getBrowserInfo, + getBodyFromV2SpecPayload, getDateInFormat, getDestinationExternalID, getDestinationExternalIDInfoForRetl, getDestinationExternalIDObjectForRetl, getDeviceModel, + getErrorRespEvents, getEventTime, getFieldValueFromMessage, getFirstAndLastName, @@ -2425,6 +2431,7 @@ module.exports = { handleSourceKeysOperation, hashToSha256, isAppleFamily, + isAndroidFamily, isBlank, isDefined, isDefinedAndNotNull, @@ -2462,9 +2469,7 @@ module.exports = { simpleProcessRouterDestSync, handleRtTfSingleEventError, getErrorStatusCode, - getDestAuthCacheInstance, refinePayload, - validateEmail, validateEventName, validatePhoneWithCountryCode, getEventReqMetadata, @@ -2489,4 +2494,5 @@ module.exports = { removeEmptyKey, isAxiosError, convertToUuid, + handleMetadataForValue, }; diff --git a/src/v0/util/index.test.js b/src/v0/util/index.test.js index cfdfefddee3..ba27ee1f703 100644 --- a/src/v0/util/index.test.js +++ b/src/v0/util/index.test.js @@ -15,6 +15,7 @@ const { convertToUuid, } = require('./index'); const exp = require('constants'); +const { ERROR_MESSAGES } = require('./constant'); // Names of the utility functions to test const functionNames = [ @@ -1049,3 +1050,116 @@ describe('convertToUuid', () => { expect(result).toBe('672ca00c-37f4-5d71-b8c3-6ae0848080ec'); }); }); + +describe('', () => { + it('should return original value when regex pattern is invalid', () => { + const value = 'test value'; + const metadata = { + regex: `\\b(?!1000\\b)\\d{4,}\\b`, + }; + try { + const result = utilities.handleMetadataForValue(value, metadata); + } catch (e) { + expect(e.message).toBe( + `The value 'test value' does not match the regex pattern, \\b(?!1000\\b)\\d{4,}\\b`, + ); + } + }); + it('should return true when the regex matches', () => { + const value = 1003; + const metadata = { + regex: `\\b(?!1000\\b)\\d{4,}\\b`, + }; + const res = utilities.handleMetadataForValue(value, metadata); + expect(res).toBe(1003); + }); +}); + +describe('isAndroidFamily', () => { + it('should return true for "android" platform', () => { + expect(utilities.isAndroidFamily('android')).toBe(true); + }); + + it('should return true for "ANDROID" platform (case insensitive)', () => { + expect(utilities.isAndroidFamily('ANDROID')).toBe(true); + }); + + it('should return false for non-android platforms', () => { + expect(utilities.isAndroidFamily('ios')).toBe(false); + expect(utilities.isAndroidFamily('web')).toBe(false); + expect(utilities.isAndroidFamily('windows')).toBe(false); + }); + + it('should return false for empty string', () => { + expect(utilities.isAndroidFamily('')).toBe(false); + }); + + it('should return false for non-string inputs', () => { + expect(utilities.isAndroidFamily(null)).toBe(false); + expect(utilities.isAndroidFamily(undefined)).toBe(false); + expect(utilities.isAndroidFamily(123)).toBe(false); + expect(utilities.isAndroidFamily({})).toBe(false); + expect(utilities.isAndroidFamily([])).toBe(false); + expect(utilities.isAndroidFamily(true)).toBe(false); + }); +}); + +describe('getBodyFromV2SpecPayload', () => { + it('should successfully parse valid JSON body', () => { + const input = { + request: { + body: '{"key": "value", "number": 123}', + }, + }; + const expected = { + key: 'value', + number: 123, + }; + expect(utilities.getBodyFromV2SpecPayload(input)).toEqual(expected); + }); + + it('should throw TransformationError for malformed JSON', () => { + const input = { + request: { + body: '{invalid json}', + }, + }; + expect(() => utilities.getBodyFromV2SpecPayload(input)).toThrow( + ERROR_MESSAGES.MALFORMED_JSON_IN_REQUEST_BODY, + ); + }); + + it('should throw TransformationError when request body is missing', () => { + const input = { + request: {}, + }; + expect(() => utilities.getBodyFromV2SpecPayload(input)).toThrow( + ERROR_MESSAGES.REQUEST_BODY_NOT_PRESENT_IN_V2_SPEC_PAYLOAD, + ); + }); + + it('should throw TransformationError when request is missing', () => { + const input = {}; + expect(() => utilities.getBodyFromV2SpecPayload(input)).toThrow( + ERROR_MESSAGES.REQUEST_BODY_NOT_PRESENT_IN_V2_SPEC_PAYLOAD, + ); + }); + + it('should parse empty JSON object', () => { + const input = { + request: { + body: '{}', + }, + }; + expect(utilities.getBodyFromV2SpecPayload(input)).toEqual({}); + }); + + it('should parse JSON array', () => { + const input = { + request: { + body: '[1,2,3]', + }, + }; + expect(utilities.getBodyFromV2SpecPayload(input)).toEqual([1, 2, 3]); + }); +}); diff --git a/src/v0/util/recordUtils.js b/src/v0/util/recordUtils.js index a3dd65ef336..2df8a55ed0b 100644 --- a/src/v0/util/recordUtils.js +++ b/src/v0/util/recordUtils.js @@ -1,5 +1,5 @@ -const { InstrumentationError, getErrorRespEvents } = require('@rudderstack/integrations-lib'); -const { generateErrorObject } = require('./index'); +const { InstrumentationError } = require('@rudderstack/integrations-lib'); +const { generateErrorObject, getErrorRespEvents } = require('./index'); const eventTypes = ['update', 'insert', 'delete']; diff --git a/src/v1/destinations/iterable/networkHandler.ts b/src/v1/destinations/iterable/networkHandler.ts new file mode 100644 index 00000000000..e3edb5daab7 --- /dev/null +++ b/src/v1/destinations/iterable/networkHandler.ts @@ -0,0 +1,33 @@ +import { prepareProxyRequest, proxyRequest } from '../../../adapters/network'; +import { processAxiosResponse } from '../../../adapters/utils/networkUtils'; +import { BULK_ENDPOINTS } from '../../../v0/destinations/iterable/config'; +import { GenericStrategy } from './strategies/generic'; +import { TrackIdentifyStrategy } from './strategies/track-identify'; +import { GenericProxyHandlerInput } from './types'; + +const strategyRegistry: { [key: string]: any } = { + [TrackIdentifyStrategy.name]: new TrackIdentifyStrategy(), + [GenericStrategy.name]: new GenericStrategy(), +}; + +const getResponseStrategy = (endpoint: string) => { + if (BULK_ENDPOINTS.some((path) => endpoint.includes(path))) { + return strategyRegistry[TrackIdentifyStrategy.name]; + } + return strategyRegistry[GenericStrategy.name]; +}; + +const responseHandler = (responseParams: GenericProxyHandlerInput) => { + const { destinationRequest } = responseParams; + const strategy = getResponseStrategy(destinationRequest.endpoint); + return strategy.handleResponse(responseParams); +}; + +function networkHandler(this: any) { + this.prepareProxy = prepareProxyRequest; + this.proxy = proxyRequest; + this.processAxiosResponse = processAxiosResponse; + this.responseHandler = responseHandler; +} + +export { networkHandler }; diff --git a/src/v1/destinations/iterable/strategies/base.ts b/src/v1/destinations/iterable/strategies/base.ts new file mode 100644 index 00000000000..dfde1e92253 --- /dev/null +++ b/src/v1/destinations/iterable/strategies/base.ts @@ -0,0 +1,22 @@ +import { isHttpStatusSuccess } from '../../../../v0/util'; +import { GenericProxyHandlerInput } from '../types'; + +// Base strategy is the base class for all strategies in Iterable destination +abstract class BaseStrategy { + handleResponse(responseParams: GenericProxyHandlerInput): void { + const { destinationResponse } = responseParams; + const { status } = destinationResponse; + + if (!isHttpStatusSuccess(status)) { + return this.handleError(responseParams); + } + + return this.handleSuccess(responseParams); + } + + abstract handleError(responseParams: GenericProxyHandlerInput): void; + + abstract handleSuccess(responseParams: any): void; +} + +export { BaseStrategy }; diff --git a/src/v1/destinations/iterable/strategies/generic.ts b/src/v1/destinations/iterable/strategies/generic.ts new file mode 100644 index 00000000000..e43eb7623b5 --- /dev/null +++ b/src/v1/destinations/iterable/strategies/generic.ts @@ -0,0 +1,57 @@ +import { BaseStrategy } from './base'; +import { + GenericProxyHandlerInput, + IterableBulkApiResponse, + IterableSuccessResponse, +} from '../types'; +import { ProxyMetdata } from '../../../../types'; +import { TransformerProxyError } from '../../../../v0/util/errorTypes'; +import { TAG_NAMES } from '../../../../v0/util/tags'; +import { getDynamicErrorType } from '../../../../adapters/utils/networkUtils'; + +class GenericStrategy extends BaseStrategy { + handleSuccess(responseParams: { + destinationResponse: IterableBulkApiResponse; + rudderJobMetadata: ProxyMetdata[]; + }): IterableSuccessResponse { + const { destinationResponse, rudderJobMetadata } = responseParams; + const { status } = destinationResponse; + + const responseWithIndividualEvents = rudderJobMetadata.map((metadata) => ({ + statusCode: status, + metadata, + error: 'success', + })); + + return { + status, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse, + response: responseWithIndividualEvents, + }; + } + + handleError(responseParams: GenericProxyHandlerInput): void { + const { destinationResponse, rudderJobMetadata } = responseParams; + const { response, status } = destinationResponse; + const responseMessage = response.params || response.msg || response.message; + const errorMessage = JSON.stringify(responseMessage) || 'unknown error format'; + + const responseWithIndividualEvents = rudderJobMetadata.map((metadata) => ({ + statusCode: status, + metadata, + error: errorMessage, + })); + + throw new TransformerProxyError( + `ITERABLE: Error transformer proxy during ITERABLE response transformation. ${errorMessage}`, + status, + { [TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(status) }, + destinationResponse, + '', + responseWithIndividualEvents, + ); + } +} + +export { GenericStrategy }; diff --git a/src/v1/destinations/iterable/strategies/track-identify.ts b/src/v1/destinations/iterable/strategies/track-identify.ts new file mode 100644 index 00000000000..a8a08682514 --- /dev/null +++ b/src/v1/destinations/iterable/strategies/track-identify.ts @@ -0,0 +1,69 @@ +import { BaseStrategy } from './base'; +import { GenericProxyHandlerInput, IterableBulkProxyInput } from '../types'; +import { checkIfEventIsAbortableAndExtractErrorMessage } from '../utils'; +import { DeliveryJobState, DeliveryV1Response } from '../../../../types'; +import { TransformerProxyError } from '../../../../v0/util/errorTypes'; +import { getDynamicErrorType } from '../../../../adapters/utils/networkUtils'; +import { TAG_NAMES } from '../../../../v0/util/tags'; + +class TrackIdentifyStrategy extends BaseStrategy { + handleSuccess(responseParams: IterableBulkProxyInput): DeliveryV1Response { + const { destinationResponse, rudderJobMetadata, destinationRequest } = responseParams; + const { status } = destinationResponse; + const responseWithIndividualEvents: DeliveryJobState[] = []; + + const { events, users } = destinationRequest?.body.JSON || {}; + const finalData = events || users; + + if (finalData) { + finalData.forEach((event, idx) => { + const parsedOutput = { + statusCode: 200, + metadata: rudderJobMetadata[idx], + error: 'success', + }; + + const { isAbortable, errorMsg } = checkIfEventIsAbortableAndExtractErrorMessage( + event, + destinationResponse, + ); + if (isAbortable) { + parsedOutput.statusCode = 400; + parsedOutput.error = errorMsg; + } + responseWithIndividualEvents.push(parsedOutput); + }); + } + + return { + status, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse, + response: responseWithIndividualEvents, + }; + } + + handleError(responseParams: GenericProxyHandlerInput): void { + const { destinationResponse, rudderJobMetadata } = responseParams; + const { response, status } = destinationResponse; + const responseMessage = response.params || response.msg || response.message; + const errorMessage = JSON.stringify(responseMessage) || 'unknown error format'; + + const responseWithIndividualEvents = rudderJobMetadata.map((metadata) => ({ + statusCode: status, + metadata, + error: errorMessage, + })); + + throw new TransformerProxyError( + `ITERABLE: Error transformer proxy during ITERABLE response transformation. ${errorMessage}`, + status, + { [TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(status) }, + destinationResponse, + '', + responseWithIndividualEvents, + ); + } +} + +export { TrackIdentifyStrategy }; diff --git a/src/v1/destinations/iterable/types.ts b/src/v1/destinations/iterable/types.ts new file mode 100644 index 00000000000..f0875494ed3 --- /dev/null +++ b/src/v1/destinations/iterable/types.ts @@ -0,0 +1,69 @@ +import { ProxyMetdata, ProxyV1Request } from '../../../types'; + +type FailedUpdates = { + invalidEmails?: string[]; + invalidUserIds?: string[]; + notFoundEmails?: string[]; + notFoundUserIds?: string[]; + invalidDataEmails?: string[]; + invalidDataUserIds?: string[]; + conflictEmails?: string[]; + conflictUserIds?: string[]; + forgottenEmails?: string[]; + forgottenUserIds?: string[]; +}; + +export type GeneralApiResponse = { + msg?: string; + code?: string; + params?: Record; + successCount?: number; + failCount?: number; + invalidEmails?: string[]; + invalidUserIds?: string[]; + filteredOutFields?: string[]; + createdFields?: string[]; + disallowedEventNames?: string[]; + failedUpdates?: FailedUpdates; +}; + +export type IterableBulkApiResponse = { + status: number; + response: GeneralApiResponse; +}; + +type IterableBulkRequestBody = { + events?: any[]; + users?: any[]; +}; + +export type IterableBulkProxyInput = { + destinationResponse: IterableBulkApiResponse; + rudderJobMetadata: ProxyMetdata[]; + destType: string; + destinationRequest?: { + body: { + JSON: IterableBulkRequestBody; + }; + }; +}; + +export type GenericProxyHandlerInput = { + destinationResponse: any; + rudderJobMetadata: ProxyMetdata[]; + destType: string; + destinationRequest: ProxyV1Request; +}; + +export type Response = { + statusCode: number; + metadata: any; + error: string; +}; + +export type IterableSuccessResponse = { + status: number; + message: string; + destinationResponse: IterableBulkApiResponse; + response: Response[]; +}; diff --git a/src/v1/destinations/iterable/utils.test.ts b/src/v1/destinations/iterable/utils.test.ts new file mode 100644 index 00000000000..a556e3704f8 --- /dev/null +++ b/src/v1/destinations/iterable/utils.test.ts @@ -0,0 +1,184 @@ +import { checkIfEventIsAbortableAndExtractErrorMessage } from './utils'; +describe('checkIfEventIsAbortableAndExtractErrorMessage', () => { + // Returns non-abortable and empty error message when failCount is 0 + it('should return non-abortable and empty error message when failCount is 0', () => { + const event = { + email: 'test@example.com', + userId: 'user123', + eventName: 'testEvent', + }; + const destinationResponse = { + status: 200, + response: { + failCount: 0, + }, + }; + + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result).toEqual({ isAbortable: false, errorMsg: '' }); + }); + + // Handles undefined or null event fields gracefully + it('should handle undefined or null event fields gracefully', () => { + const event = { + email: null, + userId: undefined, + eventName: 'testEvent', + }; + const destinationResponse = { + status: 200, + response: { + failCount: 1, + invalidEmails: ['test@example.com'], + }, + }; + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result).toEqual({ isAbortable: false, errorMsg: '' }); + }); + + // Handles events with all expected fields present + it('should handle events with all expected fields present and return non-abortable when no match', () => { + const event = { + email: 'test@example.com', + userId: 'user123', + eventName: 'purchase', + id: 'event123', + createdAt: '2023-10-01T00:00:00Z', + campaignId: 'campaign123', + templateId: 'template123', + createNewFields: true, + dataFields: { field1: 'value1' }, + }; + + const destinationResponse = { + status: 200, + response: { + failCount: 1, + invalidEmails: ['another@example.com'], + }, + }; + + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + + expect(result.isAbortable).toBe(false); + expect(result.errorMsg).toBe(''); + }); + + // Returns appropriate error message for abortable event + + it('should find the right value for which it should fail and passes otherwise for emails', () => { + const event = { + email: 'test', + userId: 'user123', + eventName: 'purchase', + dataFields: { customField1: 'value1', customField2: 'value2' }, + }; + const destinationResponse = { + status: 200, + response: { + failCount: 1, + failedUpdates: { + invalidEmails: ['test'], + }, + }, + }; + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result).toEqual({ + isAbortable: true, + errorMsg: 'email error:"test" in "failedUpdates.invalidEmails".', + }); + }); + + it('should find the right value for which it should fail', () => { + const event = { + email: 'test@gmail.com', + userId: 'user123', + eventName: 'purchase', + dataFields: { customField1: 'test', customField2: 'value2' }, + }; + const destinationResponse = { + status: 200, + response: { + failCount: 1, + failedUpdates: { + invalidEmails: ['test'], + }, + }, + }; + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result.isAbortable).toBe(false); + expect(result.errorMsg).toBe(''); + }); + + it('should find all the matching paths it failed for and curate error message', () => { + const event = { + email: 'test', + userId: 'user123', + eventName: 'purchase', + dataFields: { customField1: 'test', customField2: 'value2' }, + }; + const destinationResponse = { + status: 200, + response: { + failCount: 1, + invalidEmails: ['test'], + failedUpdates: { + invalidEmails: ['test'], + conflictEmails: ['test'], + }, + }, + }; + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result.isAbortable).toBe(true); + expect(result.errorMsg).toBe( + 'email error:"test" in "invalidEmails,failedUpdates.invalidEmails,failedUpdates.conflictEmails".', + ); + }); + + it('should find the right value for which it should fail and passes otherwise for userIds', () => { + const event = { + email: 'test', + userId: 'user123', + eventName: 'purchase', + dataFields: { customField1: 'value1', customField2: 'value2' }, + }; + const destinationResponse = { + status: 200, + response: { + failCount: 1, + failedUpdates: { + invalidUserIds: ['user123'], + }, + }, + }; + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result).toEqual({ + isAbortable: true, + errorMsg: 'userId error:"user123" in "failedUpdates.invalidUserIds".', + }); + }); + + it('should find the right value for which it should fail and passes otherwise for disallowed events', () => { + const event = { + email: 'test', + userId: 'user123', + eventName: 'purchase', + dataFields: { customField1: 'value1', customField2: 'value2' }, + }; + const destinationResponse = { + status: 200, + response: { + failCount: 1, + disallowedEventNames: ['purchase'], + failedUpdates: { + invalidUserIds: [], + }, + }, + }; + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result).toEqual({ + isAbortable: true, + errorMsg: 'eventName error:"purchase" in "disallowedEventNames".', + }); + }); +}); diff --git a/src/v1/destinations/iterable/utils.ts b/src/v1/destinations/iterable/utils.ts new file mode 100644 index 00000000000..90985a8e949 --- /dev/null +++ b/src/v1/destinations/iterable/utils.ts @@ -0,0 +1,92 @@ +import { + ITERABLE_RESPONSE_EMAIL_PATHS, + ITERABLE_RESPONSE_USER_ID_PATHS, +} from '../../../v0/destinations/iterable/config'; +import { IterableBulkApiResponse } from './types'; + +const get = require('get-value'); + +/** + * Checks if a value is present in a response array based on a given path. + * @param {Object} response - The response object to search within. + * @param {string} path - The path to the response array. + * @param {any} value - The value to check for in the array. + * @returns {boolean} - True if the value is in the array, otherwise false. + */ +const isValueInResponseArray = (destinationResponse, path, value) => { + const respArr = get(destinationResponse, path); + return Array.isArray(respArr) && respArr.includes(value); +}; + +/** + * Determines if an event should be aborted based on the response from a destination + * and extracts an error message if applicable. + * ref: + * 1) https://api.iterable.com/api/docs#users_updateEmail + * 2) https://api.iterable.com/api/docs#events_track + * 3) https://api.iterable.com/api/docs#users_bulkUpdateUser + * 4) https://api.iterable.com/api/docs#events_trackBulk + * 5) https://api.iterable.com/api/docs#catalogs_bulkUpdateCatalogItems + * 6) https://api.iterable.com/api/docs#users_registerDeviceToken + * 7) https://api.iterable.com/api/docs#users_registerBrowserToken + * 8) https://api.iterable.com/api/docs#commerce_trackPurchase + * 9) https://api.iterable.com/api/docs#commerce_updateCart + * + * @param {Object} event - The event object containing various event properties. + * @param {Object} destinationResponse - The response object from the destination. + * @returns {Object} An object containing a boolean `isAbortable` indicating if the event + * should be aborted, and an `errorMsg` string with the error message if applicable. + */ + +export const checkIfEventIsAbortableAndExtractErrorMessage = ( + event: any, + destinationResponse: IterableBulkApiResponse, +): { + isAbortable: boolean; + errorMsg: string; +} => { + const { failCount } = destinationResponse.response; + + if (failCount === 0) { + return { isAbortable: false, errorMsg: '' }; + } + + const eventValues = { + email: event.email, + userId: event.userId, + eventName: event.eventName, + }; + + let errorMsg = ''; + const userIdMatchPath = ITERABLE_RESPONSE_USER_ID_PATHS.filter((userIdPath) => + isValueInResponseArray(destinationResponse.response, userIdPath, eventValues.userId), + ); + if (userIdMatchPath.length > 0) { + errorMsg += `userId error:"${eventValues.userId}" in "${userIdMatchPath}".`; + } + + const emailMatchPath = ITERABLE_RESPONSE_EMAIL_PATHS.filter((emailPath) => + isValueInResponseArray(destinationResponse.response, emailPath, eventValues.email), + ); + + if (emailMatchPath.length > 0) { + errorMsg += `email error:"${eventValues.email}" in "${emailMatchPath}".`; + } + + const eventNameMatchPath = ['disallowedEventNames'].filter((eventNamePath) => + isValueInResponseArray(destinationResponse.response, eventNamePath, eventValues.eventName), + ); + + if (eventNameMatchPath.length > 0) { + errorMsg += `eventName error:"${eventValues.eventName}" in "${eventNameMatchPath}".`; + } + + if (errorMsg) { + return { + isAbortable: true, + errorMsg, + }; + } + + return { isAbortable: false, errorMsg: '' }; +}; diff --git a/src/v1/sources/shopify/config.js b/src/v1/sources/shopify/config.js index 5d88353d60c..f39a3e3cd19 100644 --- a/src/v1/sources/shopify/config.js +++ b/src/v1/sources/shopify/config.js @@ -31,10 +31,26 @@ const PIXEL_EVENT_MAPPING = { checkout_address_info_submitted: 'Checkout Address Info Submitted', checkout_contact_info_submitted: 'Checkout Contact Info Submitted', checkout_shipping_info_submitted: 'Checkout Shipping Info Submitted', - payment_info_submitted: 'Payment Info Submitted', + payment_info_submitted: 'Payment Info Entered', search_submitted: 'Search Submitted', }; +const ECOM_TOPICS = { + CHECKOUTS_CREATE: 'checkouts_create', + CHECKOUTS_UPDATE: 'checkouts_update', + ORDERS_UPDATE: 'orders_updated', + ORDERS_CREATE: 'orders_create', + ORDERS_CANCELLED: 'orders_cancelled', +}; + +const RUDDER_ECOM_MAP = { + checkouts_create: 'Checkout Started Webhook', + checkouts_update: 'Checkout Updated', + orders_updated: 'Order Updated', + orders_create: 'Order Created', + orders_cancelled: 'Order Cancelled', +}; + const contextualFieldMappingJSON = JSON.parse( fs.readFileSync(path.resolve(__dirname, 'pixelEventsMappings', 'contextualFieldMapping.json')), ); @@ -63,6 +79,18 @@ const checkoutStartedCompletedEventMappingJSON = JSON.parse( ), ); +const identifyMappingJSON = JSON.parse( + fs.readFileSync(path.resolve(__dirname, 'webhookEventsMapping', 'identifyMapping.json')), +); + +const productMappingJSON = JSON.parse( + fs.readFileSync(path.resolve(__dirname, 'webhookEventsMapping', 'productMapping.json')), +); + +const lineItemsMappingJSON = JSON.parse( + fs.readFileSync(path.resolve(__dirname, 'webhookEventsMapping', 'lineItemsMapping.json')), +); + const pixelEventToCartTokenLocationMapping = { cart_viewed: 'properties.cart_id', checkout_address_info_submitted: commonCartTokenLocation, @@ -79,6 +107,8 @@ module.exports = { INTEGERATION, PIXEL_EVENT_TOPICS, PIXEL_EVENT_MAPPING, + ECOM_TOPICS, + RUDDER_ECOM_MAP, contextualFieldMappingJSON, cartViewedEventMappingJSON, productListViewedEventMappingJSON, @@ -86,4 +116,7 @@ module.exports = { productToCartEventMappingJSON, checkoutStartedCompletedEventMappingJSON, pixelEventToCartTokenLocationMapping, + productMappingJSON, + lineItemsMappingJSON, + identifyMappingJSON, }; diff --git a/src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json b/src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json new file mode 100644 index 00000000000..319502e377b --- /dev/null +++ b/src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json @@ -0,0 +1,18 @@ +[ + { + "sourceKeys": "utm_campaign", + "destKeys": "name" + }, + { + "sourceKeys": "utm_medium", + "destKeys": "medium" + }, + { + "sourceKeys": "utm_term", + "destKeys": "term" + }, + { + "sourceKeys": "utm_content", + "destKeys": "content" + } +] diff --git a/src/v1/sources/shopify/transform.js b/src/v1/sources/shopify/transform.js index 5ebf4a34fc5..23228ecc10f 100644 --- a/src/v1/sources/shopify/transform.js +++ b/src/v1/sources/shopify/transform.js @@ -1,29 +1,13 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -const { processPixelWebEvents } = require('./webpixelTransformations/pixelTransform'); -const { process: processWebhookEvents } = require('../../../v0/sources/shopify/transform'); -const { - process: processPixelWebhookEvents, -} = require('./webhookTransformations/serverSideTransform'); +const { process: processV0 } = require('../../../v0/sources/shopify/transform'); +const { processV1Events } = require('./transformV1'); +const { isShopifyV1Event } = require('./utils'); const process = async (inputEvent) => { const { event } = inputEvent; - const { query_parameters } = event; - // check identify the event is from the web pixel based on the pixelEventLabel property. - const { pixelEventLabel: pixelClientEventLabel } = event; - if (pixelClientEventLabel) { - // this is a event fired from the web pixel loaded on the browser - // by the user interactions with the store. - const pixelWebEventResponse = await processPixelWebEvents(event); - return pixelWebEventResponse; + if (isShopifyV1Event(event)) { + return processV1Events(event); } - if (query_parameters && query_parameters?.version?.[0] === 'pixel') { - // this is a server-side event from the webhook subscription made by the pixel app. - const pixelWebhookEventResponse = await processPixelWebhookEvents(event); - return pixelWebhookEventResponse; - } - // this is a server-side event from the webhook subscription made by the legacy tracker-based app. - const response = await processWebhookEvents(event); - return response; + return processV0(event); }; module.exports = { process }; diff --git a/src/v1/sources/shopify/transformV1.js b/src/v1/sources/shopify/transformV1.js new file mode 100644 index 00000000000..bf8f6d7241c --- /dev/null +++ b/src/v1/sources/shopify/transformV1.js @@ -0,0 +1,36 @@ +const { PlatformError } = require('@rudderstack/integrations-lib'); +const { isIdentifierEvent, processIdentifierEvent } = require('./utils'); +const { processWebhookEvents } = require('./webhookTransformations/serverSideTransform'); +const { processPixelWebEvents } = require('./webpixelTransformations/pixelTransform'); + +const processV1Events = async (event) => { + // eslint-disable-next-line @typescript-eslint/naming-convention + const { query_parameters } = event; + + // these are the events from the front-end tracking, viz. web-pixel or theme-app extension. + const { pixelEventLabel: clientSideEvent } = event; + const isServerSideEvent = query_parameters && query_parameters?.version?.[0] === 'pixel'; + + if (clientSideEvent) { + // check if the event is an identifier event, used to set the anonymousId in the redis for identity stitching. + if (isIdentifierEvent(event)) { + return processIdentifierEvent(event); + } + // handle events from the app pixel. + const pixelWebEventResponse = await processPixelWebEvents(event); + return pixelWebEventResponse; + } + if (isServerSideEvent) { + // this is a server-side event from the webhook subscription made by the pixel app. + const pixelWebhookEventResponse = await processWebhookEvents(event); + return pixelWebhookEventResponse; + } + throw new PlatformError( + 'Invalid Event for Shopiyf V1 (not matching client or server side event requirements)', + 500, + ); +}; + +module.exports = { + processV1Events, +}; diff --git a/src/v1/sources/shopify/utils.js b/src/v1/sources/shopify/utils.js new file mode 100644 index 00000000000..4a63e780759 --- /dev/null +++ b/src/v1/sources/shopify/utils.js @@ -0,0 +1,69 @@ +const { RedisDB } = require('../../../util/redis/redisConnector'); +const stats = require('../../../util/stats'); + +const NO_OPERATION_SUCCESS = { + outputToSource: { + body: Buffer.from('OK').toString('base64'), + contentType: 'text/plain', + }, + statusCode: 200, +}; + +/** + * Updates the anonymousId to userId mapping in Redis + * @param {String} anonymousId + * @param {String} userId + */ +const updateAnonymousIdToUserIdInRedis = async (anonymousId, userId) => { + if (anonymousId && userId) { + // set the anonymousId to userId mapping in Redis for 24 hours + await RedisDB.setVal(`pixel:${anonymousId}`, ['userId', userId], 86400).then(() => { + stats.increment('shopify_pixel_userid_mapping', { + action: 'stitchUserIdToAnonId', + operation: 'set', + }); + }); + } +}; + +const isIdentifierEvent = (payload) => ['rudderIdentifier'].includes(payload?.event); + +/** + * Sets the cartToken <-> anonymousId mapping or anonymousId <-> userId mapping in Redis based on the event action + * @param {Object} event + * @returns {Object} NO_OPERATION_SUCCESS + */ +const processIdentifierEvent = async (event) => { + const { cartToken, anonymousId, userId, action } = event; + if (cartToken && anonymousId && action === 'stitchCartTokenToAnonId') { + // set the cartToken to anonymousId mapping in Redis for 12 hours + await RedisDB.setVal(`pixel:${cartToken}`, ['anonymousId', anonymousId], 43200).then(() => { + stats.increment('shopify_pixel_cart_token_mapping', { + action: 'stitchCartTokenToAnonId', + operation: 'set', + }); + }); + } + if (action === 'stitchUserIdToAnonId') { + updateAnonymousIdToUserIdInRedis(anonymousId, userId); + } + return NO_OPERATION_SUCCESS; +}; + +const isShopifyV1Event = (event) => { + // eslint-disable-next-line @typescript-eslint/naming-convention + const { query_parameters } = event; + const { pixelEventLabel: pixelClientEventLabel } = event; + + return !!( + (query_parameters && query_parameters?.version?.[0] === 'pixel') || + pixelClientEventLabel + ); +}; + +module.exports = { + processIdentifierEvent, + isIdentifierEvent, + isShopifyV1Event, + updateAnonymousIdToUserIdInRedis, +}; diff --git a/src/v1/sources/shopify/utils.test.js b/src/v1/sources/shopify/utils.test.js new file mode 100644 index 00000000000..2945b69e870 --- /dev/null +++ b/src/v1/sources/shopify/utils.test.js @@ -0,0 +1,148 @@ +const { + isIdentifierEvent, + processIdentifierEvent, + updateAnonymousIdToUserIdInRedis, +} = require('./utils'); +const { RedisDB } = require('../../../util/redis/redisConnector'); +const stats = require('../../../util/stats'); + +jest.mock('../../../util/stats', () => ({ + increment: jest.fn(), +})); + +describe('Identifier Utils Tests', () => { + describe('test isIdentifierEvent', () => { + it('should return true if the event is rudderIdentifier', () => { + const event = { event: 'rudderIdentifier' }; + expect(isIdentifierEvent(event)).toBe(true); + }); + + it('should return false if the event is not rudderIdentifier', () => { + const event = { event: 'checkout started' }; + expect(isIdentifierEvent(event)).toBe(false); + }); + }); + + describe('test processIdentifierEvent', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should set the cartToken mapping in redis and increment stats', async () => { + const setValSpy = jest.spyOn(RedisDB, 'setVal').mockResolvedValue('OK'); + const event = { + cartToken: 'cartTokenTest1', + anonymousId: 'anonymousIdTest1', + action: 'stitchCartTokenToAnonId', + }; + + const response = await processIdentifierEvent(event); + + expect(setValSpy).toHaveBeenCalledWith( + 'pixel:cartTokenTest1', + ['anonymousId', 'anonymousIdTest1'], + 43200, + ); + expect(stats.increment).toHaveBeenCalledWith('shopify_pixel_cart_token_mapping', { + action: 'stitchCartTokenToAnonId', + operation: 'set', + }); + expect(response).toEqual({ + outputToSource: { + body: Buffer.from('OK').toString('base64'), + contentType: 'text/plain', + }, + statusCode: 200, + }); + }); + + it('should update the anonymousId to userId mapping in redis and increment stats', async () => { + const setValSpy = jest.spyOn(RedisDB, 'setVal').mockResolvedValue('OK'); + const event = { + anonymousId: 'anonymousIdTest1', + userId: 'userIdTest1', + action: 'stitchUserIdToAnonId', + }; + + const response = await processIdentifierEvent(event); + + expect(setValSpy).toHaveBeenCalled(); + expect(stats.increment).toHaveBeenCalledWith('shopify_pixel_userid_mapping', { + action: 'stitchUserIdToAnonId', + operation: 'set', + }); + expect(response).toEqual({ + outputToSource: { + body: Buffer.from('OK').toString('base64'), + contentType: 'text/plain', + }, + statusCode: 200, + }); + }); + + it('should handle redis errors and increment error stats', async () => { + const error = new Error('Redis connection failed'); + jest.spyOn(RedisDB, 'setVal').mockRejectedValue(error); + const event = { + cartToken: 'cartTokenTest1', + anonymousId: 'anonymousIdTest1', + action: 'stitchCartTokenToAnonId', + }; + + await expect(processIdentifierEvent(event)).rejects.toThrow('Redis connection failed'); + expect(stats.increment).not.toHaveBeenCalled(); + }); + }); + + describe('test updateAnonymousIdToUserIdInRedis', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should update the anonymousId to userId in redis and increment stats', async () => { + const setValSpy = jest.spyOn(RedisDB, 'setVal').mockResolvedValue('OK'); + const event = { + anonymousId: 'anonymousTest1', + userId: 'userIdTest1', + }; + + await updateAnonymousIdToUserIdInRedis(event.anonymousId, event.userId); + + expect(setValSpy).toHaveBeenCalledWith( + 'pixel:anonymousTest1', + ['userId', 'userIdTest1'], + 86400, + ); + expect(stats.increment).toHaveBeenCalledWith('shopify_pixel_userid_mapping', { + action: 'stitchUserIdToAnonId', + operation: 'set', + }); + }); + + it('should handle redis errors in updateAnonymousIdToUserIdInRedis', async () => { + const error = new Error('Redis connection failed'); + jest.spyOn(RedisDB, 'setVal').mockRejectedValue(error); + const event = { + anonymousId: 'anonymousTest1', + userId: 'userIdTest1', + }; + + await expect( + updateAnonymousIdToUserIdInRedis(event.anonymousId, event.userId), + ).rejects.toThrow('Redis connection failed'); + expect(stats.increment).not.toHaveBeenCalled(); + }); + + it('should handle null values and not call Redis or stats', async () => { + const setValSpy = jest.spyOn(RedisDB, 'setVal').mockResolvedValue('OK'); + const event = { + anonymousId: null, + userId: null, + }; + + await updateAnonymousIdToUserIdInRedis(event.anonymousId, event.userId); + expect(setValSpy).not.toHaveBeenCalled(); + expect(stats.increment).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/src/v1/sources/shopify/webhookEventsMapping/identifyMapping.json b/src/v1/sources/shopify/webhookEventsMapping/identifyMapping.json new file mode 100644 index 00000000000..03672675028 --- /dev/null +++ b/src/v1/sources/shopify/webhookEventsMapping/identifyMapping.json @@ -0,0 +1,112 @@ +[ + { + "sourceKeys": "id", + "destKeys": "userId" + }, + { + "sourceKeys": "email", + "destKeys": "traits.email" + }, + + { + "sourceKeys": "first_name", + "destKeys": "traits.firstName" + }, + + { + "sourceKeys": "last_name", + "destKeys": "traits.lastName" + }, + + { + "sourceKeys": "phone", + "destKeys": "traits.phone" + }, + + { + "sourceKeys": "addresses", + "destKeys": "traits.addressList" + }, + + { + "sourceKeys": "default_address", + "destKeys": "traits.address" + }, + + { + "sourceKeys": "shipping_address", + "destKeys": "traits.shippingAddress" + }, + + { + "sourceKeys": "billing_address", + "destKeys": "traits.billingAddress" + }, + + { + "sourceKeys": "accepts_marketing", + "destKeys": "traits.acceptsMarketing" + }, + + { + "sourceKeys": "orders_count", + "destKeys": "traits.orderCount" + }, + + { + "sourceKeys": "state", + "destKeys": "traits.state" + }, + { + "sourceKeys": "total_spent", + "destKeys": "traits.totalSpent" + }, + { + "sourceKeys": "note", + "destKeys": "traits.note" + }, + { + "sourceKeys": "verified_email", + "destKeys": "traits.verifiedEmail" + }, + { + "sourceKeys": "multipass_identifier", + "destKeys": "traits.multipassIdentifier" + }, + { + "sourceKeys": "tax_exempt", + "destKeys": "traits.taxExempt" + }, + { + "sourceKeys": "tags", + "destKeys": "traits.tags" + }, + { + "sourceKeys": "last_order_name", + "destKeys": "traits.lastOrderName" + }, + { + "sourceKeys": "currency", + "destKeys": "traits.currency" + }, + { + "sourceKeys": "marketing_opt_in_level", + "destKeys": "traits.marketingOptInLevel" + }, + { + "sourceKeys": "tax_exemptions", + "destKeys": "traits.taxExemptions" + }, + { + "sourceKeys": "sms_marketing_consent", + "destKeys": "traits.smsMarketingConsent" + }, + { + "sourceKeys": "admin_graphql_api_id", + "destKeys": "traits.adminGraphqlApiId" + }, + { + "sourceKeys": "accepts_marketing_updated_at", + "destKeys": "traits.acceptsMarketingUpdatedAt" + } +] diff --git a/src/v1/sources/shopify/webhookEventsMapping/lineItemsMapping.json b/src/v1/sources/shopify/webhookEventsMapping/lineItemsMapping.json new file mode 100644 index 00000000000..3bcef331b07 --- /dev/null +++ b/src/v1/sources/shopify/webhookEventsMapping/lineItemsMapping.json @@ -0,0 +1,32 @@ +[ + { + "sourceKeys": "product_id", + "destKey": "product_id", + "metadata": { + "type": "toString" + } + }, + { + "sourceKeys": "sku", + "destKey": "sku" + }, + { + "sourceKeys": "name", + "destKey": "title" + }, + { + "sourceKeys": "price", + "destKey": "price", + "metadata": { + "type": "toNumber" + } + }, + { + "sourceKeys": "vendor", + "destKey": "brand" + }, + { + "sourceKeys": "quantity", + "destKey": "quantity" + } +] diff --git a/src/v1/sources/shopify/webhookEventsMapping/mapping.json b/src/v1/sources/shopify/webhookEventsMapping/mapping.json new file mode 100644 index 00000000000..6c268ef13c6 --- /dev/null +++ b/src/v1/sources/shopify/webhookEventsMapping/mapping.json @@ -0,0 +1,10 @@ +[ + { + "sourceKeys": "line_items", + "destKeys": "products" + }, + { + "sourceKeys": "id", + "destKeys": "properties.order_id" + } +] diff --git a/src/v1/sources/shopify/webhookEventsMapping/productMapping.json b/src/v1/sources/shopify/webhookEventsMapping/productMapping.json new file mode 100644 index 00000000000..7bd20498286 --- /dev/null +++ b/src/v1/sources/shopify/webhookEventsMapping/productMapping.json @@ -0,0 +1,27 @@ +[ + { + "sourceKeys": "id", + "destKey": "order_id", + "metadata": { + "type": "toString" + } + }, + { + "sourceKeys": "total_price", + "destKey": "value", + "metadata": { + "type": "toNumber" + } + }, + { + "sourceKeys": "total_tax", + "destKey": "tax", + "metadata": { + "type": "toNumber" + } + }, + { + "sourceKeys": "currency", + "destKey": "currency" + } +] diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js index 292a980a93b..c49eb97b6d9 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js @@ -1,26 +1,27 @@ -/* eslint-disable @typescript-eslint/naming-convention */ const lodash = require('lodash'); const get = require('get-value'); +const { isDefinedNotNullNotEmpty } = require('@rudderstack/integrations-lib'); const stats = require('../../../../util/stats'); -const { getShopifyTopic, extractEmailFromPayload } = require('../../../../v0/sources/shopify/util'); -const { removeUndefinedAndNullValues, isDefinedAndNotNull } = require('../../../../v0/util'); -const Message = require('../../../../v0/sources/message'); +const { getShopifyTopic } = require('../../../../v0/sources/shopify/util'); +const { removeUndefinedAndNullValues } = require('../../../../v0/util'); +const Message = require('../../../../sources/message'); const { EventType } = require('../../../../constants'); const { - INTEGERATION, - MAPPING_CATEGORIES, IDENTIFY_TOPICS, - ECOM_TOPICS, - RUDDER_ECOM_MAP, SUPPORTED_TRACK_EVENTS, SHOPIFY_TRACK_MAP, - lineItemsMappingJSON, } = require('../../../../v0/sources/shopify/config'); +const { INTEGERATION, identifyMappingJSON, lineItemsMappingJSON } = require('../config'); +const { ECOM_TOPICS, RUDDER_ECOM_MAP } = require('../config'); const { createPropertiesForEcomEventFromWebhook, getProductsFromLineItems, - getAnonymousIdFromAttributes, + setAnonymousId, + handleCommonProperties, + addCartTokenHashToTraits, } = require('./serverSideUtlis'); +const { updateAnonymousIdToUserIdInRedis } = require('../utils'); +const { RedisDB } = require('../../../../util/redis/redisConnector'); const NO_OPERATION_SUCCESS = { outputToSource: { @@ -33,7 +34,7 @@ const NO_OPERATION_SUCCESS = { const identifyPayloadBuilder = (event) => { const message = new Message(INTEGERATION); message.setEventType(EventType.IDENTIFY); - message.setPropertiesV2(event, MAPPING_CATEGORIES[EventType.IDENTIFY]); + message.setPropertiesV2(event, identifyMappingJSON); if (event.updated_at) { // converting shopify updated_at timestamp to rudder timestamp format message.setTimestamp(new Date(event.updated_at).toISOString()); @@ -46,28 +47,22 @@ const ecomPayloadBuilder = (event, shopifyTopic) => { message.setEventType(EventType.TRACK); message.setEventName(RUDDER_ECOM_MAP[shopifyTopic]); - const properties = createPropertiesForEcomEventFromWebhook(event); + const properties = createPropertiesForEcomEventFromWebhook(event, shopifyTopic); message.properties = removeUndefinedAndNullValues(properties); // Map Customer details if present const customerDetails = get(event, 'customer'); if (customerDetails) { - message.setPropertiesV2(customerDetails, MAPPING_CATEGORIES[EventType.IDENTIFY]); + message.setPropertiesV2(customerDetails, identifyMappingJSON); } if (event.updated_at) { message.setTimestamp(new Date(event.updated_at).toISOString()); } - if (event.customer) { - message.setPropertiesV2(event.customer, MAPPING_CATEGORIES[EventType.IDENTIFY]); - } if (event.shipping_address) { message.setProperty('traits.shippingAddress', event.shipping_address); } if (event.billing_address) { message.setProperty('traits.billingAddress', event.billing_address); } - if (!message.userId && event.user_id) { - message.setProperty('userId', event.user_id); - } return message; }; @@ -82,9 +77,46 @@ const trackPayloadBuilder = (event, shopifyTopic) => { return message; }; +/** + * Creates an identify event with userId and anonymousId from message object and identifyMappingJSON + * @param {String} message + * @returns {Message} identifyEvent + */ +const createIdentifyEvent = (message) => { + const { userId, anonymousId, traits } = message; + const identifyEvent = new Message(INTEGERATION); + identifyEvent.setEventType(EventType.IDENTIFY); + if (userId) { + identifyEvent.userId = userId; + } + if (anonymousId) { + identifyEvent.anonymousId = anonymousId; + } + const mappedTraits = {}; + identifyMappingJSON.forEach((mapping) => { + if (mapping.destKeys.startsWith('traits.')) { + const traitKey = mapping.destKeys.replace('traits.', ''); + const sourceValue = get(traits, traitKey); + if (sourceValue !== undefined) { + lodash.set(mappedTraits, traitKey, sourceValue); + } + } + }); + // Set the mapped traits + identifyEvent.context.traits = removeUndefinedAndNullValues(mappedTraits); + identifyEvent.setProperty(`integrations.${INTEGERATION}`, true); + identifyEvent.setProperty('context.library', { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }); + return identifyEvent; +}; + const processEvent = async (inputEvent, metricMetadata) => { let message; const event = lodash.cloneDeep(inputEvent); + const { customer } = event; const shopifyTopic = getShopifyTopic(event); delete event.query_parameters; switch (shopifyTopic) { @@ -96,6 +128,7 @@ const processEvent = async (inputEvent, metricMetadata) => { case ECOM_TOPICS.ORDERS_UPDATE: case ECOM_TOPICS.CHECKOUTS_CREATE: case ECOM_TOPICS.CHECKOUTS_UPDATE: + case ECOM_TOPICS.ORDERS_CANCELLED: message = ecomPayloadBuilder(event, shopifyTopic); break; default: @@ -110,42 +143,41 @@ const processEvent = async (inputEvent, metricMetadata) => { message = trackPayloadBuilder(event, shopifyTopic); break; } - - if (message.userId) { - message.userId = String(message.userId); - } - if (!get(message, 'traits.email')) { - const email = extractEmailFromPayload(event); - if (email) { - message.setProperty('traits.email', email); - } - } // attach anonymousId if the event is track event using note_attributes if (message.type !== EventType.IDENTIFY) { - const anonymousId = getAnonymousIdFromAttributes(event); - if (isDefinedAndNotNull(anonymousId)) { - message.setProperty('anonymousId', anonymousId); - } + await setAnonymousId(message, event, metricMetadata); + await updateAnonymousIdToUserIdInRedis(message.anonymousId, message.userId); } - message.setProperty(`integrations.${INTEGERATION}`, true); - message.setProperty('context.library', { - eventOrigin: 'server', - name: 'RudderStack Shopify Cloud', - version: '2.0.0', - }); - message.setProperty('context.topic', shopifyTopic); - // attaching cart, checkout and order tokens in context object - message.setProperty(`context.cart_token`, event.cart_token); - message.setProperty(`context.checkout_token`, event.checkout_token); - // raw shopify payload passed inside context object under shopifyDetails - message.setProperty('context.shopifyDetails', event); - if (shopifyTopic === 'orders_updated') { - message.setProperty(`context.order_token`, event.token); + // attach email and other contextual properties + message = handleCommonProperties(message, event, shopifyTopic); + // add cart_token_hash to traits if cart_token is present + message = addCartTokenHashToTraits(message, event); + const redisData = await RedisDB.getVal(`pixel:${message.anonymousId}`); + if (isDefinedNotNullNotEmpty(redisData)) { + message.userId = redisData.userId; + stats.increment('shopify_pixel_userid_mapping', { + action: 'stitchUserIdToAnonId', + operation: 'get', + }); + } + if (message.userId) { + message.userId = String(message.userId); } message = removeUndefinedAndNullValues(message); + + // if the message payload contains both anonymousId and userId or contains customer object, hence the user is identified + // then create an identify event by multiplexing the original event and return both the message and identify event + if ( + (message.userId && message.anonymousId) || + (message.userId && customer) || + (message.anonymousId && customer) + ) { + const identifyEvent = createIdentifyEvent(message); + return [message, identifyEvent]; + } return message; }; -const process = async (event) => { +const processWebhookEvents = async (event) => { const metricMetadata = { writeKey: event.query_parameters?.writeKey?.[0], source: 'SHOPIFY', @@ -155,7 +187,7 @@ const process = async (event) => { }; module.exports = { - process, + processWebhookEvents, processEvent, identifyPayloadBuilder, ecomPayloadBuilder, diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js index 4a2839103b9..42bf859ba12 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js @@ -1,17 +1,22 @@ +const { processEvent } = require('./serverSideTransform'); const { getProductsFromLineItems, createPropertiesForEcomEventFromWebhook, getAnonymousIdFromAttributes, + getCartToken, + setAnonymousId, + addCartTokenHashToTraits, } = require('./serverSideUtlis'); +const { RedisDB } = require('../../../../util/redis/redisConnector'); +const stats = require('../../../../util/stats'); -const { constructPayload } = require('../../../../v0/util'); +const { lineItemsMappingJSON } = require('../../../../v0/sources/shopify/config'); +const Message = require('../../../../sources/message'); -const { - lineItemsMappingJSON, - productMappingJSON, -} = require('../../../../v0/sources/shopify/config'); -const Message = require('../../../../v0/sources/message'); -jest.mock('../../../../v0/sources/message'); +jest.mock('../../../../sources/message'); +jest.mock('../../../../util/stats', () => ({ + increment: jest.fn(), +})); const LINEITEMS = [ { @@ -63,7 +68,6 @@ describe('serverSideUtils.js', () => { }); it('should return array of products', () => { - const mapping = {}; const result = getProductsFromLineItems(LINEITEMS, lineItemsMappingJSON); expect(result).toEqual([ { brand: 'Hydrogen Vendor', price: '600.00', product_id: 7234590408818, quantity: 1 }, @@ -98,11 +102,11 @@ describe('serverSideUtils.js', () => { const result = createPropertiesForEcomEventFromWebhook(message); expect(result).toEqual({ products: [ - { brand: 'Hydrogen Vendor', price: '600.00', product_id: 7234590408818, quantity: 1 }, + { brand: 'Hydrogen Vendor', price: 600.0, product_id: '7234590408818', quantity: 1 }, { brand: 'Hydrogen Vendor', - price: '600.00', - product_id: 7234590408817, + price: 600.0, + product_id: '7234590408817', quantity: 1, title: 'The Collection Snowboard: Nitrogen', }, @@ -115,7 +119,13 @@ describe('serverSideUtils.js', () => { // Handles empty note_attributes array gracefully it('should return null when note_attributes is an empty array', async () => { const event = { note_attributes: [] }; - const result = await getAnonymousIdFromAttributes(event); + const result = getAnonymousIdFromAttributes(event); + expect(result).toBeNull(); + }); + + it('should return null when note_attributes is not present', async () => { + const event = {}; + const result = getAnonymousIdFromAttributes(event); expect(result).toBeNull(); }); @@ -123,8 +133,183 @@ describe('serverSideUtils.js', () => { const event = { note_attributes: [{ name: 'rudderAnonymousId', value: '123456' }], }; - const result = await getAnonymousIdFromAttributes(event); + const result = getAnonymousIdFromAttributes(event); expect(result).toEqual('123456'); }); }); + + describe('Test getCartToken', () => { + it('should return null if cart_token is not present', () => { + const event = {}; + const result = getCartToken(event); + expect(result).toBeNull(); + }); + + it('should return cart_token if it is present', () => { + const event = { cart_token: 'cartTokenTest1' }; + const result = getCartToken(event); + expect(result).toEqual('cartTokenTest1'); + }); + }); + + describe('Test addCartTokenHashToTraits', () => { + // Add cart token hash to traits when cart token exists in event + it('should add cart_token_hash to message traits when cart token exists', () => { + const message = { traits: { existingTrait: 'value' } }; + const event = { cart_token: 'Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ' }; + const expectedHash = '9125e1da-57b9-5bdc-953e-eb2b0ded5edc'; + + addCartTokenHashToTraits(message, event); + + expect(message.traits).toEqual({ + existingTrait: 'value', + cart_token_hash: expectedHash, + }); + }); + + // Do not add cart token hash to traits when cart token does not exist in event + it('should not add cart_token_hash to message traits when cart token does not exist', () => { + const message = { traits: { existingTrait: 'value' } }; + const event = { property: 'value' }; + addCartTokenHashToTraits(message, event); + + expect(message.traits).toEqual({ existingTrait: 'value' }); + }); + }); +}); + +describe('Redis cart token tests', () => { + it('should get anonymousId property from redis', async () => { + const getValSpy = jest + .spyOn(RedisDB, 'getVal') + .mockResolvedValue({ anonymousId: 'anonymousIdTest1' }); + const event = { + id: 35550298931313, + token: '84ad78572dae52a8cbea7d55371afe89', + cart_token: 'Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ', + email: null, + gateway: null, + buyer_accepts_marketing: false, + buyer_accepts_sms_marketing: false, + sms_marketing_phone: null, + created_at: '2024-11-06T02:22:00+00:00', + updated_at: '2024-11-05T21:22:02-05:00', + landing_site: '/', + note: '', + note_attributes: [], + referring_site: '', + shipping_lines: [], + shipping_address: [], + taxes_included: false, + total_weight: 0, + currency: 'USD', + completed_at: null, + phone: null, + customer_locale: 'en-US', + line_items: [ + { + key: '41327142600817', + fulfillment_service: 'manual', + gift_card: false, + grams: 0, + presentment_title: 'The Collection Snowboard: Hydrogen', + presentment_variant_title: '', + product_id: 7234590408817, + quantity: 1, + requires_shipping: true, + sku: '', + tax_lines: [], + taxable: true, + title: 'The Collection Snowboard: Hydrogen', + variant_id: 41327142600817, + variant_title: '', + variant_price: '600.00', + vendor: 'Hydrogen Vendor', + unit_price_measurement: { + measured_type: null, + quantity_value: null, + quantity_unit: null, + reference_value: null, + reference_unit: null, + }, + compare_at_price: null, + line_price: '600.00', + price: '600.00', + applied_discounts: [], + destination_location_id: null, + user_id: null, + rank: null, + origin_location_id: null, + properties: {}, + }, + ], + name: '#35550298931313', + abandoned_checkout_url: + 'https://pixel-testing-rs.myshopify.com/59026964593/checkouts/ac/Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ/recover?key=0385163be3875d3a2117e982d9cc3517&locale=en-US', + discount_codes: [], + tax_lines: [], + presentment_currency: 'USD', + source_name: 'web', + total_line_items_price: '600.00', + total_tax: '0.00', + total_discounts: '0.00', + subtotal_price: '600.00', + total_price: '600.00', + total_duties: '0.00', + device_id: null, + user_id: null, + location_id: null, + source_identifier: null, + source_url: null, + source: null, + closed_at: null, + query_parameters: { + topic: ['checkouts_create'], + version: ['pixel'], + writeKey: ['2mw9SN679HngnXXXHT4oSVVBVmb'], + }, + }; + const message = await processEvent(event); + expect(getValSpy).toHaveBeenCalledTimes(2); + expect(getValSpy).toHaveBeenCalledWith('pixel:anonymousIdTest1'); + expect(message.anonymousId).toEqual('anonymousIdTest1'); + }); + + it('should generate new anonymousId using UUID v5 when no existing ID is found', async () => { + const message = {}; + const event = { + note_attributes: [], + }; + const metricMetadata = { source: 'test', writeKey: 'test-key' }; + const cartToken = 'test-cart-token'; + const mockRedisData = null; + const expectedAnonymousId = '40a532a2-88be-5e3a-8687-56e34739e89d'; + jest.mock('uuid', () => ({ + v5: jest.fn(() => expectedAnonymousId), + DNS: 'dns-namespace', + })); + RedisDB.getVal = jest.spyOn(RedisDB, 'getVal').mockResolvedValue(mockRedisData); + await setAnonymousId(message, { ...event, cart_token: cartToken }, metricMetadata); + expect(message.anonymousId).toBe(expectedAnonymousId); + }); + + it('should handle undefined event parameter without error', async () => { + const message = {}; + + const metricMetadata = { + source: 'test-source', + writeKey: 'test-key', + }; + + await setAnonymousId(message, undefined, metricMetadata); + + expect(message.anonymousId).toBeUndefined(); + + expect(stats.increment).toHaveBeenCalledWith('shopify_pixel_id_stitch_gaps', { + event: message.event, + reason: 'cart_token_miss', + source: metricMetadata.source, + writeKey: metricMetadata.writeKey, + }); + }); }); diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js index 951fa479e4f..8a9ec2ba05e 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js @@ -1,9 +1,11 @@ -const { isDefinedAndNotNull } = require('@rudderstack/integrations-lib'); +/* eslint-disable no-param-reassign */ +const get = require('get-value'); +const { isDefinedAndNotNull, uuidv5 } = require('@rudderstack/integrations-lib'); +const { extractEmailFromPayload } = require('../../../../v0/sources/shopify/util'); const { constructPayload } = require('../../../../v0/util'); -const { - lineItemsMappingJSON, - productMappingJSON, -} = require('../../../../v0/sources/shopify/config'); +const { INTEGERATION, lineItemsMappingJSON, productMappingJSON } = require('../config'); +const { RedisDB } = require('../../../../util/redis/redisConnector'); +const stats = require('../../../../util/stats'); /** * Returns an array of products from the lineItems array received from the webhook event @@ -28,12 +30,15 @@ const getProductsFromLineItems = (lineItems, mapping) => { * @param {Object} message * @returns {Object} properties */ -const createPropertiesForEcomEventFromWebhook = (message) => { +const createPropertiesForEcomEventFromWebhook = (message, shopifyTopic) => { const { line_items: lineItems } = message; if (!lineItems || lineItems.length === 0) { return []; } const mappedPayload = constructPayload(message, productMappingJSON); + if (shopifyTopic === 'orders_updated' || shopifyTopic === 'checkouts_update') { + delete mappedPayload.value; + } mappedPayload.products = getProductsFromLineItems(lineItems, lineItemsMappingJSON); return mappedPayload; }; @@ -54,8 +59,117 @@ const getAnonymousIdFromAttributes = (event) => { return rudderAnonymousIdObject ? rudderAnonymousIdObject.value : null; }; +/** + * Returns the cart_token from the event message + * @param {Object} event + * @returns {String} cart_token + */ +const getCartToken = (event) => event?.cart_token || null; + +/** + * Adds the cartTokenHash to the traits object in the message + * @param {Object} message + * @param {String} event + * */ +const addCartTokenHashToTraits = (message, event) => { + const cartToken = getCartToken(event); + if (cartToken) { + const cartTokenHash = uuidv5(cartToken); + message.traits = { + ...message.traits, + cart_token_hash: cartTokenHash, + }; + } + return message; +}; + +/** + * Handles the anonymousId assignment for the message, based on the event attributes and redis data + * @param {Object} message rudderstack message object + * @param {Object} event raw shopify event payload + * @param {Object} metricMetadata metric metadata object + */ +const setAnonymousId = async (message, event, metricMetadata) => { + const anonymousId = getAnonymousIdFromAttributes(event); + const cartToken = getCartToken(event); + const cartTokenHash = cartToken ? uuidv5(cartToken) : null; + if (isDefinedAndNotNull(anonymousId)) { + message.anonymousId = anonymousId; + } + // if anonymousId is not present in note_attributes or note_attributes is not present, query redis for anonymousId + // when cart_token is present + else if (cartToken) { + const redisData = await RedisDB.getVal(`pixel:${cartToken}`); + if (redisData?.anonymousId) { + message.anonymousId = redisData.anonymousId; + stats.increment('shopify_pixel_cart_token_mapping', { + action: 'stitchCartTokenToAnonId', + operation: 'get', + }); + } else { + // if anonymousId is not present in note_attributes or redis, generate a new anonymousId + // the anonymousId will be generated by hashing the cart_token using uuidv5 + // this hash will be present in the traits object as cart_token_hash + message.anonymousId = cartTokenHash; + stats.increment('shopify_pixel_id_stitch_gaps', { + event: message.event, + reason: 'redis_cache_miss', + source: metricMetadata.source, + writeKey: metricMetadata.writeKey, + }); + } + } else { + stats.increment('shopify_pixel_id_stitch_gaps', { + event: message.event, + reason: 'cart_token_miss', + source: metricMetadata.source, + writeKey: metricMetadata.writeKey, + }); + } +}; + +/** + Handles email and contextual properties enrichment for the message payload + * @param {Object} message rudderstack message object + * @param {Object} event raw shopify event payload + * @param {String} shopifyTopic shopify event topic +*/ +const handleCommonProperties = (message, event, shopifyTopic) => { + if (!get(message, 'traits.email')) { + const email = extractEmailFromPayload(event); + if (email) { + message.setProperty('traits.email', email); + } + } + message.setProperty(`integrations.${INTEGERATION}`, true); + message.setProperty('context.library', { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }); + message.setProperty('context.topic', shopifyTopic); + // attaching cart, checkout and order tokens in context object + message.setProperty(`context.cart_token`, event.cart_token); + message.setProperty(`context.checkout_token`, event.checkout_token); + // raw shopify payload passed inside context object under shopifyDetails + message.setProperty('context.shopifyDetails', event); + if (shopifyTopic === 'orders_updated') { + message.setProperty(`context.order_token`, event.token); + } + message.setProperty('integrations.DATA_WAREHOUSE', { + options: { + jsonPaths: [`${message.type}.context.shopifyDetails`], + }, + }); + return message; +}; + module.exports = { createPropertiesForEcomEventFromWebhook, + getCartToken, getProductsFromLineItems, getAnonymousIdFromAttributes, + setAnonymousId, + handleCommonProperties, + addCartTokenHashToTraits, }; diff --git a/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js b/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js index b1d1c8b2fac..80f2fb10e23 100644 --- a/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js +++ b/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js @@ -15,7 +15,9 @@ const { checkoutEventBuilder, checkoutStepEventBuilder, searchEventBuilder, + extractCampaignParams, } = require('./pixelUtils'); +const campaignObjectMappings = require('../pixelEventsMappings/campaignObjectMappings.json'); const { INTEGERATION, PIXEL_EVENT_TOPICS, @@ -68,7 +70,7 @@ const handleCartTokenRedisOperations = async (inputEvent, clientId) => { const cartToken = extractCartToken(inputEvent); try { if (isDefinedNotNullNotEmpty(clientId) && isDefinedNotNullNotEmpty(cartToken)) { - await RedisDB.setVal(cartToken, ['anonymousId', clientId]); + await RedisDB.setVal(`pixel:${cartToken}`, ['anonymousId', clientId], 43200); stats.increment('shopify_pixel_cart_token_set', { event: inputEvent.name, writeKey: inputEvent.query_parameters.writeKey, @@ -83,16 +85,13 @@ const handleCartTokenRedisOperations = async (inputEvent, clientId) => { } }; -function processPixelEvent(inputEvent) { +async function processPixelEvent(inputEvent) { // eslint-disable-next-line @typescript-eslint/naming-convention - const { name, query_parameters, clientId, data, id } = inputEvent; + const { name, query_parameters, context, clientId, id } = inputEvent; const shopifyDetails = { ...inputEvent }; delete shopifyDetails.context; delete shopifyDetails.query_parameters; delete shopifyDetails.pixelEventLabel; - const { checkout } = data ?? {}; - const { order } = checkout ?? {}; - const { customer } = order ?? {}; let message = {}; switch (name) { case PIXEL_EVENT_TOPICS.PAGE_VIEWED: @@ -114,7 +113,6 @@ function processPixelEvent(inputEvent) { break; case PIXEL_EVENT_TOPICS.CHECKOUT_STARTED: case PIXEL_EVENT_TOPICS.CHECKOUT_COMPLETED: - if (customer.id) message.userId = customer.id || ''; handleCartTokenRedisOperations(inputEvent, clientId); message = checkoutEventBuilder(inputEvent); break; @@ -122,7 +120,6 @@ function processPixelEvent(inputEvent) { case PIXEL_EVENT_TOPICS.CHECKOUT_CONTACT_INFO_SUBMITTED: case PIXEL_EVENT_TOPICS.CHECKOUT_SHIPPING_INFO_SUBMITTED: case PIXEL_EVENT_TOPICS.PAYMENT_INFO_SUBMITTED: - if (customer.id) message.userId = customer.id || ''; handleCartTokenRedisOperations(inputEvent, clientId); message = checkoutStepEventBuilder(inputEvent); break; @@ -140,6 +137,11 @@ function processPixelEvent(inputEvent) { } message.anonymousId = clientId; message.setProperty(`integrations.${INTEGERATION}`, true); + message.setProperty('integrations.DATA_WAREHOUSE', { + options: { + jsonPaths: [`${message.type}.context.shopifyDetails`], + }, + }); message.setProperty('context.library', { name: 'RudderStack Shopify Cloud', eventOrigin: 'client', @@ -147,13 +149,30 @@ function processPixelEvent(inputEvent) { }); message.setProperty('context.topic', name); message.setProperty('context.shopifyDetails', shopifyDetails); + + // adding campaign object with utm parameters to the message context + const campaignParams = extractCampaignParams(context, campaignObjectMappings); + if (campaignParams) { + message.context.campaign = campaignParams; + } message.messageId = id; + + // attach userId to the message if anonymousId is present in Redis + // this allows stitching of events from the same user across multiple checkouts + const redisData = await RedisDB.getVal(`pixel:${message.anonymousId}`); + if (isDefinedNotNullNotEmpty(redisData)) { + message.userId = redisData.userId; + stats.increment('shopify_pixel_userid_mapping', { + action: 'stitchUserIdToAnonId', + operation: 'get', + }); + } message = removeUndefinedAndNullValues(message); return message; } const processPixelWebEvents = async (event) => { - const pixelEvent = processPixelEvent(event); + const pixelEvent = await processPixelEvent(event); return removeUndefinedAndNullValues(pixelEvent); }; diff --git a/src/v1/sources/shopify/webpixelTransformations/pixelUtils.js b/src/v1/sources/shopify/webpixelTransformations/pixelUtils.js index 46ae59e0cf8..40f81a93b9c 100644 --- a/src/v1/sources/shopify/webpixelTransformations/pixelUtils.js +++ b/src/v1/sources/shopify/webpixelTransformations/pixelUtils.js @@ -1,5 +1,6 @@ /* eslint-disable no-param-reassign */ -const Message = require('../../../../v0/sources/message'); +const { isDefinedAndNotNull } = require('@rudderstack/integrations-lib'); +const Message = require('../../../../sources/message'); const { EventType } = require('../../../../constants'); const { INTEGERATION, @@ -203,6 +204,41 @@ const searchEventBuilder = (inputEvent) => { ); }; +/** + * Extracts UTM parameters from the context object + * @param {*} context context object from the event + * @param {*} campaignMappings mappings for UTM parameters + * @returns campaignParams, an object containing UTM parameters + */ +const extractCampaignParams = (context, campaignMappings) => { + if (context?.document?.location?.href) { + const url = new URL(context.document.location.href); + const campaignParams = {}; + + // Loop through mappings and extract UTM parameters + campaignMappings.forEach((mapping) => { + const value = url.searchParams.get(mapping.sourceKeys); + if (isDefinedAndNotNull(value)) { + campaignParams[mapping.destKeys] = value; + } + }); + + // Extract any UTM parameters not in the mappings + const campaignObjectSourceKeys = campaignMappings.flatMap((mapping) => mapping.sourceKeys); + url.searchParams.forEach((value, key) => { + if (key.startsWith('utm_') && !campaignObjectSourceKeys.includes(key)) { + campaignParams[key] = value; + } + }); + + // Only return campaign object if we have any UTM parameters + if (Object.keys(campaignParams).length > 0) { + return campaignParams; + } + } + return null; +}; + module.exports = { pageViewedEventBuilder, cartViewedEventBuilder, @@ -212,4 +248,5 @@ module.exports = { checkoutEventBuilder, checkoutStepEventBuilder, searchEventBuilder, + extractCampaignParams, }; diff --git a/src/v1/sources/shopify/webpixelTransformations/pixelUtils.test.js b/src/v1/sources/shopify/webpixelTransformations/pixelUtils.test.js index e8f53a5f153..fcd8888d834 100644 --- a/src/v1/sources/shopify/webpixelTransformations/pixelUtils.test.js +++ b/src/v1/sources/shopify/webpixelTransformations/pixelUtils.test.js @@ -7,10 +7,12 @@ const { checkoutEventBuilder, checkoutStepEventBuilder, searchEventBuilder, + extractCampaignParams, } = require('./pixelUtils'); -const Message = require('../../../../v0/sources/message'); +const campaignObjectMappings = require('../pixelEventsMappings/campaignObjectMappings.json'); +const Message = require('../../../../sources/message'); jest.mock('ioredis', () => require('../../../../test/__mocks__/redis')); -jest.mock('../../../../v0/sources/message'); +jest.mock('../../../../sources/message'); describe('utilV2.js', () => { beforeEach(() => { @@ -787,4 +789,59 @@ describe('utilV2.js', () => { expect(message.context).toEqual({ userAgent: 'Mozilla/5.0' }); }); }); + + describe('extractCampaignParams', () => { + it('should extract campaign parameters from URL', () => { + const context = { + document: { + location: { + href: 'https://example.com?utm_source=google&utm_medium=cpc&utm_campaign=spring_sale', + }, + }, + }; + + const result = extractCampaignParams(context, campaignObjectMappings); + expect(result).toEqual({ + utm_source: 'google', + medium: 'cpc', + name: 'spring_sale', + }); + }); + + it('should return null if no campaign parameters are found', () => { + const context = { + document: { + location: { + href: 'https://example.com', + }, + }, + }; + + const result = extractCampaignParams(context, campaignObjectMappings); + expect(result).toBeNull(); + }); + + it('should extract additional UTM parameters not in mappings', () => { + const context = { + document: { + location: { + href: 'https://example.com?utm_source=google&utm_term=shoes', + }, + }, + }; + + const result = extractCampaignParams(context, campaignObjectMappings); + expect(result).toEqual({ + utm_source: 'google', + term: 'shoes', + }); + }); + + it('should handle missing context or location gracefully', () => { + const context = {}; + + const result = extractCampaignParams(context, campaignObjectMappings); + expect(result).toBeNull(); + }); + }); }); diff --git a/src/v1/sources/webhook/transform.js b/src/v1/sources/webhook/transform.js deleted file mode 100644 index fc13424b8a4..00000000000 --- a/src/v1/sources/webhook/transform.js +++ /dev/null @@ -1,19 +0,0 @@ -const { removeUndefinedAndNullValues, generateUUID } = require('../../../v0/util'); - -function processEvent(event) { - const payload = { - type: 'track', - event: 'webhook_source_event', - properties: event, - anonymousId: generateUUID(), - }; - return payload; -} - -function process(inputEvent) { - const { event } = inputEvent; - const response = processEvent(event); - return removeUndefinedAndNullValues(response); -} - -exports.process = process; diff --git a/src/warehouse/index.js b/src/warehouse/index.js index ea663c9b2fc..c5f167909f7 100644 --- a/src/warehouse/index.js +++ b/src/warehouse/index.js @@ -11,6 +11,7 @@ const { validTimestamp, getVersionedUtils, isRudderSourcesEvent, + mergeJSONPathsFromDataWarehouse, } = require('./util'); const { getMergeRuleEvent } = require('./identity'); @@ -307,8 +308,8 @@ function isStringLikeObject(obj) { let minKey = Infinity; let maxKey = -Infinity; - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; + for (const element of keys) { + const key = element; const value = obj[key]; if (!isNonNegativeInteger(key)) return false; @@ -336,8 +337,8 @@ function stringLikeObjectToString(obj) { .sort((a, b) => a - b); let result = ''; - for (let i = 0; i < keys.length; i++) { - result += obj[keys[i].toString()]; + for (const element of keys) { + result += obj[element.toString()]; } return result; @@ -655,6 +656,8 @@ function processWarehouseMessage(message, options) { const skipReservedKeywordsEscaping = options.integrationOptions.skipReservedKeywordsEscaping || false; + mergeJSONPathsFromDataWarehouse(message, options); + // underscoreDivideNumbers when set to false, if a column has a format like "_v_3_", it will be formatted to "_v3_" // underscoreDivideNumbers when set to true, if a column has a format like "_v_3_", we keep it like that // For older destinations, it will come as true and for new destinations this config will not be present which means we will treat it as false. diff --git a/src/warehouse/util.js b/src/warehouse/util.js index 7f4e224a349..1f2d9215f2c 100644 --- a/src/warehouse/util.js +++ b/src/warehouse/util.js @@ -136,6 +136,27 @@ const getRecordIDForExtract = (message) => { return recordId; }; +function mergeJSONPathsFromDataWarehouse(message, options) { + const dataWarehouseOptions = message.integrations?.['DATA_WAREHOUSE']?.options; + if (!dataWarehouseOptions?.jsonPaths) return; + + const dataWarehouseJSONPaths = Array.isArray(dataWarehouseOptions.jsonPaths) + ? dataWarehouseOptions.jsonPaths + : []; + const currentJSONPaths = Array.isArray(options.integrationOptions?.jsonPaths) + ? options.integrationOptions.jsonPaths + : []; + + switch (options.provider) { + case 'rs': + case 'postgres': + case 'snowflake': + case 'bq': + options.integrationOptions.jsonPaths = [...dataWarehouseJSONPaths, ...currentJSONPaths]; + break; + } +} + module.exports = { isObject, isValidJsonPathKey, @@ -148,4 +169,5 @@ module.exports = { sourceCategoriesToUseRecordId, getCloudRecordID, getRecordIDForExtract, + mergeJSONPathsFromDataWarehouse, }; diff --git a/swagger/api.yaml b/swagger/api.yaml index 8e7a67d6f8e..6b4a484a2cf 100644 --- a/swagger/api.yaml +++ b/swagger/api.yaml @@ -52,8 +52,10 @@ paths: $ref: './routes/bulkUpload.yaml#/~1getWarningJobs' #Delivery Routes - /{version}/destinations/{destination}/proxy: - $ref: './routes/delivery.yaml#/~1{version}~1destinations~1{destination}~1proxy' + /v0/destinations/{destination}/proxy: + $ref: './routes/delivery.yaml#/~1v0~1destinations~1{destination}~1proxy' + /v1/destinations/{destination}/proxy: + $ref: './routes/delivery.yaml#/~1v1~1destinations~1{destination}~1proxy' /{version}/destinations/{destination}/proxyTest: $ref: './routes/delivery.yaml#/~1{version}~1destinations~1{destination}~1proxyTest' diff --git a/swagger/components/examples/delivery/v0/request/request.yaml b/swagger/components/examples/delivery/v0/request/request.yaml new file mode 100644 index 00000000000..ee2eee44e95 --- /dev/null +++ b/swagger/components/examples/delivery/v0/request/request.yaml @@ -0,0 +1,33 @@ +value: + version: v1 + type: REST + method: POST + endpoint: "https://demoapp-api.bloomreach.com/data/v2/projects/{project}/catalogs/{catalog}/items/partial-update" + userId: "" + headers: + Authorization: "Basic token" + params: {} + body: + JSON: {} + JSON_ARRAY: + batch: + - item_id: "222" + properties: { } + XML: {} + FORM: {} + files: {} + 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 \ No newline at end of file diff --git a/swagger/components/examples/delivery/v0/response/failure.yaml b/swagger/components/examples/delivery/v0/response/failure.yaml new file mode 100644 index 00000000000..91e3e0c1ee1 --- /dev/null +++ b/swagger/components/examples/delivery/v0/response/failure.yaml @@ -0,0 +1,23 @@ +message: "[Generic Response Handler] Request failed for destination bloomreach_catalog with status: 401" +status: 401 +destinationResponse: + response: "Could not verify your access level for that URL.\nYou have to login with proper credentials using HTTP Basic Auth (public key as username and private key as password)" + status: 401 + headers: + server: "nginx" + date: "Fri, 1 Jan 2029 03:03:43 GMT" + content-type: "text/html; charset=utf-8" + content-length: "165" + www-authenticate: 'Basic realm="Login Required"' + vary: "Cookie" + via: "1.1 google" + alt-svc: 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000' +statTags: + errorCategory: "network" + errorType: "aborted" + destType: "BLOOMREACH_CATALOG" + module: "destination" + implementation: "native" + feature: "dataDelivery" + destinationId: "2JIqVoWNvSOHa9ppKOqSxxx" + workspaceId: "2hSS1hZ8kuCpUZAAYsQucAFdxxx" \ No newline at end of file diff --git a/swagger/components/examples/delivery/v0/response/success.yaml b/swagger/components/examples/delivery/v0/response/success.yaml new file mode 100644 index 00000000000..26fa5a1a900 --- /dev/null +++ b/swagger/components/examples/delivery/v0/response/success.yaml @@ -0,0 +1,20 @@ +output: + status: 200 + message: "[Generic Response Handler] Request for destination: bloomreach_catalog Processed Successfully" + destinationResponse: + response: + - queued: true + success: true + status: 200 + headers: + server: "nginx" + date: "Mon, 01 Jan 2029 03:45:29 GMT" + content-type: "application/json" + x-ratelimit-limit: 5 + x-ratelimit-remaining: 4 + x-ratelimit-reset: 1736135140 + retry-after: "Mon, 06 Jan 2025 03:45:40 GMT" + strict-transport-security: "max-age=31536000; includeSubDomains" + via: "1.1 google" + alt-svc: "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + transfer-encoding: "chunked" \ No newline at end of file diff --git a/swagger/components/examples/delivery/v1/request/request.yaml b/swagger/components/examples/delivery/v1/request/request.yaml new file mode 100644 index 00000000000..bc33c56b7ad --- /dev/null +++ b/swagger/components/examples/delivery/v1/request/request.yaml @@ -0,0 +1,49 @@ +value: + version: v1 + type: REST + method: POST + endpoint: "https://demoapp-api.bloomreach.com/data/v2/projects/{project}/catalogs/{catalog}/items/partial-update" + userId: "" + headers: + Authorization: "Basic token" + params: {} + body: + JSON: {} + JSON_ARRAY: + batch: + - item_id: "222" + properties: {} + - item_id: "11234" + properties: {} + XML: {} + FORM: {} + files: {} + 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 + - userId: '<<>>12345<<>>12345' + jobId: 2 + 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 \ No newline at end of file diff --git a/swagger/components/examples/delivery/v1/response/failure.yaml b/swagger/components/examples/delivery/v1/response/failure.yaml new file mode 100644 index 00000000000..e269f4db504 --- /dev/null +++ b/swagger/components/examples/delivery/v1/response/failure.yaml @@ -0,0 +1,29 @@ +response: + - error: "\"Could not verify your access level for that URL.\\nYou have to login with proper credentials using HTTP Basic Auth (public key as username and private key as password)\"" + statusCode: 401 + 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 +statTags: + errorCategory: "network" + errorType: "aborted" + destType: "BLOOMREACH_CATALOG" + module: "destination" + implementation: "native" + feature: "dataDelivery" + destinationId: "2JIqVoWNvSOHa9ppKOqSxxx" + workspaceId: "2hSS1hZ8kuCpUZAAYsQucAFdxxx" +message: "BLOOMREACH_CATALOG: Error encountered in transformer proxy V1" +status: 401 \ No newline at end of file diff --git a/swagger/components/examples/delivery/v1/response/success.yaml b/swagger/components/examples/delivery/v1/response/success.yaml new file mode 100644 index 00000000000..f30e131fe95 --- /dev/null +++ b/swagger/components/examples/delivery/v1/response/success.yaml @@ -0,0 +1,57 @@ +output: + status: 200 + message: "[BLOOMREACH_CATALOG Response V1 Handler] - Request Processed Successfully" + destinationResponse: + response: + - queued: true + success: true + - queued: true + success: true + status: 200 + headers: + server: "nginx" + date: "Mon, 06 Jan 2025 03:45:29 GMT" + content-type: "application/json" + x-ratelimit-limit: 5 + x-ratelimit-remaining: 4 + x-ratelimit-reset: 1736135140 + retry-after: "Mon, 06 Jan 2025 03:45:40 GMT" + strict-transport-security: "max-age=31536000; includeSubDomains" + via: "1.1 google" + alt-svc: "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + transfer-encoding: "chunked" +response: + - statusCode: 200 + error: "success" + 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 + - statusCode: 200 + error: "success" + metadata: + userId: "<<>>12345<<>>12345" + jobId: 2 + 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 \ No newline at end of file diff --git a/swagger/components/schemas/v0DeliveryRequest.yaml b/swagger/components/schemas/v0DeliveryRequest.yaml new file mode 100644 index 00000000000..8dced0661c0 --- /dev/null +++ b/swagger/components/schemas/v0DeliveryRequest.yaml @@ -0,0 +1,32 @@ +title: Proxy Request +type: object +properties: + version: + type: string + type: + type: string + method: + type: string + endpoint: + type: string + userId: + type: string + headers: + type: object + params: + type: object + body: + type: object + properties: + JSON: + type: object + JSON_ARRAY: + type: object + XML: + type: object + FORM: + type: object + files: + type: object + metadata: + $ref: './metadata.yaml' \ No newline at end of file diff --git a/swagger/components/schemas/deliveryResponse.yaml b/swagger/components/schemas/v0DeliveryResponse.yaml similarity index 97% rename from swagger/components/schemas/deliveryResponse.yaml rename to swagger/components/schemas/v0DeliveryResponse.yaml index 8f373c2aeb9..91f4816bea1 100644 --- a/swagger/components/schemas/deliveryResponse.yaml +++ b/swagger/components/schemas/v0DeliveryResponse.yaml @@ -28,4 +28,4 @@ properties: workspaceId: type: string authErrorCategory: - type: string + type: string \ No newline at end of file diff --git a/swagger/components/schemas/v1DeliveryRequest.yaml b/swagger/components/schemas/v1DeliveryRequest.yaml new file mode 100644 index 00000000000..53ec6a650ee --- /dev/null +++ b/swagger/components/schemas/v1DeliveryRequest.yaml @@ -0,0 +1,34 @@ +title: Proxy Request +type: object +properties: + version: + type: string + type: + type: string + method: + type: string + endpoint: + type: string + userId: + type: string + headers: + type: object + params: + type: object + body: + type: object + properties: + JSON: + type: object + JSON_ARRAY: + type: object + XML: + type: object + FORM: + type: object + files: + type: object + metadata: + type: array + items: + $ref: './metadata.yaml' \ No newline at end of file diff --git a/swagger/components/schemas/v1DeliveryResponse.yaml b/swagger/components/schemas/v1DeliveryResponse.yaml new file mode 100644 index 00000000000..d24cdf7a161 --- /dev/null +++ b/swagger/components/schemas/v1DeliveryResponse.yaml @@ -0,0 +1,42 @@ +title: Delivery response +type: object +properties: + status: + type: number + message: + type: string + statTags: + type: object + properties: + errorCategory: + type: string + errorType: + type: string + destType: + type: string + module: + type: string + implementation: + type: string + feature: + type: string + example: 'dataDelivery' + destinationId: + type: string + workspaceId: + type: string + destinationResponse: + type: object + authErrorCategory: + type: string + response: + type: array + items: + type: object + properties: + error: + type: string + statusCode: + type: number + metadata: + $ref: './metadata.yaml' diff --git a/swagger/routes/delivery.yaml b/swagger/routes/delivery.yaml index 7506666d460..97de9257c7d 100644 --- a/swagger/routes/delivery.yaml +++ b/swagger/routes/delivery.yaml @@ -1,14 +1,9 @@ -/{version}/destinations/{destination}/proxy: +/v0/destinations/{destination}/proxy: post: tags: - Delivery summary: Destination processor transformation parameters: - - in: path - name: version - required: true - schema: - type: string - in: path name: destination description: The destination identifier @@ -21,7 +16,10 @@ content: application/json: schema: - $ref: '../components/schemas/processorTransformationOutput.yaml' + $ref: '../components/schemas/v0DeliveryRequest.yaml' + examples: + request: + $ref: '../components/examples/delivery/v0/request/request.yaml' responses: 200: description: Success @@ -31,25 +29,58 @@ type: object properties: output: - $ref: '../components/schemas/deliveryResponse.yaml' - 400: - description: Bad Request - content: - application/json: - schema: - type: object - properties: - output: - $ref: '../components/schemas/deliveryResponse.yaml' - 500: - description: Internal Server Error + $ref: '../components/schemas/v0DeliveryResponse.yaml' + examples: + success: + value: + output: + $ref: '../components/examples/delivery/v0/response/success.yaml' + failure: + value: + output: + $ref: '../components/examples/delivery/v0/response/failure.yaml' + +/v1/destinations/{destination}/proxy: + post: + tags: + - Delivery + summary: Destination processor transformation + parameters: + - in: path + name: destination + description: The destination identifier + required: true + schema: + type: string + requestBody: + description: Request Body + required: true + content: + application/json: + schema: + $ref: '../components/schemas/v1DeliveryRequest.yaml' + examples: + request: + $ref: '../components/examples/delivery/v1/request/request.yaml' + responses: + 200: + description: Success content: application/json: schema: type: object properties: output: - $ref: '../components/schemas/deliveryResponse.yaml' + $ref: '../components/schemas/v1DeliveryResponse.yaml' + examples: + success: + value: + output: + $ref: '../components/examples/delivery/v1/response/success.yaml' + failure: + value: + output: + $ref: '../components/examples/delivery/v1/response/failure.yaml' /{version}/destinations/{destination}/proxyTest: post: diff --git a/swagger/routes/source.yaml b/swagger/routes/source.yaml index 3babdb57e14..4dc64df540e 100644 --- a/swagger/routes/source.yaml +++ b/swagger/routes/source.yaml @@ -22,6 +22,23 @@ type: array items: type: object + examples: + v2Spec: + summary: V2 Spec Request Structure Example + value: + - request: + body: '{"key": "value", "nested": {"data": "example"}}' + url: "https://rudderstack.webhook.endpoint/v1/webhook?paramkey=paramvalue" + method: "POST" + query_parameters: {paramKey: ["paramValue"]} + headers: {headerKey: ["headerValue"]} + source: {} + v1Spec: + summary: V1 Spec Request Structure Example + value: + - request: + event: {"key": "value", "nested": {"data": "example"}, query_parameters: {paramKey: "paramValue"}} + source: {} responses: 200: description: Success diff --git a/test/__mocks__/data/marketo_static_list/proxy_response.json b/test/__mocks__/data/marketo_static_list/proxy_response.json index 290a4f5fbf6..c80777db68a 100644 --- a/test/__mocks__/data/marketo_static_list/proxy_response.json +++ b/test/__mocks__/data/marketo_static_list/proxy_response.json @@ -1,5 +1,5 @@ { - "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112": { + "https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=110&id=111&id=112": { "data": { "requestId": "b6d1#18a8d2c10e7", "result": [ @@ -26,7 +26,7 @@ }, "status": 200 }, - "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3": { + "https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2&id=3": { "data": { "requestId": "68d8#1846058ee27", "success": false, @@ -39,7 +39,7 @@ }, "status": 200 }, - "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2": { + "https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2": { "data": { "requestId": "12d3c#1846057dce2", "result": [ @@ -56,7 +56,7 @@ }, "status": 200 }, - "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4": { + "https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=3&id=4": { "data": { "requestId": "12d3c#1846057dce2", "result": [ @@ -79,7 +79,7 @@ }, "status": 200 }, - "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6": { + "https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=5&id=6": { "data": { "requestId": "12d3c#1846057dce2", "result": { diff --git a/test/__tests__/data/marketo_static_list_proxy_input.json b/test/__tests__/data/marketo_static_list_proxy_input.json index 6f84e7416dc..86c458c0806 100644 --- a/test/__tests__/data/marketo_static_list_proxy_input.json +++ b/test/__tests__/data/marketo_static_list_proxy_input.json @@ -1,7 +1,7 @@ [ { "type": "REST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=110&id=111&id=112", "method": "POST", "userId": "", "headers": { @@ -21,7 +21,7 @@ }, { "type": "REST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2&id=3", "method": "POST", "userId": "", "headers": { @@ -41,7 +41,7 @@ }, { "type": "REST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2", "method": "POST", "userId": "", "headers": { @@ -75,7 +75,7 @@ }, { "type": "REST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=3&id=4", "method": "POST", "userId": "", "headers": { @@ -116,7 +116,7 @@ }, { "type": "REST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=5&id=6", "method": "POST", "userId": "", "headers": { diff --git a/test/__tests__/data/warehouse/flatten_event_properties.js b/test/__tests__/data/warehouse/flatten_event_properties.js index 844d01744ec..0c34349180a 100644 --- a/test/__tests__/data/warehouse/flatten_event_properties.js +++ b/test/__tests__/data/warehouse/flatten_event_properties.js @@ -86,7 +86,7 @@ const sampleEvents = { object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4}' + JSON.stringify({"fourthLevelInt":4}) }, columnTypes: { int_prop: "int", @@ -106,12 +106,12 @@ const sampleEvents = { int_prop: 0, float_prop: 2.2, string_prop: "zero", - array_prop: '["zero","level"]', + array_prop: JSON.stringify(["zero","level"]), object_prop_first_level_int: 1, object_prop_first_level_bool: true, object_prop_first_level_map_second_level_array: ["second", "level"], object_prop_first_level_map_second_level_map: - '{"thirdLevelString":"third level","thirdLevelMap":{"fourthLevelInt":4}}' + JSON.stringify({"thirdLevelString":"third level","thirdLevelMap":{"fourthLevelInt":4}}) }, columnTypes: { int_prop: "int", @@ -136,7 +136,7 @@ const sampleEvents = { object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4}' + JSON.stringify({"fourthLevelInt":4}) }, columnTypes: { int_prop: "int", @@ -156,13 +156,13 @@ const sampleEvents = { int_prop: 0, float_prop: 2.2, string_prop: "zero", - array_prop: '["zero","level"]', + array_prop: JSON.stringify(["zero","level"]), object_prop_first_level_int: 1, object_prop_first_level_map_second_level_array: ["second", "level"], object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4,"fourthLevelMap":{"fifthLevelString":"fifth level"}}' + JSON.stringify({"fourthLevelInt":4,"fourthLevelMap":{"fifthLevelString":"fifth level"}}) }, columnTypes: { int_prop: "int", @@ -280,7 +280,7 @@ const sampleEvents = { object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4}' + JSON.stringify({"fourthLevelInt":4}) }, columnTypes: { int_prop: "int", @@ -300,12 +300,12 @@ const sampleEvents = { int_prop: 0, float_prop: 2.2, string_prop: "zero", - array_prop: '["zero","level"]', + array_prop: JSON.stringify(["zero","level"]), object_prop_first_level_int: 1, object_prop_first_level_bool: true, object_prop_first_level_map_second_level_array: ["second", "level"], object_prop_first_level_map_second_level_map: - '{"thirdLevelString":"third level","thirdLevelMap":{"fourthLevelInt":4}}' + JSON.stringify({"thirdLevelString":"third level","thirdLevelMap":{"fourthLevelInt":4}}) }, columnTypes: { int_prop: "int", @@ -330,7 +330,7 @@ const sampleEvents = { object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4}' + JSON.stringify({"fourthLevelInt":4}) }, columnTypes: { int_prop: "int", @@ -350,13 +350,13 @@ const sampleEvents = { int_prop: 0, float_prop: 2.2, string_prop: "zero", - array_prop: '["zero","level"]', + array_prop: JSON.stringify(["zero","level"]), object_prop_first_level_int: 1, object_prop_first_level_map_second_level_array: ["second", "level"], object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4,"fourthLevelMap":{"fifthLevelString":"fifth level"}}' + JSON.stringify({"fourthLevelInt":4,"fourthLevelMap":{"fifthLevelString":"fifth level"}}) }, columnTypes: { int_prop: "int", @@ -476,7 +476,7 @@ const sampleEvents = { object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4}' + JSON.stringify({"fourthLevelInt":4}) }, columnTypes: { int_prop: "int", @@ -496,12 +496,12 @@ const sampleEvents = { int_prop: 0, float_prop: 2.2, string_prop: "zero", - array_prop: '["zero","level"]', + array_prop: JSON.stringify(["zero","level"]), object_prop_first_level_int: 1, object_prop_first_level_bool: true, object_prop_first_level_map_second_level_array: ["second", "level"], object_prop_first_level_map_second_level_map: - '{"thirdLevelString":"third level","thirdLevelMap":{"fourthLevelInt":4}}' + JSON.stringify({"thirdLevelString":"third level","thirdLevelMap":{"fourthLevelInt":4}}) }, columnTypes: { int_prop: "int", @@ -526,7 +526,7 @@ const sampleEvents = { object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4}' + JSON.stringify({"fourthLevelInt":4}) }, columnTypes: { int_prop: "int", @@ -546,13 +546,13 @@ const sampleEvents = { int_prop: 0, float_prop: 2.2, string_prop: "zero", - array_prop: '["zero","level"]', + array_prop: JSON.stringify(["zero","level"]), object_prop_first_level_int: 1, object_prop_first_level_map_second_level_array: ["second", "level"], object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4,"fourthLevelMap":{"fifthLevelString":"fifth level"}}' + JSON.stringify({"fourthLevelInt":4,"fourthLevelMap":{"fifthLevelString":"fifth level"}}) }, columnTypes: { int_prop: "int", diff --git a/test/__tests__/data/warehouse/integration_options_events.js b/test/__tests__/data/warehouse/integration_options_events.js index b3f076851b9..aacf9abd5c2 100644 --- a/test/__tests__/data/warehouse/integration_options_events.js +++ b/test/__tests__/data/warehouse/integration_options_events.js @@ -323,10 +323,10 @@ const sampleEvents = { path_to_$1_000_000: "None", _9omega: true, camelcase123key: "camel case", - testmap_nestedmap: '{"n1":"nested prop 1"}', + testmap_nestedmap: JSON.stringify({"n1":"nested prop 1"}), tmap_t1: 10, tmap_t2: 20, - testarray: '["This is","an","array"]', + testarray: JSON.stringify(["This is","an","array"]), context_app_build: "1.0.0", context_app_name: "RudderLabs JavaScript SDK", context_app_namespace: "com.rudderlabs.javascript", @@ -406,9 +406,9 @@ const sampleEvents = { PATH_TO_$1_000_000: "None", _9OMEGA: true, CAMELCASE123KEY: "camel case", - TESTMAP_NESTEDMAP: '{"n1":"nested prop 1"}', - TMAP: '{"t1":10,"t2":20}', - TESTARRAY: '["This is","an","array"]', + TESTMAP_NESTEDMAP: JSON.stringify({"n1":"nested prop 1"}), + TMAP: JSON.stringify({"t1":10,"t2":20}), + TESTARRAY: JSON.stringify(["This is","an","array"]), CONTEXT_APP_BUILD: "1.0.0", CONTEXT_APP_NAME: "RudderLabs JavaScript SDK", CONTEXT_APP_NAMESPACE: "com.rudderlabs.javascript", @@ -488,9 +488,9 @@ const sampleEvents = { PATH_TO_$1_000_000: "None", _9OMEGA: true, CAMELCASE123KEY: "camel case", - TESTMAP_NESTEDMAP: '{"n1":"nested prop 1"}', - TMAP: '{"t1":10,"t2":20}', - TESTARRAY: '["This is","an","array"]', + TESTMAP_NESTEDMAP: JSON.stringify({"n1":"nested prop 1"}), + TMAP: JSON.stringify({"t1":10,"t2":20}), + TESTARRAY: JSON.stringify(["This is","an","array"]), CONTEXT_APP_BUILD: "1.0.0", CONTEXT_APP_NAME: "RudderLabs JavaScript SDK", CONTEXT_APP_NAMESPACE: "com.rudderlabs.javascript", @@ -784,9 +784,9 @@ const sampleEvents = { path_to_1_000_000: "None", _9_omega: true, camel_case_123_key: "camel case", - test_map_nested_map: '{"n1":"nested prop 1"}', - t_map: '{"t1":10,"t2":20}', - test_array: '["This is","an","array"]', + test_map_nested_map: JSON.stringify({"n1":"nested prop 1"}), + t_map: JSON.stringify({"t1":10,"t2":20}), + test_array: JSON.stringify(["This is","an","array"]), context_app_build: "1.0.0", context_app_name: "RudderLabs JavaScript SDK", context_app_namespace: "com.rudderlabs.javascript", diff --git a/test/__tests__/legacyRouter.test.ts b/test/__tests__/legacyRouter.test.ts deleted file mode 100644 index 926f6e76d4e..00000000000 --- a/test/__tests__/legacyRouter.test.ts +++ /dev/null @@ -1,113 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { DestinationController } from '../../src/controllers/destination'; -const destArg = process.argv.filter((x) => x.startsWith('--destName='))[0]; // send arguments on which destination -const typeArg = process.argv.filter((x) => x.startsWith('--type='))[0]; // send argument on which function - -// To invoke CDK live compare: -// router: CDK_LIVE_TEST=1 npx jest versionedRouter --destName=algolia --type=router -// processor: CDK_LIVE_TEST=1 npx jest versionedRouter --destName=algolia --type=processor - -let destination; -if (typeArg) { - destination = destArg ? destArg.split('=')[1] : 'heap'; // default - const type = typeArg.split('=')[1]; - let reqBody; - let respBody; - if (type !== 'all') { - try { - reqBody = JSON.parse( - fs - .readFileSync( - path.resolve(__dirname, `./data/versioned_${type}_${destination}_input.json`), - ) - .toString(), - ); - respBody = JSON.parse( - fs - .readFileSync( - path.resolve(__dirname, `./data/versioned_${type}_${destination}_output.json`), - ) - .toString(), - ); - } catch (error) { - throw new Error('destination/type not valid' + error); - } - } - if (type === 'router') { - it(`Testing: routerHandleDest`, async () => { - const output = await DestinationController.destinationTransformAtRouter(reqBody); - expect(output).toEqual(respBody); - }); - } else if (type === 'processor') { - it(`Testing: handleDest`, async () => { - const output = await DestinationController.destinationTransformAtProcessor(reqBody); - expect(output).toEqual(respBody); - }); - } else if (type === 'batch') { - it(`Testing: batchHandler`, async () => { - const output = await DestinationController.batchProcess(reqBody); - expect(output).toEqual(respBody); - }); - } else if (type === 'all') { - it(`Testing: routerHandleDest`, async () => { - const reqBody = JSON.parse( - fs - .readFileSync( - path.resolve(__dirname, `./data/versioned_router_${destination}_input.json`), - ) - .toString(), - ); - const respBody = JSON.parse( - fs - .readFileSync( - path.resolve(__dirname, `./data/versioned_router_${destination}_output.json`), - ) - .toString(), - ); - const output = await DestinationController.destinationTransformAtRouter(reqBody); - expect(output).toEqual(respBody); - }); - it(`Testing: handleDest`, async () => { - const reqBody = JSON.parse( - fs - .readFileSync( - path.resolve(__dirname, `./data/versioned_processor_${destination}_input.json`), - ) - .toString(), - ); - const respBody = JSON.parse( - fs - .readFileSync( - path.resolve(__dirname, `./data/versioned_processor_${destination}_output.json`), - ) - .toString(), - ); - destination = destination || 'heap'; // default - const output = await DestinationController.destinationTransformAtProcessor(reqBody); - expect(output).toEqual(respBody); - }); - it(`Testing: batchHandler`, async () => { - const reqBody = JSON.parse( - fs - .readFileSync(path.resolve(__dirname, `./data/versioned_batch_braze_input.json`)) - .toString(), - ); - const respBody = JSON.parse( - fs - .readFileSync(path.resolve(__dirname, `./data/versioned_batch_braze_output.json`)) - .toString(), - ); - }); - } else { - it(`Type is not all/router/batch/processor`, () => { - expect('Type is not all/router/batch/processor').toEqual( - 'Type is not all/router/batch/processor', - ); - }); - } -} else { - it(`No type and destination mentioned for testing versionedRouter`, () => { - expect('no command line argument provided').toEqual('no command line argument provided'); - }); -} diff --git a/test/__tests__/shopify_warehouse.test.js b/test/__tests__/shopify_warehouse.test.js new file mode 100644 index 00000000000..b7c1fbf59fb --- /dev/null +++ b/test/__tests__/shopify_warehouse.test.js @@ -0,0 +1,103 @@ +const event = { + "request": { + "query": { + "whSchemaVersion": "v1" + } + }, + "message": { + "context": { + "shopifyDetails": { + "id": 5778367414385, + "current_total_tax": "10.00", + "current_total_tax_set": { + "shop_money": { + "amount": "10.00", + "currency_code": "USD" + }, + }, + "name": "#1017", + "phone": null, + } + }, + "integrations": { + "SHOPIFY": true, + "DATA_WAREHOUSE": { + "options": { + "jsonPaths": [ + "track.context.shopifyDetails" + ] + } + } + }, + "type": "track", + "event": "Order Updated", + "properties": { + "order_id": "5778367414385", + "currency": "USD", + "products": [ + { + "product_id": "7234590408817", + "price": 600, + "quantity": 1 + } + ] + }, + "userId": "123321", + "traits": {}, + "timestamp": "2024-01-01T01:23:45.678Z", + }, + "destination": { + "Config": {}, + } +}; + +/* + Test for warehouse agnostic DATA_WAREHOUSE JSON column support for Shopify source +*/ +describe('DATA_WAREHOUSE integrations', () => { + it('should process event and return responses for common providers for agnostic support', () => { + const responses = require('../../src/v0/destinations/snowflake/transform').process(event); + expect(responses).toHaveLength(2); + expect(responses[0].metadata.table).toBe('TRACKS'); + expect(responses[1].metadata.table).toBe('ORDER_UPDATED'); + + expect(responses[0].metadata.columns.CONTEXT_SHOPIFY_DETAILS).toBe('json'); + expect(responses[0].data.CONTEXT_SHOPIFY_DETAILS).toBe(JSON.stringify({"id":5778367414385,"current_total_tax":"10.00","current_total_tax_set":{"shop_money":{"amount":"10.00","currency_code":"USD"}},"name":"#1017","phone":null})); + + expect(responses[1].metadata.columns.CONTEXT_SHOPIFY_DETAILS).toBe('json'); + expect(responses[1].data.CONTEXT_SHOPIFY_DETAILS).toBe(JSON.stringify({"id":5778367414385,"current_total_tax":"10.00","current_total_tax_set":{"shop_money":{"amount":"10.00","currency_code":"USD"}},"name":"#1017","phone":null})); + }); + + it('should process event and return response for other providers like mssql', () => { + const responses = require('../../src/v0/destinations/mssql/transform').process(event); + expect(responses).toHaveLength(2); + expect(responses[0].metadata.table).toBe('tracks'); + expect(responses[1].metadata.table).toBe('order_updated'); + + expect(responses[0].metadata.columns.context_shopify_details).toBe(undefined); + expect(responses[0].metadata.columns.context_shopify_details_id).toBe('int'); + expect(responses[0].metadata.columns.context_shopify_details_current_total_tax).toBe('string'); + expect(responses[0].metadata.columns.context_shopify_details_current_total_tax_set_shop_money_amount).toBe('string'); + expect(responses[0].metadata.columns.context_shopify_details_current_total_tax_set_shop_money_currency_code).toBe('string'); + expect(responses[0].metadata.columns.context_shopify_details_name).toBe('string'); + expect(responses[0].data.context_shopify_details).toBe(undefined); + expect(responses[0].data.context_shopify_details_id).toBe(5778367414385); + expect(responses[0].data.context_shopify_details_current_total_tax).toBe('10.00'); + expect(responses[0].data.context_shopify_details_current_total_tax_set_shop_money_amount).toBe('10.00'); + expect(responses[0].data.context_shopify_details_current_total_tax_set_shop_money_currency_code).toBe('USD'); + expect(responses[0].data.context_shopify_details_name).toBe('#1017'); + + expect(responses[1].metadata.columns.context_shopify_details).toBe(undefined); + expect(responses[1].metadata.columns.context_shopify_details_id).toBe('int'); + expect(responses[1].metadata.columns.context_shopify_details_current_total_tax).toBe('string'); + expect(responses[1].metadata.columns.context_shopify_details_current_total_tax_set_shop_money_amount).toBe('string'); + expect(responses[1].metadata.columns.context_shopify_details_current_total_tax_set_shop_money_currency_code).toBe('string'); + expect(responses[1].metadata.columns.context_shopify_details_name).toBe('string'); + expect(responses[1].data.context_shopify_details).toBe(undefined); + expect(responses[1].data.context_shopify_details_id).toBe(5778367414385); + expect(responses[1].data.context_shopify_details_current_total_tax).toBe('10.00'); + expect(responses[1].data.context_shopify_details_current_total_tax_set_shop_money_amount).toBe('10.00'); + expect(responses[1].data.context_shopify_details_current_total_tax_set_shop_money_currency_code).toBe('USD'); + expect(responses[1].data.context_shopify_details_name).toBe('#1017'); + }); +}); \ No newline at end of file diff --git a/test/__tests__/user_transformation_fetch.test.js b/test/__tests__/user_transformation_fetch.test.js index 3f0b0606898..635f7d16e70 100644 --- a/test/__tests__/user_transformation_fetch.test.js +++ b/test/__tests__/user_transformation_fetch.test.js @@ -149,7 +149,7 @@ describe("User transformation fetch tests", () => { } ` }; - const errMsg = "request to https://abc.xyz.com/dummyUrl failed, reason: Invalid IP address: unable to resolve IP address for abc.xyz.com"; + const errMsg = "request to https://abc.xyz.com/dummyUrl failed, reason: unable to resolve IP address for abc.xyz.com"; mockResolver.mockRejectedValue('invalid host'); const output = await userTransformHandler(inputData, versionId, [], trRevCode, true); @@ -305,7 +305,7 @@ describe("User transformation fetch tests", () => { } ` }; - const errMsg = "request to https://abc.xyz.com/dummyUrl failed, reason: Invalid IP address: cannot use 127.0.0.1 as IP address"; + const errMsg = "request to https://abc.xyz.com/dummyUrl failed, reason: cannot use 127.0.0.1 as IP address"; mockResolver.mockResolvedValue([{ address: '127.0.0.1', ttl: 100 }, { address: '3.122.122.122', ttl: 600 }]); const output = await userTransformHandler(inputData, versionId, [], trRevCode, true); diff --git a/test/apitests/data_scenarios/source/v2/response_to_caller.json b/test/apitests/data_scenarios/source/v2/response_to_caller.json new file mode 100644 index 00000000000..c2f992e524e --- /dev/null +++ b/test/apitests/data_scenarios/source/v2/response_to_caller.json @@ -0,0 +1,18 @@ +{ + "input": [ + { + "request": { + "body": "{\"challenge\": \"some_key\"}" + } + } + ], + "output": [ + { + "outputToSource": { + "body": "eyJjaGFsbGVuZ2UiOiJzb21lX2tleSJ9", + "contentType": "application/json" + }, + "statusCode": 200 + } + ] +} diff --git a/test/apitests/service.api.test.ts b/test/apitests/service.api.test.ts index 2ad1f323ace..4c53178c76f 100644 --- a/test/apitests/service.api.test.ts +++ b/test/apitests/service.api.test.ts @@ -22,7 +22,7 @@ beforeAll(async () => { }), ); applicationRoutes(app); - server = app.listen(9090); + server = app.listen(); }); afterAll(async () => { @@ -543,32 +543,10 @@ describe('Destination api tests', () => { }); describe('Source api tests', () => { - test('(shopify) successful source transform', async () => { - const data = getDataFromPath('./data_scenarios/source/v0/successful.json'); - const response = await request(server) - .post('/v0/sources/shopify') - .set('Accept', 'application/json') - .send(data.input); - const parsedResp = JSON.parse(response.text); - delete parsedResp[0].output.batch[0].anonymousId; - expect(response.status).toEqual(200); - expect(parsedResp).toEqual(data.output); - }); - - test('(shopify) failure source transform (shopify)', async () => { - const data = getDataFromPath('./data_scenarios/source/v0/failure.json'); - const response = await request(server) - .post('/v0/sources/shopify') - .set('Accept', 'application/json') - .send(data.input); - expect(response.status).toEqual(200); - expect(JSON.parse(response.text)).toEqual(data.output); - }); - test('(shopify) success source transform (monday)', async () => { - const data = getDataFromPath('./data_scenarios/source/v0/response_to_caller.json'); + const data = getDataFromPath('./data_scenarios/source/v2/response_to_caller.json'); const response = await request(server) - .post('/v0/sources/monday') + .post('/v2/sources/monday') .set('Accept', 'application/json') .send(data.input); expect(response.status).toEqual(200); diff --git a/test/integrations/common/criteo/network.ts b/test/integrations/common/criteo/network.ts index cd5e1ca1e81..b1ce915c86f 100644 --- a/test/integrations/common/criteo/network.ts +++ b/test/integrations/common/criteo/network.ts @@ -1,5 +1,6 @@ +import { defaultAccessTokenAuthHeader } from '../secrets'; const headers = { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', 'User-Agent': 'RudderLabs', diff --git a/test/integrations/common/secrets.ts b/test/integrations/common/secrets.ts new file mode 100644 index 00000000000..73d428a8f5c --- /dev/null +++ b/test/integrations/common/secrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; + +export const defaultAccessToken = path.basename(__dirname) + 'AccessToken'; +export const defaultApiKey = path.basename(__dirname) + 'ApiKey'; +export const defaultAccessTokenAuthHeader = `Bearer ${defaultAccessToken}`; diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index baad6813dfb..7bb69e064eb 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -7,23 +7,26 @@ import axios from 'axios'; import bodyParser from 'koa-bodyparser'; import { Command } from 'commander'; import { createHttpTerminator } from 'http-terminator'; -import { MockHttpCallsData, TestCaseData } from './testTypes'; +import { ExtendedTestCaseData, TestCaseData } from './testTypes'; import { applicationRoutes } from '../../src/routes/index'; import MockAxiosAdapter from 'axios-mock-adapter'; import { getTestDataFilePaths, getTestData, - getMockHttpCallsData, - getAllTestMockDataFilePaths, - addMock, + registerAxiosMocks, validateTestWithZOD, + getTestMockData, } from './testUtils'; import tags from '../../src/v0/util/tags'; import { Server } from 'http'; import { appendFileSync } from 'fs'; import { assertRouterOutput, responses } from '../testHelper'; -import { generateTestReport, initaliseReport } from '../test_reporter/reporter'; +import { initaliseReport } from '../test_reporter/reporter'; import _ from 'lodash'; +import defaultFeaturesConfig from '../../src/features'; +import { ControllerUtility } from '../../src/controllers/util'; +import { FetchHandler } from '../../src/helpers/fetchHandlers'; +import { enhancedTestUtils } from '../test_reporter/allureReporter'; // To run single destination test cases // npm run test:ts -- component --destination=adobe_analytics @@ -38,7 +41,7 @@ command .allowUnknownOption() .option('-d, --destination ', 'Enter Destination Name') .option('-f, --feature ', 'Enter Feature Name(processor, router)') - .option('-i, --index ', 'Enter Test index') + .option('-i, --index ', 'Enter Test index', parseInt) .option('-g, --generate ', 'Enter "true" If you want to generate network file') .option('-id, --id ', 'Enter unique "Id" of the test case you want to run') .option('-s, --source ', 'Enter Source Name') @@ -55,7 +58,13 @@ if (opts.generate === 'true') { let server: Server; -const INTEGRATIONS_WITH_UPDATED_TEST_STRUCTURE = ['klaviyo', 'campaign_manager', 'criteo_audience']; +const INTEGRATIONS_WITH_UPDATED_TEST_STRUCTURE = [ + 'active_campaign', + 'klaviyo', + 'campaign_manager', + 'criteo_audience', + 'branch', +]; beforeAll(async () => { initaliseReport(); @@ -70,6 +79,7 @@ beforeAll(async () => { }); afterAll(async () => { + await createHttpTerminator({ server }).terminate(); if (opts.generate === 'true') { const callsDataStr = responses.join('\n'); const calls = ` @@ -79,26 +89,7 @@ afterAll(async () => { `; appendFileSync(join(__dirname, 'destinations', opts.destination, 'network.ts'), calls); } - await createHttpTerminator({ server }).terminate(); }); -let mockAdapter; -if (!opts.generate || opts.generate === 'false') { - // unmock already existing axios-mocking - mockAdapter = new MockAxiosAdapter(axios, { onNoMatch: 'throwException' }); - const registerAxiosMocks = (axiosMocks: MockHttpCallsData[]) => { - axiosMocks.forEach((axiosMock) => addMock(mockAdapter, axiosMock)); - }; - - // // all the axios requests will be stored in this map - const allTestMockDataFilePaths = getAllTestMockDataFilePaths(__dirname, opts.destination); - const allAxiosRequests = allTestMockDataFilePaths - .map((currPath) => { - const mockNetworkCallsData: MockHttpCallsData[] = getMockHttpCallsData(currPath); - return mockNetworkCallsData; - }) - .flat(); - registerAxiosMocks(allAxiosRequests); -} // END const rootDir = __dirname; @@ -133,6 +124,21 @@ const testRoute = async (route, tcData: TestCaseData) => { .send(body); const outputResp = tcData.output.response || ({} as any); + expect(response.status).toEqual(outputResp.status); + + if (INTEGRATIONS_WITH_UPDATED_TEST_STRUCTURE.includes(tcData.name?.toLocaleLowerCase())) { + expect(validateTestWithZOD(tcData, response)).toEqual(true); + enhancedTestUtils.beforeTestRun(tcData); + enhancedTestUtils.afterTestRun(tcData, response.body); + } + + if (outputResp?.body) { + expect(response.body).toEqual(outputResp.body); + } + + if (outputResp.headers !== undefined) { + expect(response.headers).toEqual(outputResp.headers); + } if (tcData.feature === tags.FEATURES.BATCH || tcData.feature === tags.FEATURES.ROUTER) { //TODO get rid of these skipped destinations after they are fixed if ( @@ -148,27 +154,6 @@ const testRoute = async (route, tcData: TestCaseData) => { assertRouterOutput(response.body.output, tcData.input.request.body.input); } } - - expect(response.status).toEqual(outputResp.status); - - if (INTEGRATIONS_WITH_UPDATED_TEST_STRUCTURE.includes(tcData.name?.toLocaleLowerCase())) { - expect(validateTestWithZOD(tcData, response)).toEqual(true); - const bodyMatched = _.isEqual(response.body, outputResp.body); - const statusMatched = response.status === outputResp.status; - if (bodyMatched && statusMatched) { - generateTestReport(tcData, response.body, 'passed'); - } else { - generateTestReport(tcData, response.body, 'failed'); - } - } - - if (outputResp?.body) { - expect(response.body).toEqual(outputResp.body); - } - - if (outputResp.headers !== undefined) { - expect(response.headers).toEqual(outputResp.headers); - } }; const destinationTestHandler = async (tcData: TestCaseData) => { @@ -199,52 +184,89 @@ const destinationTestHandler = async (tcData: TestCaseData) => { await testRoute(route, tcData); }; -const sourceTestHandler = async (tcData) => { +const sourceTestHandler = async (tcData: TestCaseData) => { const route = `/${join( tcData.version || DEFAULT_VERSION, 'sources', tcData.name, - tcData.input.pathSuffix, + tcData.input.pathSuffix || '', )}`; await testRoute(route, tcData); }; -// Trigger the test suites -describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { - beforeEach(() => { - jest.resetAllMocks(); - jest.clearAllMocks(); - }); - // add special mocks for specific destinations - let testData: TestCaseData[] = getTestData(testDataPath); - if (opts.index !== undefined) { - testData = [testData[parseInt(opts.index)]]; - } - if (opts.id) { - testData = testData.filter((data) => { - if (data['id'] === opts.id) { - return true; +const mockAdapter = new MockAxiosAdapter(axios as any, { onNoMatch: 'throwException' }); +registerAxiosMocks(mockAdapter, getTestMockData(opts.destination || opts.source)); + +describe('Component Test Suite', () => { + if (allTestDataFilePaths.length === 0) { + // Reason: No test cases matched the given criteria + test.skip('No test cases provided. Skipping tests.', () => {}); + } else { + describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { + beforeEach(() => { + jest.resetAllMocks(); + jest.clearAllMocks(); + }); + let testData: TestCaseData[] = getTestData(testDataPath); + if (opts.index < testData.length && opts.index >= 0) { + testData = [testData[opts.index]]; } - return false; - }); - } - describe(`${testData[0].name} ${testData[0].module}`, () => { - test.each(testData)('$feature -> $description (index: $#)', async (tcData) => { - tcData?.mockFns?.(mockAdapter); - - switch (tcData.module) { - case tags.MODULES.DESTINATION: - await destinationTestHandler(tcData); - break; - case tags.MODULES.SOURCE: - await sourceTestHandler(tcData); - break; - default: - console.log('Invalid module'); - // Intentionally fail the test case - expect(true).toEqual(false); - break; + if (opts.id) { + testData = testData.filter((data) => data.id === opts.id); + } + + const extendedTestData: ExtendedTestCaseData[] = testData.flatMap((tcData) => { + if (tcData.module === tags.MODULES.SOURCE) { + return [ + { + tcData, + sourceTransformV2Flag: false, + descriptionSuffix: ' (sourceTransformV2Flag: false)', + }, + { + tcData, + sourceTransformV2Flag: true, + descriptionSuffix: ' (sourceTransformV2Flag: true)', + }, + ]; + } + return [{ tcData, descriptionSuffix: '' }]; + }); + if (extendedTestData.length === 0) { + // Reason: user may have skipped the test cases + test.skip('No test cases provided. Skipping tests.', () => {}); + } else { + describe(`${testData[0].name} ${testData[0].module}`, () => { + test.each(extendedTestData)( + '$tcData.feature -> $tcData.description$descriptionSuffix (index: $#)', + async ({ tcData, sourceTransformV2Flag }) => { + tcData?.mockFns?.(mockAdapter); + + switch (tcData.module) { + case tags.MODULES.DESTINATION: + await destinationTestHandler(tcData); + break; + case tags.MODULES.SOURCE: + tcData?.mockFns?.(mockAdapter); + testSetupSourceTransformV2(sourceTransformV2Flag); + await sourceTestHandler(tcData); + break; + default: + console.log('Invalid module'); + // Intentionally fail the test case + expect(true).toEqual(false); + break; + } + }, + ); + }); } }); - }); + } }); + +const testSetupSourceTransformV2 = (flag) => { + defaultFeaturesConfig.upgradedToSourceTransformV2 = flag; + ControllerUtility['sourceVersionMap'] = new Map(); + FetchHandler['sourceHandlerMap'] = new Map(); +}; diff --git a/test/integrations/destinations/accoil_analytics/maskedSecrets.ts b/test/integrations/destinations/accoil_analytics/maskedSecrets.ts new file mode 100644 index 00000000000..f1b1c5acae9 --- /dev/null +++ b/test/integrations/destinations/accoil_analytics/maskedSecrets.ts @@ -0,0 +1,8 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secretStaging1 = `stg_` + path.basename(__dirname) + 1; + +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':')}`; +export const authHeaderStaging1 = `Basic ${base64Convertor(secretStaging1 + ':')}`; diff --git a/test/integrations/destinations/accoil_analytics/processor/data.ts b/test/integrations/destinations/accoil_analytics/processor/data.ts new file mode 100644 index 00000000000..d0842cc447d --- /dev/null +++ b/test/integrations/destinations/accoil_analytics/processor/data.ts @@ -0,0 +1,1397 @@ +import { ProcessorTestData } from '../../../testTypes'; +import { Metadata } from '../../../../../src/types'; +import { authHeader1, authHeaderStaging1, secret1, secretStaging1 } from '../maskedSecrets'; + +const baseMetadata: Partial = { + destinationDefinitionId: 'default-dest-def', + destinationType: 'default-destination-type', + eventName: 'default-event', + eventType: 'default-type', + instanceId: 'default-instance', + jobId: 1, + jobRunId: 'default-job-run', + mergedTpConfig: {}, + messageId: 'default-message-id', + messageIds: ['default-message-id'], + namespace: 'default-namespace', + oauthAccessToken: 'default-token', + receivedAt: '2024-12-10T06:45:09.572Z', + recordId: {}, + rudderId: 'default-rudder-id', + sourceBatchId: 'default-batch', + sourceCategory: 'default-category', + sourceDefinitionId: 'default-source-def', + sourceId: 'default-source', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + sourceTpConfig: {}, + sourceType: 'default-source-type', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + transformationId: 'default-transform', + destinationId: 'default-destination', + workspaceId: 'default-workspace', +}; + +export const data: ProcessorTestData[] = [ + // Successful track + { + id: 'accoil-analytics-destination-processor-100', + name: 'accoil_analytics', + description: 'Successful track event', + scenario: 'Track event is received and processed', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: '1234567890', + event: 'Activated', + type: 'track', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://in.accoil.com/segment', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + type: 'track', + event: 'Activated', + userId: '1234567890', + timestamp: '2024-01-23T08:35:17.562Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + // Successful identify + { + id: 'accoil-analytics-destination-processor-200', + name: 'accoil_analytics', + description: 'Successful identify event', + scenario: 'Identify event is received and processed', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + type: 'identify', + traits: { + email: 'bobby@example.com', + name: 'Little Bobby', + role: 'admin', + createdAt: '2024-01-20T08:35:17.342Z', + accountStatus: 'trial', + }, + timestamp: '2024-01-20T08:35:17.342Z', + originalTimestamp: '2024-01-23T08:35:17.342Z', + sentAt: '2024-01-23T08:35:35.234Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://in.accoil.com/segment', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + userId: 'bobby', + type: 'identify', + traits: { + email: 'bobby@example.com', + name: 'Little Bobby', + role: 'admin', + createdAt: '2024-01-20T08:35:17.342Z', + accountStatus: 'trial', + }, + timestamp: '2024-01-20T08:35:17.342Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + // Successful group + { + id: 'accoil-analytics-destination-processor-300', + name: 'accoil_analytics', + description: 'Successful group event', + scenario: 'Group event is received and processed', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + groupId: 'bobbygroup', + type: 'group', + traits: { + name: 'Little Bobby Group', + createdAt: '2024-01-20T08:35:17.342Z', + status: 'paid', + mrr: '10.1', + plan: 'basic', + }, + timestamp: '2024-01-20T08:35:17.342Z', + originalTimestamp: '2024-01-23T08:35:17.342Z', + sentAt: '2024-01-23T08:35:35.234Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://in.accoil.com/segment', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + userId: 'bobby', + groupId: 'bobbygroup', + type: 'group', + traits: { + name: 'Little Bobby Group', + createdAt: '2024-01-20T08:35:17.342Z', + status: 'paid', + mrr: '10.1', + plan: 'basic', + }, + timestamp: '2024-01-20T08:35:17.342Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + // Successful page + { + id: 'accoil-analytics-destination-processor-400', + name: 'accoil_analytics', + description: 'Successful page event', + scenario: 'Page event is received and processed', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + type: 'page', + name: 'Account Details', + traits: { + name: 'Sub page: Configuration', + }, + timestamp: '2024-01-20T08:35:17.342Z', + originalTimestamp: '2024-01-23T08:35:17.342Z', + sentAt: '2024-01-23T08:35:35.234Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://in.accoil.com/segment', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + userId: 'bobby', + type: 'page', + name: 'Account Details', + timestamp: '2024-01-20T08:35:17.342Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + // Successful screen + { + id: 'accoil-analytics-destination-processor-500', + name: 'accoil_analytics', + description: 'Successful screen event', + scenario: 'Screen event is received and processed', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + type: 'screen', + name: 'Configuration', + traits: { + account: 'Bobby Account', + }, + timestamp: '2024-01-20T08:35:17.342Z', + originalTimestamp: '2024-01-23T08:35:17.342Z', + sentAt: '2024-01-23T08:35:35.234Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://in.accoil.com/segment', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + userId: 'bobby', + type: 'screen', + name: 'Configuration', + timestamp: '2024-01-20T08:35:17.342Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + // Verify sending to staging environment + { + id: 'accoil-analytics-destination-processor-600', + name: 'accoil_analytics', + description: 'Successful screen event: staging', + scenario: 'Screen event is received and processed for staging environment', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + type: 'screen', + name: 'Configuration', + traits: { + account: 'Bobby Account', + }, + timestamp: '2024-01-20T08:35:17.342Z', + originalTimestamp: '2024-01-23T08:35:17.342Z', + sentAt: '2024-01-23T08:35:35.234Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secretStaging1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://instaging.accoil.com/segment', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeaderStaging1, + }, + params: {}, + body: { + JSON: { + userId: 'bobby', + type: 'screen', + name: 'Configuration', + timestamp: '2024-01-20T08:35:17.342Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + + // Verify checking for invalid payloads (eg no apiKey, missing parts of message) + // Global validation + { + id: 'accoil-analytics-destination-processor-700', + name: 'accoil_analytics', + description: 'Missing required api key', + scenario: 'Event is rejected due to bad config', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: '1234567890', + event: 'Activated', + type: 'track', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiUrl: 'https://in.accoil.com/segment', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'apiKey must be supplied in destination config: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: apiKey must be supplied in destination config', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + id: 'accoil-analytics-destination-processor-701', + name: 'accoil_analytics', + description: 'Missing required timestamp', + scenario: 'Event is rejected due to missing timestamp', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: '1234567890', + event: 'Activated', + type: 'track', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'timestamp is required for all calls: Workflow: procWorkflow, Step: validateTimestamp, ChildStep: undefined, OriginalError: timestamp is required for all calls', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + // Track validation + { + id: 'accoil-analytics-destination-processor-800', + name: 'accoil_analytics', + description: 'Missing required event', + scenario: 'Event is rejected due to missing event', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: '1234567890', + type: 'track', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'event is required for track call: Workflow: procWorkflow, Step: validateTrackPayload, ChildStep: undefined, OriginalError: event is required for track call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + id: 'accoil-analytics-destination-processor-801', + name: 'accoil_analytics', + description: 'Missing required userId', + scenario: 'Event is rejected due to missing userId', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + event: 'event', + type: 'track', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'userId is required for track call: Workflow: procWorkflow, Step: validateTrackPayload, ChildStep: undefined, OriginalError: userId is required for track call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + // Page validation + { + id: 'accoil-analytics-destination-processor-900', + name: 'accoil_analytics', + description: 'Missing required name', + scenario: 'Event is rejected due to missing name', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + type: 'page', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'name is required for page call: Workflow: procWorkflow, Step: validatePagePayload, ChildStep: undefined, OriginalError: name is required for page call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + id: 'accoil-analytics-destination-processor-901', + name: 'accoil_analytics', + description: 'Missing required userId', + scenario: 'Event is rejected due to missing userId', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + name: 'Page name', + type: 'page', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'userId is required for page call: Workflow: procWorkflow, Step: validatePagePayload, ChildStep: undefined, OriginalError: userId is required for page call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + // Validate screen + { + id: 'accoil-analytics-destination-processor-1000', + name: 'accoil_analytics', + description: 'Missing required name', + scenario: 'Event is rejected due to missing name', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + type: 'screen', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'name is required for screen call: Workflow: procWorkflow, Step: validateScreenPayload, ChildStep: undefined, OriginalError: name is required for screen call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + id: 'accoil-analytics-destination-processor-1001', + name: 'accoil_analytics', + description: 'Missing required userId', + scenario: 'Event is rejected due to missing userId', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + name: 'screen name', + type: 'screen', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'userId is required for screen call: Workflow: procWorkflow, Step: validateScreenPayload, ChildStep: undefined, OriginalError: userId is required for screen call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + // Identify validate + { + id: 'accoil-analytics-destination-processor-1100', + name: 'accoil_analytics', + description: 'Missing required userId', + scenario: 'Event is rejected due to missing userId', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + type: 'identify', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'userId is required for identify call: Workflow: procWorkflow, Step: validateIdentifyPayload, ChildStep: undefined, OriginalError: userId is required for identify call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + // Group validate + { + id: 'accoil-analytics-destination-processor-1200', + name: 'accoil_analytics', + description: 'Missing required userId', + scenario: 'Event is rejected due to missing userId', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + type: 'group', + groupId: 'group1', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'userId is required for group call: Workflow: procWorkflow, Step: validateGroupPayload, ChildStep: undefined, OriginalError: userId is required for group call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + id: 'accoil-analytics-destination-processor-1201', + name: 'accoil_analytics', + description: 'Missing required groupId', + scenario: 'Event is rejected due to missing groupId', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'user', + type: 'group', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'groupId is required for group call: Workflow: procWorkflow, Step: validateGroupPayload, ChildStep: undefined, OriginalError: groupId is required for group call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/accoil_analytics/router/data.ts b/test/integrations/destinations/accoil_analytics/router/data.ts new file mode 100644 index 00000000000..6b9e1949add --- /dev/null +++ b/test/integrations/destinations/accoil_analytics/router/data.ts @@ -0,0 +1,471 @@ +import { RouterTestData } from '../../../testTypes'; +import { authHeader1, authHeaderStaging1, secret1, secretStaging1 } from '../maskedSecrets'; + +export const data: RouterTestData[] = [ + { + id: 'accoil-analytics-destination-router-100', + name: 'accoil_analytics', + description: 'Router batch request', + scenario: 'Scenario which tests for a successful batch request', + successCriteria: 'Router test should pass successfully', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + Config: { + apiKey: secret1, + }, + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + message: { + userId: 'user-uuid', + event: 'User Signed Up', + type: 'track', + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + }, + { + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + Config: { + apiKey: secret1, + }, + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + message: { + userId: 'user-uuid', + event: 'User Deleted account', + type: 'track', + messageId: '8bc79b03-2a5c-4615-b2da-54c0aaaaaae8', + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + }, + { + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + Config: { + apiKey: secretStaging1, + }, + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + message: { + userId: 'user-uuid', + event: 'User Deleted account', + type: 'track', + messageId: '8bc79b03-2a5c-4615-b2da-54c0aaaaaae8', + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 3, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + }, + ], + destType: 'accoil_analytics', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + body: { + FORM: {}, + JSON_ARRAY: {}, + XML: {}, + JSON: { + userId: 'user-uuid', + type: 'track', + event: 'User Signed Up', + timestamp: '2024-01-23T08:35:17.562Z', + }, + }, + endpoint: 'https://in.accoil.com/segment', + files: {}, + params: {}, + type: 'REST', + version: '1', + method: 'POST', + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + }, + }, + batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], + statusCode: 200, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + Config: { + apiKey: secret1, + }, + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + { + batchedRequest: { + body: { + FORM: {}, + JSON_ARRAY: {}, + XML: {}, + JSON: { + userId: 'user-uuid', + type: 'track', + event: 'User Deleted account', + timestamp: '2024-01-23T08:35:17.562Z', + }, + }, + endpoint: 'https://in.accoil.com/segment', + files: {}, + params: {}, + type: 'REST', + version: '1', + method: 'POST', + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + }, + }, + batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], + statusCode: 200, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + Config: { + apiKey: secret1, + }, + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + { + batchedRequest: { + body: { + FORM: {}, + JSON_ARRAY: {}, + XML: {}, + JSON: { + userId: 'user-uuid', + type: 'track', + event: 'User Deleted account', + timestamp: '2024-01-23T08:35:17.562Z', + }, + }, + endpoint: 'https://instaging.accoil.com/segment', + files: {}, + params: {}, + type: 'REST', + version: '1', + method: 'POST', + headers: { + Authorization: authHeaderStaging1, + 'Content-Type': 'application/json', + }, + }, + batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 3, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], + statusCode: 200, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + Config: { + apiKey: secretStaging1, + }, + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/active_campaign/network.ts b/test/integrations/destinations/active_campaign/network.ts index 34834096b19..7ccd5fea4e9 100644 --- a/test/integrations/destinations/active_campaign/network.ts +++ b/test/integrations/destinations/active_campaign/network.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../common/secrets'; + export const networkCallsData = [ { httpReq: { @@ -565,7 +567,7 @@ export const networkCallsData = [ }, }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -638,7 +640,7 @@ export const networkCallsData = [ httpReq: { data: { contactList: { contact: '2', list: 2, status: '1' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -652,7 +654,7 @@ export const networkCallsData = [ httpReq: { data: { contactList: { contact: '2', list: 3, status: '2' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -664,7 +666,7 @@ export const networkCallsData = [ }, { httpReq: { - headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': 'dummyApiKey' }, + headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': defaultApiKey }, method: 'GET', @@ -807,7 +809,7 @@ export const networkCallsData = [ }, }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -879,7 +881,7 @@ export const networkCallsData = [ { httpReq: { headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -956,7 +958,7 @@ export const networkCallsData = [ httpReq: { data: { tag: { description: '', tag: 'Test_User', tagType: 'contact' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1037,7 +1039,7 @@ export const networkCallsData = [ httpReq: { data: { tag: { description: '', tag: 'Interested_User', tagType: 'contact' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1118,7 +1120,7 @@ export const networkCallsData = [ httpReq: { data: { contactTag: { contact: '2', tag: '5' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1143,7 +1145,7 @@ export const networkCallsData = [ httpReq: { data: { contactTag: { contact: '2', tag: 6 } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1168,7 +1170,7 @@ export const networkCallsData = [ httpReq: { data: { contactTag: { contact: '2', tag: 7 } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1193,7 +1195,7 @@ export const networkCallsData = [ httpReq: { data: { contactList: { contact: '2', list: 2, status: '1' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1207,7 +1209,7 @@ export const networkCallsData = [ httpReq: { data: { contactList: { contact: '2', list: 3, status: '2' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1219,7 +1221,7 @@ export const networkCallsData = [ }, { httpReq: { - headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': 'dummyApiKey' }, + headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': defaultApiKey }, method: 'GET', @@ -1354,7 +1356,7 @@ export const networkCallsData = [ { httpReq: { headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1375,7 +1377,7 @@ export const networkCallsData = [ httpReq: { data: { eventTrackingEvent: { name: 'ScreenViewed' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1387,7 +1389,7 @@ export const networkCallsData = [ }, { httpReq: { - headers: { 'Api-Token': 'dummyApiKey', Accept: 'application/json, text/plain, */*' }, + headers: { 'Api-Token': defaultApiKey, Accept: 'application/json, text/plain, */*' }, method: 'GET', @@ -1405,7 +1407,7 @@ export const networkCallsData = [ httpReq: { data: { eventTrackingEvent: { name: 'Tracking Action' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1419,7 +1421,7 @@ export const networkCallsData = [ httpReq: { data: { contact: { email: 'jamesDoe@gmail.com', phone: '92374162212' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1491,7 +1493,7 @@ export const networkCallsData = [ { httpReq: { headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1568,7 +1570,7 @@ export const networkCallsData = [ httpReq: { data: { tag: { description: '', tag: 'Test_User', tagType: 'contact' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1649,7 +1651,7 @@ export const networkCallsData = [ httpReq: { data: { tag: { description: '', tag: 'Interested_User', tagType: 'contact' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1730,7 +1732,7 @@ export const networkCallsData = [ httpReq: { data: { contactTag: { contact: '2', tag: '5' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1755,7 +1757,7 @@ export const networkCallsData = [ httpReq: { data: { contactTag: { contact: '2', tag: 11 } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1780,7 +1782,7 @@ export const networkCallsData = [ httpReq: { data: { contactTag: { contact: '2', tag: 12 } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1805,7 +1807,7 @@ export const networkCallsData = [ httpReq: { data: { contactList: { contact: '2', list: 2, status: '1' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1819,7 +1821,7 @@ export const networkCallsData = [ httpReq: { data: { contactList: { contact: '2', list: 3, status: '2' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1831,7 +1833,7 @@ export const networkCallsData = [ }, { httpReq: { - headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': 'dummyApiKey' }, + headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': defaultApiKey }, method: 'GET', diff --git a/test/integrations/destinations/active_campaign/processor/data.ts b/test/integrations/destinations/active_campaign/processor/data.ts index cef8c2a3a80..06393dfe43f 100644 --- a/test/integrations/destinations/active_campaign/processor/data.ts +++ b/test/integrations/destinations/active_campaign/processor/data.ts @@ -1,25 +1,64 @@ +/** + * Auto-migrated and optimized test cases + * Generated on: 2024-12-10T06:45:10.187Z + */ + +import { ProcessorTestData } from '../../../testTypes'; +import { Metadata } from '../../../../../src/types'; import MockAdapter from 'axios-mock-adapter'; import { isMatch } from 'lodash'; +import { defaultApiKey } from '../../../common/secrets'; + +const baseMetadata: Partial = { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-10T06:45:09.572Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, +}; -export const data = [ +export const data: ProcessorTestData[] = [ { + id: 'processor-1733813110185', name: 'active_campaign', - description: 'Test 0', + description: 'Test 0: Indetify scenario which tests the happy path of creating a contact', + scenario: + 'The contact is created successfully with all the fields info , a test tag is also added and the contact is subscribe to to list 2 and unsubscribed from list 3 and an invalid operation is performed on list 3', + successCriteria: 'Processor test should pass successfully, and the contact should be created', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', messageId: '84e26acc-56a5-4835-8233-591137fca468', @@ -42,9 +81,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -54,12 +102,36 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: defaultApiKey, + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -74,7 +146,7 @@ export const data = [ endpoint: 'https://active.campaigns.rudder.com/api/3/contact/sync', headers: { 'Content-Type': 'application/json', - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, }, params: {}, body: { @@ -85,10 +157,22 @@ export const data = [ firstName: 'James', lastName: 'Doe', fieldValues: [ - { field: '0', value: 'Trastkiv' }, - { field: '1', value: 'Russia' }, - { field: '3', value: '||Potato||Onion||' }, - { field: '4', value: 'random' }, + { + field: '0', + value: 'Trastkiv', + }, + { + field: '1', + value: 'Russia', + }, + { + field: '3', + value: '||Potato||Onion||', + }, + { + field: '4', + value: 'random', + }, ], }, }, @@ -99,6 +183,7 @@ export const data = [ files: {}, userId: '', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -106,23 +191,21 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 0', + description: + 'Test 1: Identify scenario which tests the happy path of creating a contact with multiple tags', + scenario: + 'Identify scenario which tests the happy path of creating a contact with all fields info and multiple tags and the contact is subscribed to list 2 and unsubscribed from list 3 and an invalid operation is performed on list 3', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', messageId: '84e26acc-56a5-4835-8233-591137fca468', @@ -145,9 +228,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -157,12 +249,36 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: defaultApiKey, + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -177,7 +293,7 @@ export const data = [ endpoint: 'https://active.campaigns.rudder.com/api/3/contact/sync', headers: { 'Content-Type': 'application/json', - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, }, params: {}, body: { @@ -188,10 +304,22 @@ export const data = [ firstName: 'James', lastName: 'Doe', fieldValues: [ - { field: '0', value: 'Trastkiv' }, - { field: '1', value: 'Russia' }, - { field: '3', value: '||Potato||Onion||' }, - { field: '4', value: 'random' }, + { + field: '0', + value: 'Trastkiv', + }, + { + field: '1', + value: 'Russia', + }, + { + field: '3', + value: '||Potato||Onion||', + }, + { + field: '4', + value: 'random', + }, ], }, }, @@ -202,6 +330,7 @@ export const data = [ files: {}, userId: '', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -209,128 +338,49 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 1', + description: 'Test 2: Page scenario which tests the happy path of tracking a page view', + scenario: 'Scenario which tests the happy path of tracking a page view', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', context: { - page: { referring_domain: 'https://www.rudderlabs.com' }, + page: { + referring_domain: 'https://www.rudderlabs.com', + }, app: { build: '1.0.0', name: 'RudderLabs JavaScript SDK', namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - traits: { email: 'jamesDoe@gmail.com', anonymousId: '12345' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { name: '', version: '' }, - screen: { density: 2 }, - }, - request_ip: '1.1.1.1', - type: 'page', - messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', - session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', - originalTimestamp: '2019-10-14T11:15:18.299Z', - anonymousId: '00000000000000000000000000', - userId: '12345', - properties: { - name: 'ApplicationLoaded', - path: '/test', - referrer: 'Rudder', - search: 'abc', - title: 'Test Page', - url: 'https://www.rudderlabs.com', - }, - integrations: { All: true }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - }, - ], - method: 'POST', - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - body: { - XML: {}, - FORM: {}, - JSON_ARRAY: {}, - JSON: { siteTrackingDomain: { name: 'rudderlabs.com' } }, - }, - type: 'REST', - files: {}, - method: 'POST', - params: {}, - headers: { - 'Api-Token': 'dummyApiKey', - 'Content-Type': 'application/json', - }, - version: '1', - endpoint: 'https://active.campaigns.rudder.com/api/3/siteTrackingDomains', - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'active_campaign', - description: 'Test 2', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', + traits: { + email: 'jamesDoe@gmail.com', + anonymousId: '12345', + }, + library: { name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - traits: { email: 'jamesDoe@gmail.com', anonymousId: '12345' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, request_ip: '1.1.1.1', type: 'page', @@ -347,101 +397,36 @@ export const data = [ title: 'Test Page', url: 'https://www.rudderlabs.com', }, - integrations: { All: true }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - }, - ], - method: 'POST', - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - body: { - XML: {}, - FORM: {}, - JSON_ARRAY: {}, - JSON: { siteTrackingDomain: { name: 'rudderlabs.com' } }, - }, - type: 'REST', - files: {}, - method: 'POST', - params: {}, - headers: { - 'Api-Token': 'dummyApiKey', - 'Content-Type': 'application/json', + integrations: { + All: true, }, - version: '1', - endpoint: 'https://active.campaigns.rudder.com/api/3/siteTrackingDomains', - userId: '', + sentAt: '2019-10-14T11:15:53.296Z', }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'active_campaign', - description: 'Test 3', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { + metadata: baseMetadata, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', }, - }, - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { email: 'jamesDoe@gmail.com', anonymousId: '12345' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { name: '', version: '' }, - screen: { density: 2 }, - }, - request_ip: '1.1.1.1', - type: 'page', - messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', - session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', - originalTimestamp: '2019-10-14T11:15:18.299Z', - anonymousId: '00000000000000000000000000', - userId: '12345', - properties: { - name: 'ApplicationLoaded', - path: '/test', - referrer: 'Rudder', - referring_domain: 'https://www.rudderlabs.com', - search: 'abc', - title: 'Test Page', - url: 'https://www.rudderlabs.com', - }, - integrations: { All: true }, - sentAt: '2019-10-14T11:15:53.296Z', + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, ], - method: 'POST', }, }, output: { @@ -454,20 +439,25 @@ export const data = [ XML: {}, FORM: {}, JSON_ARRAY: {}, - JSON: { siteTrackingDomain: { name: 'rudderlabs.com' } }, + JSON: { + siteTrackingDomain: { + name: 'rudderlabs.com', + }, + }, }, type: 'REST', files: {}, method: 'POST', params: {}, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, version: '1', endpoint: 'https://active.campaigns.rudder.com/api/3/siteTrackingDomains', userId: '', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -475,23 +465,21 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 4', + description: + 'Test 3: Screen event scenario which tests the happy path of tracking a screen view', + scenario: + 'Screen event scenario which tests the happy path of tracking a screen viewn the email field is passed in the visit field for the destination and the properties name is passed in the eventdata field the event is ScreenViewed', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', context: { @@ -501,13 +489,24 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - traits: { email: 'jamesDoe@gmail.com', anonymousId: '12345' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + traits: { + email: 'jamesDoe@gmail.com', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, request_ip: '1.1.1.1', type: 'screen', @@ -525,12 +524,36 @@ export const data = [ name: 'Rudder_Event_Screen_Test', }, event: 'ScreenViewed', - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T11:15:53.296Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: defaultApiKey, + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -556,13 +579,14 @@ export const data = [ method: 'POST', params: {}, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/x-www-form-urlencoded', }, version: '1', endpoint: 'https://trackcmp.net/event', userId: '', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -570,23 +594,20 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 5', + description: 'Test 4: Track event scenario which tests the happy path of tracking an event', + scenario: + 'Track event scenraio where the event name is Tracking Action and the properties name is Rudder_Event_Track_Test', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', context: { @@ -596,26 +617,60 @@ export const data = [ model: 'Redmi 6', name: 'xiaomi', }, - network: { carrier: 'Banglalink' }, - os: { name: 'android', version: '8.1.0' }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, traits: { email: 'jamesDoe@gmail.com', - address: { city: 'Dhaka', country: 'Bangladesh' }, + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', }, }, event: 'Tracking Action', - integrations: { All: true }, + integrations: { + All: true, + }, message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { name: 'Rudder_Event_Track_Test' }, + properties: { + name: 'Rudder_Event_Track_Test', + }, userId: 'test_user_id', timestamp: '2019-09-01T15:46:51.693Z', originalTimestamp: '2019-09-01T15:46:51.693Z', type: 'track', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: defaultApiKey, + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -641,13 +696,14 @@ export const data = [ method: 'POST', params: {}, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/x-www-form-urlencoded', }, version: '1', endpoint: 'https://trackcmp.net/event', userId: '', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -655,23 +711,20 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 6', + description: + 'Test 5: Identify scenario which tests the happy path of creating/updating a contact with all fields info', + scenario: 'Scneario is exactly same as Test 0', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', context: { @@ -681,13 +734,21 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, messageId: '84e26acc-56a5-4835-8233-591137fca468', session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', @@ -707,9 +768,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -719,12 +789,36 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: defaultApiKey, + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -742,10 +836,22 @@ export const data = [ email: 'jamesDoe@gmail.com', phone: '92374162212', fieldValues: [ - { field: '0', value: 'Trastkiv' }, - { field: '1', value: 'Russia' }, - { field: '3', value: '||Potato||Onion||' }, - { field: '4', value: 'random' }, + { + field: '0', + value: 'Trastkiv', + }, + { + field: '1', + value: 'Russia', + }, + { + field: '3', + value: '||Potato||Onion||', + }, + { + field: '4', + value: 'random', + }, ], }, }, @@ -755,39 +861,36 @@ export const data = [ method: 'POST', params: {}, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, version: '1', endpoint: 'https://active.campaigns.rudder.com/api/3/contact/sync', userId: '', }, + metadata: baseMetadata, statusCode: 200, }, ], }, }, }, - { + id: 'processor-1733813110186', name: 'active_campaign', description: - 'Test 7: node error(ECONNABORTED) where there is no response coming from dest. server', + 'Test 6: node error(ECONNABORTED) where there is no response coming from dest. server', + scenario: + 'Scenario which tests the failure case where there is no response from the destination server', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.dumber.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', context: { @@ -797,13 +900,21 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, messageId: '84e26acc-56a5-4835-8233-591137fca468', session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', @@ -823,9 +934,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -835,12 +955,36 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: defaultApiKey, + apiUrl: 'https://active.campaigns.dumber.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -848,17 +992,20 @@ export const data = [ status: 200, body: [ { + metadata: baseMetadata, + statusCode: 500, error: '{"message":"Failed to create new contact (undefined,\\"[ECONNABORTED] :: Connection aborted\\")","destinationResponse":"[ECONNABORTED] :: Connection aborted"}', statTags: { destType: 'ACTIVE_CAMPAIGN', + destinationId: 'default-destination', errorCategory: 'network', errorType: 'retryable', feature: 'processor', implementation: 'native', module: 'destination', + workspaceId: 'default-workspace', }, - statusCode: 500, }, ], }, @@ -880,7 +1027,7 @@ export const data = [ { asymmetricMatch: (actual) => { return isMatch(actual, { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }); }, @@ -890,23 +1037,20 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 8: erreneous response from active_campaign server(5xx)', + description: 'Test 7: erreneous response from active_campaign server(5xx)', + scenario: + 'Scenario which tests the failure case where the destination server returns a 5xx error', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.dumber2.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', context: { @@ -916,13 +1060,21 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, messageId: '84e26acc-56a5-4835-8233-591137fca468', session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', @@ -942,9 +1094,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -954,12 +1115,36 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: defaultApiKey, + apiUrl: 'https://active.campaigns.dumber2.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -967,17 +1152,20 @@ export const data = [ status: 200, body: [ { + metadata: baseMetadata, + statusCode: 504, error: '{"message":"Failed to create new contact (undefined,\\"\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n \\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\naccurx.api-us1.com | 504: Gateway time-out\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n
\\\\\\\\n
\\\\\\\\n
\\\\\\\\n

\\\\\\\\n Gateway time-out\\\\\\\\n Error code 504\\\\\\\\n

\\\\\\\\n
\\\\\\\\n Visit cloudflare.com for more information.\\\\\\\\n
\\\\\\\\n
2023-12-06 10:33:27 UTC
\\\\\\\\n
\\\\\\\\n
\\\\\\\\n
\\\\\\\\n
\\\\\\\\n \\\\\\\\n
\\\\\\\\n
\\\\\\\\n \\\\\\\\n \\\\\\\\n \\\\\\\\n \\\\\\\\n
\\\\\\\\n You\\\\\\\\n

\\\\\\\\n \\\\\\\\n Browser\\\\\\\\n \\\\\\\\n

\\\\\\\\n Working\\\\\\\\n
\\\\\\\\n\\\\\\\\n
\\\\\\\\n
\\\\\\\\n \\\\\\\\n \\\\\\\\n \\\\\\\\n \\\\\\\\n
\\\\\\\\n Frankfurt\\\\\\\\n

\\\\\\\\n \\\\\\\\n Cloudflare\\\\\\\\n \\\\\\\\n

\\\\\\\\n Working\\\\\\\\n
\\\\\\\\n\\\\\\\\n
\\\\\\\\n
\\\\\\\\n \\\\\\\\n \\\\\\\\n \\\\\\\\n \\\\\\\\n
\\\\\\\\n accurx.api-us1.com\\\\\\\\n

\\\\\\\\n \\\\\\\\n Host\\\\\\\\n \\\\\\\\n

\\\\\\\\n Error\\\\\\\\n
\\\\\\\\n\\\\\\\\n
\\\\\\\\n
\\\\\\\\n
\\\\\\\\n\\\\\\\\n
\\\\\\\\n
\\\\\\\\n
\\\\\\\\n

What happened?

\\\\\\\\n

The web server reported a gateway time-out error.

\\\\\\\\n
\\\\\\\\n
\\\\\\\\n

What can I do?

\\\\\\\\n

Please try again in a few minutes.

\\\\\\\\n
\\\\\\\\n
\\\\\\\\n
\\\\\\\\n\\\\\\\\n \\\\\\\\n\\\\\\\\n\\\\\\\\n
\\\\\\\\n
\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\")\\")","destinationResponse":"\\\\n\\\\n\\\\n\\\\n \\\\n\\\\n\\\\n\\\\naccurx.api-us1.com | 504: Gateway time-out\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n
\\\\n
\\\\n
\\\\n

\\\\n Gateway time-out\\\\n Error code 504\\\\n

\\\\n
\\\\n Visit cloudflare.com for more information.\\\\n
\\\\n
2023-12-06 10:33:27 UTC
\\\\n
\\\\n
\\\\n
\\\\n
\\\\n \\\\n
\\\\n
\\\\n \\\\n \\\\n \\\\n \\\\n
\\\\n You\\\\n

\\\\n \\\\n Browser\\\\n \\\\n

\\\\n Working\\\\n
\\\\n\\\\n
\\\\n
\\\\n \\\\n \\\\n \\\\n \\\\n
\\\\n Frankfurt\\\\n

\\\\n \\\\n Cloudflare\\\\n \\\\n

\\\\n Working\\\\n
\\\\n\\\\n
\\\\n
\\\\n \\\\n \\\\n \\\\n \\\\n
\\\\n accurx.api-us1.com\\\\n

\\\\n \\\\n Host\\\\n \\\\n

\\\\n Error\\\\n
\\\\n\\\\n
\\\\n
\\\\n
\\\\n\\\\n
\\\\n
\\\\n
\\\\n

What happened?

\\\\n

The web server reported a gateway time-out error.

\\\\n
\\\\n
\\\\n

What can I do?

\\\\n

Please try again in a few minutes.

\\\\n
\\\\n
\\\\n
\\\\n\\\\n \\\\n\\\\n\\\\n
\\\\n
\\\\n\\\\n\\\\n\\")"}', statTags: { destType: 'ACTIVE_CAMPAIGN', + destinationId: 'default-destination', errorCategory: 'network', errorType: 'retryable', feature: 'processor', implementation: 'native', module: 'destination', + workspaceId: 'default-workspace', }, - statusCode: 504, }, ], }, @@ -999,7 +1187,7 @@ export const data = [ { asymmetricMatch: (actual) => { return isMatch(actual, { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }); }, @@ -1010,29 +1198,25 @@ export const data = [ '\\n\\n\\n\\n \\n\\n\\n\\naccurx.api-us1.com | 504: Gateway time-out\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
\\n
\\n
\\n

\\n Gateway time-out\\n Error code 504\\n

\\n
\\n Visit cloudflare.com for more information.\\n
\\n
2023-12-06 10:33:27 UTC
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n \\n \\n \\n \\n
\\n You\\n

\\n \\n Browser\\n \\n

\\n Working\\n
\\n\\n
\\n
\\n \\n \\n \\n \\n
\\n Frankfurt\\n

\\n \\n Cloudflare\\n \\n

\\n Working\\n
\\n\\n
\\n
\\n \\n \\n \\n \\n
\\n accurx.api-us1.com\\n

\\n \\n Host\\n \\n

\\n Error\\n
\\n\\n
\\n
\\n
\\n\\n
\\n
\\n
\\n

What happened?

\\n

The web server reported a gateway time-out error.

\\n
\\n
\\n

What can I do?

\\n

Please try again in a few minutes.

\\n
\\n
\\n
\\n\\n \\n\\n\\n
\\n
\\n\\n\\n")', { Accept: 'application/json, text/plain, */*', - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, }, ); }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 9: erreneous response from active_campaign server(4xx)', + description: 'Test 8: erreneous response from active_campaign server(4xx)', + scenario: 'Scenrio which tests the processor when the active_campaign server returns 4xx error', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.dumber2.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', context: { @@ -1042,13 +1226,21 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, messageId: '84e26acc-56a5-4835-8233-591137fca468', session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', @@ -1068,9 +1260,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -1080,12 +1281,36 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: defaultApiKey, + apiUrl: 'https://active.campaigns.dumber2.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -1093,17 +1318,20 @@ export const data = [ status: 200, body: [ { + metadata: baseMetadata, + statusCode: 422, error: '{"message":"Failed to create new contact (undefined,{\\"errors\\":[{\\"title\\":\\"Contact Email Address is not valid.\\",\\"detail\\":\\"\\",\\"code\\":\\"email_invalid\\",\\"error\\":\\"must_be_valid_email_address\\",\\"source\\":{\\"pointer\\":\\"/data/attributes/email\\"}}]})","destinationResponse":{"errors":[{"title":"Contact Email Address is not valid.","detail":"","code":"email_invalid","error":"must_be_valid_email_address","source":{"pointer":"/data/attributes/email"}}]}}', statTags: { destType: 'ACTIVE_CAMPAIGN', + destinationId: 'default-destination', errorCategory: 'network', errorType: 'aborted', feature: 'processor', implementation: 'native', module: 'destination', + workspaceId: 'default-workspace', }, - statusCode: 422, }, ], }, @@ -1125,7 +1353,7 @@ export const data = [ { asymmetricMatch: (actual) => { return isMatch(actual, { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }); }, @@ -1148,7 +1376,7 @@ export const data = [ }, { Accept: 'application/json, text/plain, */*', - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, }, ); }, diff --git a/test/integrations/destinations/active_campaign/router/data.ts b/test/integrations/destinations/active_campaign/router/data.ts index a73140c161c..148e330b189 100644 --- a/test/integrations/destinations/active_campaign/router/data.ts +++ b/test/integrations/destinations/active_campaign/router/data.ts @@ -1,7 +1,18 @@ -export const data = [ +/** + * Auto-migrated and optimized test cases + * Generated on: 2024-12-06T12:28:59.200Z + */ + +import { RouterTestData } from '../../../testTypes'; +import {} from '../../../../../src/types'; + +export const data: RouterTestData[] = [ { + id: 'router-1733488139199', name: 'active_campaign', - description: 'Test 0', + description: 'Test 0: Successful identify event', + scenario: 'Scenario which tests for a successful identify event', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -10,15 +21,6 @@ export const data = [ body: { input: [ { - destination: { - Config: { - apiKey: 'dummyApiToken', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, - metadata: { jobId: 2, userId: 'u1' }, message: { channel: 'web', context: { @@ -28,13 +30,21 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, messageId: '84e26acc-56a5-4835-8233-591137fca468', session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', @@ -56,9 +66,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -68,9 +87,66 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: 'dummyApiToken', + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], destType: 'active_campaign', @@ -96,10 +172,22 @@ export const data = [ lastName: 'Doe', phone: '92374162212', fieldValues: [ - { field: '0', value: 'Trastkiv' }, - { field: '1', value: 'Russia' }, - { field: '3', value: '||Potato||Onion||' }, - { field: '4', value: 'random' }, + { + field: '0', + value: 'Trastkiv', + }, + { + field: '1', + value: 'Russia', + }, + { + field: '3', + value: '||Potato||Onion||', + }, + { + field: '4', + value: 'random', + }, ], }, }, @@ -108,21 +196,72 @@ export const data = [ files: {}, method: 'POST', params: {}, - headers: { 'Api-Token': 'dummyApiToken', 'Content-Type': 'application/json' }, + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, version: '1', endpoint: 'https://active.campaigns.rudder.com/api/3/contact/sync', }, - metadata: [{ jobId: 2, userId: 'u1' }], - batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: 'dummyApiToken', apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: false, }, ], }, @@ -130,8 +269,11 @@ export const data = [ }, }, { + id: 'router-1733488139199', name: 'active_campaign', - description: 'Test 1', + description: 'Test 1: Test case for a successful page event', + scenario: 'Scenario which tests for a successful page event', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -140,15 +282,6 @@ export const data = [ body: { input: [ { - destination: { - Config: { - apiKey: 'dummyApiToken', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, - metadata: { jobId: 2, userId: 'u1' }, message: { channel: 'web', context: { @@ -158,13 +291,24 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - traits: { email: 'jamesDoe@gmail.com', anonymousId: '12345' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + traits: { + email: 'jamesDoe@gmail.com', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, request_ip: '1.1.1.1', type: 'page', @@ -181,9 +325,66 @@ export const data = [ title: 'Test Page', url: 'https://www.rudderlabs.com', }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T11:15:53.296Z', }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: 'dummyApiToken', + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], destType: 'active_campaign', @@ -202,27 +403,82 @@ export const data = [ XML: {}, FORM: {}, JSON_ARRAY: {}, - JSON: { siteTrackingDomain: { name: 'rudderlabs.com' } }, + JSON: { + siteTrackingDomain: { + name: 'rudderlabs.com', + }, + }, }, type: 'REST', files: {}, method: 'POST', params: {}, - headers: { 'Api-Token': 'dummyApiToken', 'Content-Type': 'application/json' }, + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, version: '1', endpoint: 'https://active.campaigns.rudder.com/api/3/siteTrackingDomains', }, - metadata: [{ jobId: 2, userId: 'u1' }], - batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: 'dummyApiToken', apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: false, }, ], }, @@ -230,8 +486,11 @@ export const data = [ }, }, { + id: 'router-1733488139199', name: 'active_campaign', - description: 'Test 2', + description: 'Test 2: Page event with invalid URL', + scenario: 'Scenario which tests for a page event with invalid URL', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -246,7 +505,10 @@ export const data = [ sentAt: '2023-01-10T22:31:10.954Z', channel: 'web', context: { - os: { name: '', version: '' }, + os: { + name: '', + version: '', + }, app: { name: 'RudderLabs JavaScript SDK', build: '1.0.0', @@ -273,7 +535,10 @@ export const data = [ innerHeight: 782, }, traits: {}, - library: { name: 'RudderLabs JavaScript SDK', version: '2.20.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '2.20.0', + }, campaign: {}, sessionId: 1673389635049, userAgent: @@ -297,18 +562,66 @@ export const data = [ receivedAt: '2023-01-10T22:31:11.612Z', request_ip: '0.0.0.20', anonymousId: '878e8f5f-9b6c-4aef-b5d3-1b970a13f17a', - integrations: { All: true }, + integrations: { + All: true, + }, originalTimestamp: '2023-01-10T22:31:10.943Z', }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 5, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: 'dummyApiToken', apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: { jobId: 5, userId: 'u1' }, }, ], destType: 'active_campaign', @@ -322,25 +635,75 @@ export const data = [ body: { output: [ { - error: 'Invalid URL: url', - statTags: { - destType: 'ACTIVE_CAMPAIGN', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'router', - implementation: 'native', - module: 'destination', - }, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 5, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], statusCode: 400, - metadata: [{ jobId: 5, userId: 'u1' }], - batched: false, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: 'dummyApiToken', apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + batched: false, + error: 'Invalid URL: url', + statTags: { + destType: 'ACTIVE_CAMPAIGN', + destinationId: 'default-destination', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspace', }, }, ], diff --git a/test/integrations/destinations/adj/processor/data.ts b/test/integrations/destinations/adj/processor/data.ts index e28a25cf59d..310a644fa73 100644 --- a/test/integrations/destinations/adj/processor/data.ts +++ b/test/integrations/destinations/adj/processor/data.ts @@ -105,8 +105,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -462,8 +468,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -933,8 +945,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -1062,8 +1080,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -1191,8 +1215,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.37, android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -1433,8 +1463,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.37, android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -1681,8 +1717,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -2053,8 +2095,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), partner_params: { 'partnerParamKey-1': 'value1', 'partnerParamKey-2': 'value2', diff --git a/test/integrations/destinations/adj/router/data.ts b/test/integrations/destinations/adj/router/data.ts index 22c4e899d2f..c4d3670c8a8 100644 --- a/test/integrations/destinations/adj/router/data.ts +++ b/test/integrations/destinations/adj/router/data.ts @@ -110,8 +110,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -279,8 +285,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', diff --git a/test/integrations/destinations/adobe_analytics/processor/data.ts b/test/integrations/destinations/adobe_analytics/processor/data.ts index fa050897c95..2ace5bed4b9 100644 --- a/test/integrations/destinations/adobe_analytics/processor/data.ts +++ b/test/integrations/destinations/adobe_analytics/processor/data.ts @@ -1412,7 +1412,7 @@ export const data = [ JSON_ARRAY: {}, XML: { payload: - '17941080sales campaignweb127.0.0.1en-USDalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)https://www.google.com/search?q=estore+bestsellerroottval001RudderLabs JavaScript SDK <Custom>TEDxGROWTH&MARKETINGoWatched Videohttps://www.estore.com/best-seller/1growth2020-01-09T10:01:53.558Zmktcloudid001event1footlockerrudderstackpoc', + '17941080sales campaignweb127.0.0.1en-USDalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)https://www.google.com/search?q=estore+bestsellerroottval001RudderLabs JavaScript SDK <Custom>TEDxGROWTH&MARKETINGoWatched Videohttps://www.estore.com/best-seller/1growth2020-01-09T10:01:53.558Zmktcloudid001event1footlockerrudderstackpoc', }, FORM: {}, }, @@ -1582,7 +1582,7 @@ export const data = [ JSON_ARRAY: {}, XML: { payload: - '17941080sales campaignweb127.0.0.1en-USDalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)https://www.google.com/search?q=estore+bestsellerroottval001Kolkata9935400932RudderLabs JavaScript SDKopage viewhttps://www.estore.com/best-seller/1r15,faze90Rciaz,hummer,tharcustompropval1custompropval22020-01-09T10:01:53.558Zmktcloudid001event2footlockerrudderstackpoc', + '17941080sales campaignweb127.0.0.1en-USDalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)https://www.google.com/search?q=estore+bestsellerroottval001Kolkata9935400932RudderLabs JavaScript SDKopage viewhttps://www.estore.com/best-seller/1r15,faze90Rciaz,hummer,tharcustompropval1custompropval22020-01-09T10:01:53.558Zmktcloudid001event2footlockerrudderstackpoc', }, FORM: {}, }, @@ -3044,7 +3044,7 @@ export const data = [ JSON_ARRAY: {}, XML: { payload: - '17941080sales campaignweb127.0.0.1en-USDalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)https://www.google.com/search?q=estore+bestsellerroottval001RudderLabs JavaScript SDKorandom unmapped eventhttps://www.estore.com/best-seller/12020-01-09T10:01:53.558Zmktcloudid001override eventfootlockerrudderstackpoc', + '17941080sales campaignweb127.0.0.1en-USDalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)https://www.google.com/search?q=estore+bestsellerroottval001RudderLabs JavaScript SDKorandom unmapped eventhttps://www.estore.com/best-seller/12020-01-09T10:01:53.558Zmktcloudid001override eventfootlockerrudderstackpoc', }, FORM: {}, }, diff --git a/test/integrations/destinations/af/deleteUsers/data.ts b/test/integrations/destinations/af/deleteUsers/data.ts index 608e7e55869..3309d0505e1 100644 --- a/test/integrations/destinations/af/deleteUsers/data.ts +++ b/test/integrations/destinations/af/deleteUsers/data.ts @@ -1,3 +1,4 @@ +import { secret1 } from '../maskedSecrets'; import { cloneDeep } from 'lodash'; import { FEATURES } from '../../../../../src/v0/util/tags'; import { networkCallsData } from '../network'; @@ -28,7 +29,7 @@ const requests = [ ], config: { devKey: 'ef1d42390426e3f7c90ac78272e74344', - apiToken: 'dummyApiToken', + apiToken: secret1, }, }, ], @@ -54,7 +55,7 @@ const requests = [ appleAppId: '123456789', statusCallbackUrls: 'https://examplecontroller.com/opengdpr_callbacks,https://examplecontroller.com/opengdpr_callbacks,https://examplecontroller.com/opengdpr_callbacks,https://examplecontroller.com/opengdpr_callbacks', - apiToken: 'dummyApiToken', + apiToken: secret1, }, }, ], @@ -82,7 +83,7 @@ const requests = [ groupValueTrait: 'age', trackProductsOnce: false, trackRevenuePerProduct: false, - apiToken: 'dummyApiToken', + apiToken: secret1, }, }, ], @@ -110,7 +111,7 @@ const requests = [ groupValueTrait: 'age', trackProductsOnce: false, trackRevenuePerProduct: false, - apiToken: 'dummyApiToken', + apiToken: secret1, }, }, ], @@ -138,7 +139,7 @@ const requests = [ groupValueTrait: 'age', trackProductsOnce: false, trackRevenuePerProduct: false, - apiToken: 'dummyApiToken', + apiToken: secret1, }, }, ], @@ -230,7 +231,7 @@ export const data = [ devKey: 'ef1d42390426e3f7c90ac78272e74344', appleAppId: '123456789', androidAppId: 'AnAID', - apiToken: 'dummyApiToken', + apiToken: secret1, }, }, ], @@ -274,7 +275,7 @@ export const data = [ devKey: 'ef1d42390426e3f7c90ac78272e74344', appleAppId: '123456789', androidAppId: 'AnAID', - apiToken: 'dummyApiToken', + apiToken: secret1, statusCallbackUrls: 'https://examplecontroller.com/opengdpr_callbacks', }, }, diff --git a/test/integrations/destinations/af/maskedSecrets.ts b/test/integrations/destinations/af/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/af/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/af/network.ts b/test/integrations/destinations/af/network.ts index 2e9557539e1..027887a5d5d 100644 --- a/test/integrations/destinations/af/network.ts +++ b/test/integrations/destinations/af/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; import { JSON_MIME_TYPE } from '../../../../src/v0/util/constant'; export const networkCallsData = [ @@ -8,7 +9,7 @@ export const networkCallsData = [ headers: { 'Content-Type': JSON_MIME_TYPE, - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, }, data: { subject_request_type: 'erasure', @@ -56,7 +57,7 @@ export const networkCallsData = [ headers: { 'Content-Type': JSON_MIME_TYPE, - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, }, }, httpRes: { diff --git a/test/integrations/destinations/af/processor/data.ts b/test/integrations/destinations/af/processor/data.ts index dacef389431..16f28cbcb67 100644 --- a/test/integrations/destinations/af/processor/data.ts +++ b/test/integrations/destinations/af/processor/data.ts @@ -197,7 +197,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -281,8 +287,12 @@ export const existingTestCases = [ params: {}, body: { JSON: { - eventValue: - '{"properties":{"user_actual_role":"system_admin, system_user","user_actual_id":12345}}', + eventValue: JSON.stringify({ + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + }), eventName: 'test track event HS', customer_user_id: '12345', ip: '0.0.0.0', @@ -546,7 +556,13 @@ export const existingTestCases = [ JSON: { bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'some_other2345_sample_external_id', os: '', @@ -638,7 +654,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -726,7 +748,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -796,8 +824,48 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f"},"af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', @@ -881,8 +949,27 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f"},"af_revenue":48,"af_price":25,"af_quantity":2,"af_order_id":"50314b8e9bcf000000000000"}', + eventValue: JSON.stringify({ + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + af_revenue: 48, + af_price: 25, + af_quantity: 2, + af_order_id: '50314b8e9bcf000000000000', + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', @@ -1020,8 +1107,47 @@ export const existingTestCases = [ params: {}, body: { JSON: { - eventValue: - '{"properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f"},"af_revenue":48,"af_quantity":2,"af_price":25,"af_currency":"ZAR"}', + eventValue: JSON.stringify({ + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + af_revenue: 48, + af_quantity: 2, + af_price: 25, + af_currency: 'ZAR', + }), eventName: 'normal track event', eventTime: '2020-08-14T05:30:30.118Z', eventCurrency: 'ZAR', @@ -1272,7 +1398,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -1365,7 +1497,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -1535,7 +1673,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -1621,8 +1765,10 @@ export const existingTestCases = [ params: {}, body: { JSON: { - eventValue: - '{"user_actual_role":"system_admin, system_user","user_actual_id":12345}', + eventValue: JSON.stringify({ + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }), eventName: 'test track event HS', customer_user_id: '12345', ip: '0.0.0.0', @@ -1696,8 +1842,46 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', @@ -1788,8 +1972,51 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"prop1":"value1","prop2":"value2","properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","Prop3":"value3"},"af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + prop1: 'value1', + prop2: 'value2', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + Prop3: 'value3', + }, + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', diff --git a/test/integrations/destinations/af/processor/validation.ts b/test/integrations/destinations/af/processor/validation.ts index 8042570c7d2..ed34cae6925 100644 --- a/test/integrations/destinations/af/processor/validation.ts +++ b/test/integrations/destinations/af/processor/validation.ts @@ -235,7 +235,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -319,8 +325,12 @@ export const existingTestCases = [ params: {}, body: { JSON: { - eventValue: - '{"properties":{"user_actual_role":"system_admin, system_user","user_actual_id":12345}}', + eventValue: JSON.stringify({ + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + }), eventName: 'test track event HS', customer_user_id: '12345', ip: '0.0.0.0', @@ -584,7 +594,13 @@ export const existingTestCases = [ JSON: { bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'some_other2345_sample_external_id', os: '', @@ -676,7 +692,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -764,7 +786,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -834,8 +862,48 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f"},"af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', @@ -919,8 +987,27 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f"},"af_revenue":48,"af_price":25,"af_quantity":2,"af_order_id":"50314b8e9bcf000000000000"}', + eventValue: JSON.stringify({ + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + af_revenue: 48, + af_price: 25, + af_quantity: 2, + af_order_id: '50314b8e9bcf000000000000', + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', @@ -1058,8 +1145,47 @@ export const existingTestCases = [ params: {}, body: { JSON: { - eventValue: - '{"properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f"},"af_revenue":48,"af_quantity":2,"af_price":25,"af_currency":"ZAR"}', + eventValue: JSON.stringify({ + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + af_revenue: 48, + af_quantity: 2, + af_price: 25, + af_currency: 'ZAR', + }), eventName: 'normal track event', eventTime: '2020-08-14T05:30:30.118Z', eventCurrency: 'ZAR', @@ -1310,7 +1436,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -1403,7 +1535,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -1573,7 +1711,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -1659,8 +1803,10 @@ export const existingTestCases = [ params: {}, body: { JSON: { - eventValue: - '{"user_actual_role":"system_admin, system_user","user_actual_id":12345}', + eventValue: JSON.stringify({ + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }), eventName: 'test track event HS', customer_user_id: '12345', ip: '0.0.0.0', @@ -1734,8 +1880,46 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', @@ -1786,6 +1970,7 @@ export const newConfigValidationTests: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1843,6 +2028,7 @@ export const newConfigValidationTests: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1900,6 +2086,7 @@ export const newConfigValidationTests: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1956,6 +2143,7 @@ export const newConfigValidationTests: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1970,8 +2158,46 @@ export const newConfigValidationTests: ProcessorTestData[] = [ JSON: { customer_user_id: 'default-user-id', bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', appsflyer_id: 'afUid', @@ -2016,6 +2242,7 @@ export const newConfigValidationTests: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2029,8 +2256,46 @@ export const newConfigValidationTests: ProcessorTestData[] = [ headers: { ...commonHeader, authentication: 'dummy' }, JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', customer_user_id: 'default-user-id', diff --git a/test/integrations/destinations/af/router/data.ts b/test/integrations/destinations/af/router/data.ts index b6dca3a75ec..4e67d1953f3 100644 --- a/test/integrations/destinations/af/router/data.ts +++ b/test/integrations/destinations/af/router/data.ts @@ -165,7 +165,13 @@ export const data = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -204,8 +210,12 @@ export const data = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: - '{"properties":{"user_actual_role":"system_admin, system_user","user_actual_id":12345}}', + eventValue: JSON.stringify({ + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + }), eventName: 'test track event HS', appsflyer_id: 'afUid', os: '', @@ -244,7 +254,13 @@ export const data = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', diff --git a/test/integrations/destinations/airship/maskedSecrets.ts b/test/integrations/destinations/airship/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/airship/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/airship/processor/business.ts b/test/integrations/destinations/airship/processor/business.ts new file mode 100644 index 00000000000..0ee0beb8f24 --- /dev/null +++ b/test/integrations/destinations/airship/processor/business.ts @@ -0,0 +1,233 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; +const arrayHandlingCases = [ + { + description: + '[identify] should send array traits as is to airship when present in integrationsObject(even when similar key is present in traits)', + inputEvent: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + colors: ['red', 'blue'], + }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { name: '', version: '' }, + screen: { density: 2 }, + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: 'testuserId1', + integrations: { + All: true, + Airship: { + JSONAttributes: { + 'colors#r012': { + colors: ['green', 'yellow'], + }, + }, + }, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + expectedOutputResponse: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://go.urbanairship.com/api/named_users/testuserId1/attributes', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/vnd.urbanairship+json; version=3', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + attributes: [ + { + action: 'set', + key: 'email', + value: 'testone@gmail.com', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'first_name', + value: 'test', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'last_name', + value: 'one', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'colors#r012', + value: { + colors: ['green', 'yellow'], + }, + timestamp: '2019-10-14T09:03:17Z', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + // not expected in reality & leads to error in airship, but just to test the delimiter handling + { + description: '[identify] should handle keys with delimiters and JSON attributes correctly', + inputEvent: { + channel: 'web', + context: { + traits: { + preferences: ['value1'], // should be processed as preferences_0 + 'settings.theme': 'dark', + 'data[test]_value': 'test', + simple: 'value', // no delimiters + 'company[location]': 'SF', // should be processed since not in JSONAttributes + }, + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + userId: 'testuserId1', + integrations: { + All: true, + Airship: { + JSONAttributes: { + 'company#pow2': { + name: 'Test Corp', + size: 100, + }, + }, + }, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + expectedOutputResponse: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://go.urbanairship.com/api/named_users/testuserId1/attributes', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/vnd.urbanairship+json; version=3', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + attributes: [ + { + action: 'set', + key: 'preferences[0]', + value: 'value1', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'settings_theme', + value: 'dark', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'data[test]_value', + value: 'test', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'simple', + value: 'value', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'company#pow2', + value: { + name: 'Test Corp', + size: 100, + }, + timestamp: '2019-10-14T09:03:17Z', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, +]; + +const getIdentifyTestCase = ({ description, inputEvent, expectedOutputResponse }) => { + return { + name: 'airship', + description: description, + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: inputEvent, + destination: { + Config: { + apiKey: secret1, + appKey: 'O2YARRI15I', + dataCenter: false, + }, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: expectedOutputResponse, + }, + }; +}; + +export const identifyTestCases = arrayHandlingCases.map((tc) => getIdentifyTestCase(tc)); diff --git a/test/integrations/destinations/airship/processor/data.ts b/test/integrations/destinations/airship/processor/data.ts index 3c6d827ce6c..20e07f57596 100644 --- a/test/integrations/destinations/airship/processor/data.ts +++ b/test/integrations/destinations/airship/processor/data.ts @@ -1,4 +1,8 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; +import { identifyTestCases } from './business'; + export const data = [ + ...identifyTestCases, { name: 'airship', description: 'Test 0', @@ -51,7 +55,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false, }, @@ -75,7 +79,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'O2YARRI15I', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -162,7 +166,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false, }, @@ -243,7 +247,7 @@ export const data = [ sentAt: '2019-10-14T09:03:22.563Z', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: false }, + Config: { apiKey: secret1, dataCenter: false }, }, }, ], @@ -322,7 +326,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: true, }, @@ -346,7 +350,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'O2YARRI15I', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -425,7 +429,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false, }, @@ -448,7 +452,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -549,7 +553,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false, }, @@ -572,7 +576,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -640,7 +644,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false, }, @@ -663,7 +667,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -690,7 +694,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -806,7 +810,7 @@ export const data = [ version: '1', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: true }, + Config: { apiKey: secret1, dataCenter: true }, }, }, ], @@ -826,7 +830,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -853,7 +857,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -954,7 +958,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', appSecret: 'fhf', dataCenter: true, @@ -1027,7 +1031,7 @@ export const data = [ version: '1', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: false }, + Config: { apiKey: secret1, dataCenter: false }, }, }, ], @@ -1047,7 +1051,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1147,7 +1151,7 @@ export const data = [ version: '1', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: false }, + Config: { apiKey: secret1, dataCenter: false }, }, }, ], @@ -1167,7 +1171,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1234,7 +1238,7 @@ export const data = [ version: '1', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: false }, + Config: { apiKey: secret1, dataCenter: false }, }, }, ], @@ -1254,7 +1258,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1281,7 +1285,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1397,7 +1401,7 @@ export const data = [ version: '1', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: true }, + Config: { apiKey: secret1, dataCenter: true }, }, }, ], @@ -1417,7 +1421,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1444,7 +1448,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1545,7 +1549,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', appSecret: 'fhf', dataCenter: true, @@ -1621,7 +1625,7 @@ export const data = [ version: '1', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: false }, + Config: { apiKey: secret1, dataCenter: false }, }, }, ], @@ -1641,7 +1645,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1668,7 +1672,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1887,7 +1891,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', appSecret: 'fhf', dataCenter: false, @@ -1912,7 +1916,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1934,6 +1938,77 @@ export const data = [ }, }, }, + { + name: 'airship', + description: 'Test 16', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + event: 'Product Clicked', + userId: 'testuserId1', + properties: { value: 55 }, + integrations: { All: true }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: secret1, + appKey: 'ffdf', + appSecret: 'fhf', + dataCenter: false, + }, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://go.urbanairship.com/api/custom-events', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/vnd.urbanairship+json; version=3', + 'X-UA-Appkey': 'ffdf', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + occured: '2019-10-14T09:03:17.562Z', + user: { named_user_id: 'testuserId1' }, + body: { name: 'product_clicked', value: 55 }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, { name: 'airship', description: 'Test 17', @@ -1975,7 +2050,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', dataCenter: false, }, @@ -1999,7 +2074,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2062,7 +2137,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', dataCenter: false, }, @@ -2086,7 +2161,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2267,7 +2342,7 @@ export const data = [ sentAt: '2019-10-14T09:03:22.563Z', }, destination: { - Config: { appKey: 'dummyApiKey', dataCenter: false }, + Config: { appKey: secret1, dataCenter: false }, }, }, ], @@ -2333,7 +2408,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', dataCenter: false, }, @@ -2357,7 +2432,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2420,7 +2495,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', dataCenter: false, }, @@ -2444,7 +2519,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2508,7 +2583,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', dataCenter: false, }, @@ -2532,7 +2607,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2595,7 +2670,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', dataCenter: false, }, @@ -2619,7 +2694,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/airship/router/data.ts b/test/integrations/destinations/airship/router/data.ts index df500d7413c..ea63b789e71 100644 --- a/test/integrations/destinations/airship/router/data.ts +++ b/test/integrations/destinations/airship/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'airship', @@ -11,7 +12,7 @@ export const data = [ input: [ { destination: { - Config: { apiKey: 'dummyApiKey', appKey: 'O2YARRI15I', dataCenter: false }, + Config: { apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false }, }, metadata: { jobId: 1, userId: 'u1' }, message: { @@ -76,7 +77,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'O2YARRI15I', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -109,7 +110,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'dummyApiKey', appKey: 'O2YARRI15I', dataCenter: false }, + Config: { apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false }, }, }, ], @@ -129,7 +130,7 @@ export const data = [ input: [ { destination: { - Config: { apiKey: 'dummyApiKey', appKey: 'O2YARRI15I', dataCenter: false }, + Config: { apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false }, }, metadata: { jobId: 2, userId: 'u1' }, message: { @@ -188,7 +189,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -211,7 +212,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -285,7 +286,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'dummyApiKey', appKey: 'O2YARRI15I', dataCenter: false }, + Config: { apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false }, }, }, ], @@ -304,7 +305,7 @@ export const data = [ body: { input: [ { - destination: { Config: { apiKey: 'dummyApiKey', dataCenter: false } }, + destination: { Config: { apiKey: secret1, dataCenter: false } }, metadata: { jobId: 3, userId: 'u1' }, message: { anonymousId: '507f191e810c19729de860ea', @@ -362,7 +363,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -385,7 +386,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -458,7 +459,7 @@ export const data = [ metadata: [{ jobId: 3, userId: 'u1' }], batched: false, statusCode: 200, - destination: { Config: { apiKey: 'dummyApiKey', dataCenter: false } }, + destination: { Config: { apiKey: secret1, dataCenter: false } }, }, ], }, diff --git a/test/integrations/destinations/algolia/dataDelivery/business.ts b/test/integrations/destinations/algolia/dataDelivery/business.ts index 8ba964e2ddb..1f09d5854b8 100644 --- a/test/integrations/destinations/algolia/dataDelivery/business.ts +++ b/test/integrations/destinations/algolia/dataDelivery/business.ts @@ -1,6 +1,8 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV0Payload, generateProxyV1Payload } from '../../../testUtils'; import { abortStatTags, commonRequestProperties, metadataArray, retryStatTags } from './constant'; +import { defaultAccessToken } from '../../../common/secrets'; + const proxyMetdata3 = { jobId: 3, attemptNum: 1, @@ -214,8 +216,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'ALGOLIA: Error transformer proxy v1 during ALGOLIA response transformation', response: [ { - error: - '{"status":422,"message":"EventType must be one of \\"click\\", \\"conversion\\" or \\"view\\""}', + error: JSON.stringify({ + status: 422, + message: `EventType must be one of "click", "conversion" or "view"`, + }), metadata: { jobId: 1, attemptNum: 1, @@ -224,7 +228,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: true, }, @@ -277,8 +281,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'ALGOLIA: Error transformer proxy v1 during ALGOLIA response transformation', response: [ { - error: - '{"status":422,"message":"EventType must be one of \\"click\\", \\"conversion\\" or \\"view\\""}', + error: JSON.stringify({ + status: 422, + message: `EventType must be one of "click", "conversion" or "view"`, + }), metadata: { jobId: 1, attemptNum: 1, @@ -292,8 +298,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ statusCode: 500, }, { - error: - '{"status":422,"message":"EventType must be one of \\"click\\", \\"conversion\\" or \\"view\\""}', + error: JSON.stringify({ + status: 422, + message: `EventType must be one of "click", "conversion" or "view"`, + }), metadata: { jobId: 2, attemptNum: 1, @@ -307,8 +315,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ statusCode: 500, }, { - error: - '{"status":422,"message":"EventType must be one of \\"click\\", \\"conversion\\" or \\"view\\""}', + error: JSON.stringify({ + status: 422, + message: `EventType must be one of "click", "conversion" or "view"`, + }), metadata: { jobId: 3, attemptNum: 1, diff --git a/test/integrations/destinations/algolia/dataDelivery/constant.ts b/test/integrations/destinations/algolia/dataDelivery/constant.ts index e8d0817a7fe..bf6dfeeaf68 100644 --- a/test/integrations/destinations/algolia/dataDelivery/constant.ts +++ b/test/integrations/destinations/algolia/dataDelivery/constant.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + const proxyMetdata1 = { jobId: 1, attemptNum: 1, @@ -35,7 +37,7 @@ export const abortStatTags = { export const commonRequestProperties = { commonHeaders: { - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, 'X-Algolia-Application-Id': 'O2YARRI15I', 'User-Agent': 'RudderLabs', }, diff --git a/test/integrations/destinations/algolia/dataDelivery/other.ts b/test/integrations/destinations/algolia/dataDelivery/other.ts index f5ccc703378..27f927fae58 100644 --- a/test/integrations/destinations/algolia/dataDelivery/other.ts +++ b/test/integrations/destinations/algolia/dataDelivery/other.ts @@ -1,6 +1,6 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV0Payload, generateProxyV1Payload } from '../../../testUtils'; - +import { defaultAccessToken } from '../../../common/secrets'; export const otherScenariosV0 = [ { id: 'algolia_v0_other_scenario_1', @@ -258,8 +258,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: { jobId: 1, @@ -269,7 +274,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: true, }, @@ -326,7 +331,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: true, }, @@ -383,7 +388,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: true, }, @@ -440,7 +445,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: true, }, @@ -498,7 +503,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: true, }, diff --git a/test/integrations/destinations/algolia/processor/data.ts b/test/integrations/destinations/algolia/processor/data.ts index b37b6e42465..f8d9e01dd7b 100644 --- a/test/integrations/destinations/algolia/processor/data.ts +++ b/test/integrations/destinations/algolia/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'algolia', @@ -74,7 +76,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -117,7 +119,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', files: {}, headers: { - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, 'X-Algolia-Application-Id': 'O2YARRI15I', }, method: 'POST', @@ -225,7 +227,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -266,7 +268,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', files: {}, headers: { - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, 'X-Algolia-Application-Id': 'O2YARRI15I', }, method: 'POST', @@ -365,7 +367,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [], }, @@ -480,7 +482,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [], }, @@ -605,7 +607,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -735,7 +737,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -775,7 +777,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', files: {}, headers: { - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, 'X-Algolia-Application-Id': 'O2YARRI15I', }, method: 'POST', @@ -883,7 +885,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1013,7 +1015,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1143,7 +1145,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', }, }, @@ -1256,7 +1258,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1376,7 +1378,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1492,7 +1494,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1582,7 +1584,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1727,7 +1729,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1786,7 +1788,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -1902,7 +1904,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1961,7 +1963,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2078,7 +2080,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2137,7 +2139,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2235,7 +2237,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2279,7 +2281,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2388,7 +2390,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2510,7 +2512,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2554,7 +2556,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, diff --git a/test/integrations/destinations/algolia/router/data.ts b/test/integrations/destinations/algolia/router/data.ts index adc7be1596f..c200e1234ee 100644 --- a/test/integrations/destinations/algolia/router/data.ts +++ b/test/integrations/destinations/algolia/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'algolia', @@ -265,7 +267,7 @@ export const data = [ metadata: { jobId: 3, userId: 'u1' }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [{ from: 'product clicked', to: 'cLick ' }], }, @@ -369,7 +371,7 @@ export const data = [ batched: false, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [{ from: 'product clicked', to: 'cLick ' }], }, @@ -2227,7 +2229,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2324,7 +2326,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2421,7 +2423,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2518,7 +2520,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2641,7 +2643,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2668,7 +2670,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2749,7 +2751,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2776,7 +2778,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2857,7 +2859,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2884,7 +2886,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2965,7 +2967,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2992,7 +2994,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3073,7 +3075,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3170,7 +3172,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3267,7 +3269,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3364,7 +3366,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3461,7 +3463,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3598,7 +3600,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -3645,7 +3647,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3726,7 +3728,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -3753,7 +3755,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3834,7 +3836,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -3861,7 +3863,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3942,7 +3944,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -4039,7 +4041,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -4136,7 +4138,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -4233,7 +4235,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -4330,7 +4332,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -4481,7 +4483,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -4548,7 +4550,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { diff --git a/test/integrations/destinations/am/batch/data.ts b/test/integrations/destinations/am/batch/data.ts index 91a17606a90..c7217956c27 100644 --- a/test/integrations/destinations/am/batch/data.ts +++ b/test/integrations/destinations/am/batch/data.ts @@ -416,7 +416,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -449,7 +458,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -557,7 +571,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -592,7 +615,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -1046,7 +1074,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -1079,7 +1116,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -1185,7 +1227,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -1220,7 +1271,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -2370,7 +2426,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -2403,7 +2468,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -2511,7 +2581,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -2546,7 +2625,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -3009,7 +3093,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -3042,7 +3135,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -3149,7 +3247,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -3184,7 +3291,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, diff --git a/test/integrations/destinations/am/dataDelivery/data.ts b/test/integrations/destinations/am/dataDelivery/data.ts index 19baca02c38..339a98e4dd9 100644 --- a/test/integrations/destinations/am/dataDelivery/data.ts +++ b/test/integrations/destinations/am/dataDelivery/data.ts @@ -23,7 +23,7 @@ export const data = [ body: { FORM: {}, JSON: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -65,26 +65,9 @@ export const data = [ body: { output: { status: 200, - message: - '[Generic Response Handler] Request for destination: am Processed Successfully', - destinationResponse: { - headers: { - 'access-control-allow-methods': 'GET, POST', - 'access-control-allow-origin': '*', - connection: 'keep-alive', - 'content-length': '93', - 'content-type': 'application/json', - date: 'Sat, 11 Dec 2021 15:08:22 GMT', - 'strict-transport-security': 'max-age=15768000', - }, - response: { - code: 200, - server_upload_time: 1639235302252, - payload_size_bytes: 863, - events_ingested: 1, - }, - status: 200, - }, + message: '[amplitude Response Handler] - Request Processed Successfully', + destinationResponse: + '{"code":200,"server_upload_time":1639235302252,"payload_size_bytes":863,"events_ingested":1}', }, }, }, @@ -109,7 +92,7 @@ export const data = [ body: { FORM: {}, JSON: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -152,7 +135,7 @@ export const data = [ output: { status: 400, message: - '[Generic Response Handler] Request failed for destination am with status: 400', + 'Request Failed during amplitude response transformation: with status "400" due to "{"code":400,"server_upload_time":1639235302252,"payload_size_bytes":863,"events_ingested":0}", (Aborted)', destinationResponse: { headers: { 'access-control-allow-methods': 'GET, POST', @@ -205,7 +188,7 @@ export const data = [ body: { FORM: {}, JSON: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -248,7 +231,7 @@ export const data = [ output: { status: 400, message: - '[Generic Response Handler] Request failed for destination am with status: 400', + 'Request Failed during amplitude response transformation: with status "400" due to ""[ENOTFOUND] :: DNS lookup failed"", (Aborted)', destinationResponse: { response: '[ENOTFOUND] :: DNS lookup failed', status: 400, @@ -274,7 +257,7 @@ export const data = [ { asymmetricMatch: (actual) => { const expected = { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -335,7 +318,7 @@ export const data = [ body: { FORM: {}, JSON: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -378,7 +361,7 @@ export const data = [ output: { status: 400, message: - '[Generic Response Handler] Request failed for destination am with status: 400', + 'Request Failed during amplitude response transformation: with status "400" due to """", (Aborted)', destinationResponse: { response: '', status: 400, @@ -417,7 +400,7 @@ export const data = [ body: { FORM: {}, JSON: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -460,7 +443,7 @@ export const data = [ output: { status: 500, message: - '[Generic Response Handler] Request failed for destination am with status: 500', + 'Request Failed during amplitude response transformation: with status "500" due to """", (Retryable)', destinationResponse: { response: '', status: 500, @@ -499,7 +482,7 @@ export const data = [ body: { FORM: {}, JSON: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -542,7 +525,7 @@ export const data = [ output: { status: 500, message: - '[Generic Response Handler] Request failed for destination am with status: 500', + 'Request Failed during amplitude response transformation: with status "500" due to """", (Retryable)', destinationResponse: { response: '', status: 500, @@ -562,4 +545,238 @@ export const data = [ }, }, }, + { + name: 'am', + description: 'Test 6: for 429 Rate Limit Handling', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/rate-limited', + method: 'POST', + userId: 'test_user_123', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'dummy-api-key', + events: [ + { + app_name: 'Rudder-Amplitude_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'testrluser@email.com', + user_properties: { + city: 'San Francisco', + country: 'US', + email: 'testrluser@email.com', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, // Expected status is 500 (RetryableError) + body: { + output: { + status: 500, + message: + 'Request Failed during amplitude response transformation: Too many requests for some devices and users - due to Request Limit exceeded, (Retryable)', + destinationResponse: { + headers: { + 'access-control-allow-methods': 'GET, POST', + 'access-control-allow-origin': '*', + 'content-type': 'application/json', + 'retry-after': '120', + }, + response: { + code: 429, + error: 'Too many requests for some devices and users', + eps_threshold: 30, + throttled_devices: { + 'HIJ3L821-F01A-2GY5-2C81-7F03X7DS291D': 31, + }, + throttled_users: { + 'testrluser@email.com': 32, + }, + throttled_events: [3, 4, 7], + }, + status: 200, + }, + statTags: { + destType: 'AM', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + mockFns: (mockAdapter: MockAdapter) => { + mockAdapter + .onPost('https://api.amplitude.com/2/httpapi/rate-limited', { + asymmetricMatch: (actual) => { + // Simple check to match the request body + return actual.api_key === 'dummy-api-key'; + }, + }) + .replyOnce( + 200, + { + code: 429, + error: 'Too many requests for some devices and users', + eps_threshold: 30, + throttled_devices: { + 'HIJ3L821-F01A-2GY5-2C81-7F03X7DS291D': 31, + }, + throttled_users: { + 'testrluser@email.com': 32, + }, + throttled_events: [3, 4, 7], + }, + { + 'access-control-allow-methods': 'GET, POST', + 'access-control-allow-origin': '*', + 'content-type': 'application/json', + 'retry-after': '120', + }, + ); + }, + }, + { + name: 'am', + description: 'Test 7: for standard 429 Rate Limit Handling (ThrottledError)', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/standard-rate-limited', + method: 'POST', + userId: 'test_user_456', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'random-api-key', + events: [ + { + app_name: 'Rudder-Amplitude_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'user@example.com', + user_properties: { + city: 'San Francisco', + country: 'US', + email: 'user@example.com', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 429, + body: { + output: { + destinationResponse: { + headers: { + 'access-control-allow-methods': 'GET, POST', + 'access-control-allow-origin': '*', + 'content-type': 'application/json', + 'retry-after': '60', + }, + response: { + code: 429, + eps_threshold: 20, + error: 'Rate limit exceeded', + throttled_events: [], + throttled_users: {}, + }, + status: 200, + }, + message: + 'Request Failed during amplitude response transformation: Rate limit exceeded - due to Request Limit exceeded, (Throttled)', + statTags: { + destType: 'AM', + destinationId: 'Non-determininable', + errorCategory: 'network', + errorType: 'throttled', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + workspaceId: 'Non-determininable', + }, + status: 429, + }, + }, + }, + }, + mockFns: (mockAdapter: MockAdapter) => { + mockAdapter + .onPost('https://api.amplitude.com/2/httpapi/standard-rate-limited', { + asymmetricMatch: (actual) => { + // Simple check to match the request body + return actual.api_key === 'random-api-key'; + }, + }) + .replyOnce( + 200, + { + code: 429, + error: 'Rate limit exceeded', + eps_threshold: 20, + throttled_users: {}, + throttled_events: [], + }, + { + 'access-control-allow-methods': 'GET, POST', + 'access-control-allow-origin': '*', + 'content-type': 'application/json', + 'retry-after': '60', + }, + ); + }, + }, ]; diff --git a/test/integrations/destinations/am/deleteUsers/data.ts b/test/integrations/destinations/am/deleteUsers/data.ts index bd10a4d7e05..7092cc13ab9 100644 --- a/test/integrations/destinations/am/deleteUsers/data.ts +++ b/test/integrations/destinations/am/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { secret1, secret2 } from '../maskedSecrets'; + export const data = [ { name: 'am', @@ -374,8 +376,8 @@ export const data = [ }, ], config: { - apiKey: '1234', - apiSecret: 'abcd', + apiKey: secret1, + apiSecret: secret2, }, }, ], @@ -393,4 +395,45 @@ export const data = [ }, }, }, + { + name: 'am', + description: 'user deletion test with EU residencyServer', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + jobId: 'dummy-job-id', + destType: 'AM', + userAttributes: [ + { + userId: 'test_user_id_1', + }, + { + userId: 'test_user_id_2', + }, + ], + config: { + apiKey: secret1, + apiSecret: secret2, + residencyServer: 'EU', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/am/maskedSecrets.ts b/test/integrations/destinations/am/maskedSecrets.ts new file mode 100644 index 00000000000..9ff6062bfd4 --- /dev/null +++ b/test/integrations/destinations/am/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/am/network.ts b/test/integrations/destinations/am/network.ts index 5cd016069c7..49c702f5646 100644 --- a/test/integrations/destinations/am/network.ts +++ b/test/integrations/destinations/am/network.ts @@ -1,3 +1,5 @@ +import { authHeader1 } from './maskedSecrets'; + const deleteNwData = [ { httpReq: { @@ -111,7 +113,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic MTIzNDphYmNk', + Authorization: authHeader1, }, }, httpRes: { @@ -154,7 +156,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic MTIzNDphYmNk', + Authorization: authHeader1, }, }, httpRes: { @@ -174,7 +176,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic MTIzNDphYmNk', + Authorization: authHeader1, }, }, httpRes: { @@ -194,7 +196,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic MTIzNDphYmNk', + Authorization: authHeader1, }, }, httpRes: { @@ -205,6 +207,44 @@ const deleteNwData = [ }, }, }, + { + httpReq: { + method: 'post', + url: 'https://analytics.eu.amplitude.com/api/2/deletions/users', + data: { + user_ids: ['test_user_id_1', 'test_user_id_2'], + requester: 'RudderStack', + ignore_invalid_id: 'true', + }, + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + }, + httpRes: { + data: [ + { + active_scrub_done_date: null, + amplitude_ids: [ + { + amplitude_id: 44547850078, + requested_on_day: '2024-12-01', + requester: 'RudderStack', + }, + { + amplitude_id: 44547886812, + requested_on_day: '2024-12-01', + requester: 'RudderStack', + }, + ], + app: '10000000', + day: '2025-01-10', + status: 'staging', + }, + ], + status: 200, + }, + }, ]; const deliveryNwData = [ @@ -212,7 +252,7 @@ const deliveryNwData = [ httpReq: { url: 'https://api.amplitude.com/2/httpapi/test1', data: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -263,7 +303,7 @@ const deliveryNwData = [ httpReq: { url: 'https://api.amplitude.com/2/httpapi/test2', data: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -316,7 +356,7 @@ const deliveryNwData = [ httpReq: { url: 'https://api.amplitude.com/2/httpapi/test4', data: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -349,7 +389,7 @@ const deliveryNwData = [ httpReq: { url: 'https://api.amplitude.com/2/httpapi/test5', data: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -382,7 +422,7 @@ const deliveryNwData = [ httpReq: { url: 'https://api.amplitude.com/2/httpapi/test6', data: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', diff --git a/test/integrations/destinations/am/processor/data.ts b/test/integrations/destinations/am/processor/data.ts index 01f9feb44a3..eda651b9517 100644 --- a/test/integrations/destinations/am/processor/data.ts +++ b/test/integrations/destinations/am/processor/data.ts @@ -1,3 +1,5 @@ +import { secret2 } from '../maskedSecrets'; + export const data = [ { name: 'am', @@ -47,7 +49,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -105,7 +107,7 @@ export const data = [ destination: { Config: { groupTypeTrait: 'email', - apiKey: 'abcde', + apiKey: secret2, groupValueTrait: 'age', trackProductsOnce: true, trackRevenuePerProduct: false, @@ -239,7 +241,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -266,7 +268,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -382,7 +384,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -409,7 +411,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -573,7 +575,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToIncrement: [ @@ -603,7 +605,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -757,7 +759,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', }, @@ -782,7 +784,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -910,7 +912,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', }, @@ -935,7 +937,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -1058,7 +1060,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1081,7 +1083,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -1213,7 +1215,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1236,7 +1238,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -1361,7 +1363,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1384,7 +1386,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -1512,7 +1514,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1535,7 +1537,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -1615,7 +1617,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1638,7 +1640,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '123456', @@ -1703,7 +1705,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1726,7 +1728,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '123456', @@ -1791,7 +1793,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1814,7 +1816,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '123456', @@ -1878,7 +1880,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1901,7 +1903,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '123456', @@ -2027,7 +2029,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -2050,7 +2052,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -2108,8 +2110,8 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', - identification: ['{"group_type":"Company","group_value":"ABC"}'], + api_key: secret2, + identification: [JSON.stringify({ group_type: 'Company', group_value: 'ABC' })], }, }, files: {}, @@ -2206,7 +2208,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'name_trait', groupValueTrait: 'value_trait', }, @@ -2231,7 +2233,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -2289,9 +2291,18 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, identification: [ - '{"group_type":"Company","group_value":"ABC","group_properties":{"KEY_3":{"CHILD_KEY_92":"value_95","CHILD_KEY_102":"value_103"},"KEY_2":{"CHILD_KEY_92":"value_95","CHILD_KEY_102":"value_103"},"name_trait":"Company","value_trait":"ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'ABC', + group_properties: { + KEY_3: { CHILD_KEY_92: 'value_95', CHILD_KEY_102: 'value_103' }, + KEY_2: { CHILD_KEY_92: 'value_95', CHILD_KEY_102: 'value_103' }, + name_trait: 'Company', + value_trait: 'ABC', + }, + }), ], }, }, @@ -2389,7 +2400,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'name_trait', groupValueTrait: 'value_trait', }, @@ -2491,7 +2502,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -2515,9 +2526,22 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, mapping: [ - '{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3","user_properties":{"initial_referrer":"https://docs.rudderstack.com","initial_referring_domain":"docs.rudderstack.com","utm_source":"google","utm_medium":"medium","utm_term":"keyword","utm_content":"some content","utm_name":"some campaign","utm_test":"other value"}}', + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + user_properties: { + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + utm_source: 'google', + utm_medium: 'medium', + utm_term: 'keyword', + utm_content: 'some content', + utm_name: 'some campaign', + utm_test: 'other value', + }, + }), ], }, }, @@ -2606,7 +2630,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -2630,9 +2654,22 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, mapping: [ - '{"user_id":"sampleusrRudder3","user_properties":{"initial_referrer":"https://docs.rudderstack.com","initial_referring_domain":"docs.rudderstack.com","utm_source":"google","utm_medium":"medium","utm_term":"keyword","utm_content":"some content","utm_name":"some campaign","utm_test":"other value"},"unmap":true}', + JSON.stringify({ + user_id: 'sampleusrRudder3', + user_properties: { + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + utm_source: 'google', + utm_medium: 'medium', + utm_term: 'keyword', + utm_content: 'some content', + utm_name: 'some campaign', + utm_test: 'other value', + }, + unmap: true, + }), ], }, }, @@ -2718,7 +2755,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -2741,7 +2778,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -2856,7 +2893,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -2879,7 +2916,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -2997,7 +3034,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -3020,7 +3057,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -3138,7 +3175,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -3161,7 +3198,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'iOS', @@ -3280,7 +3317,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -3303,7 +3340,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'iOS', @@ -3379,7 +3416,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -3402,7 +3439,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: 'anon-id-new', @@ -3505,7 +3542,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: false, @@ -3532,7 +3569,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -3587,7 +3624,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -3636,7 +3673,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -3744,7 +3781,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -3771,7 +3808,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -3907,7 +3944,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: false, @@ -3934,7 +3971,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -3988,7 +4025,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4038,7 +4075,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4147,7 +4184,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -4174,7 +4211,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4248,7 +4285,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4298,7 +4335,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4387,7 +4424,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -4414,7 +4451,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4510,7 +4547,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -4537,7 +4574,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4633,7 +4670,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: false, @@ -4660,7 +4697,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4756,7 +4793,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: false, @@ -4783,7 +4820,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4897,7 +4934,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToIncrement: [ @@ -4930,7 +4967,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -5042,7 +5079,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToSetOnce: [ @@ -5075,7 +5112,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -5185,7 +5222,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToAppend: [ @@ -5218,7 +5255,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -5328,7 +5365,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToPrepend: [ @@ -5361,7 +5398,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -5471,7 +5508,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToIncrement: [ @@ -5528,7 +5565,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -5681,7 +5718,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: false, trackRevenuePerProduct: true, }, @@ -5706,7 +5743,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -5780,7 +5817,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -5850,7 +5887,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6008,7 +6045,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: true, trackRevenuePerProduct: false, }, @@ -6033,7 +6070,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6187,7 +6224,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: true, trackRevenuePerProduct: false, }, @@ -6212,7 +6249,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6323,7 +6360,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToIncrement: [ @@ -6356,7 +6393,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -6494,7 +6531,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: true, trackRevenuePerProduct: true, }, @@ -6519,7 +6556,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6612,7 +6649,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6681,7 +6718,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6814,7 +6851,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -6837,7 +6874,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6960,7 +6997,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', }, @@ -6985,7 +7022,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -7104,7 +7141,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -7127,7 +7164,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_manufacturer: 'Apple', @@ -7238,7 +7275,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -7261,7 +7298,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_manufacturer: 'Apple', @@ -7372,7 +7409,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -7395,7 +7432,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_manufacturer: 'Apple', @@ -7516,7 +7553,7 @@ export const data = [ destination: { Config: { mapDeviceBrand: true, - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', }, @@ -7541,7 +7578,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -7671,7 +7708,7 @@ export const data = [ destination: { Config: { mapDeviceBrand: true, - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -7694,7 +7731,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -7773,7 +7810,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, mapDeviceBrand: true, }, }, @@ -7797,7 +7834,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_manufacturer: 'testManufacturer', @@ -7929,7 +7966,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', residencyServer: 'EU', @@ -7955,7 +7992,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -8094,7 +8131,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'name_trait', groupValueTrait: 'value_trait', residencyServer: 'EU', @@ -8120,7 +8157,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -8178,9 +8215,18 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, identification: [ - '{"group_type":"Company","group_value":"ABC","group_properties":{"KEY_3":{"CHILD_KEY_92":"value_95","CHILD_KEY_102":"value_103"},"KEY_2":{"CHILD_KEY_92":"value_95","CHILD_KEY_102":"value_103"},"name_trait":"Company","value_trait":"ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'ABC', + group_properties: { + KEY_3: { CHILD_KEY_92: 'value_95', CHILD_KEY_102: 'value_103' }, + KEY_2: { CHILD_KEY_92: 'value_95', CHILD_KEY_102: 'value_103' }, + name_trait: 'Company', + value_trait: 'ABC', + }, + }), ], }, }, @@ -8266,7 +8312,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, residencyServer: 'EU', }, }, @@ -8291,9 +8337,22 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, mapping: [ - '{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3","user_properties":{"initial_referrer":"https://docs.rudderstack.com","initial_referring_domain":"docs.rudderstack.com","utm_source":"google","utm_medium":"medium","utm_term":"keyword","utm_content":"some content","utm_name":"some campaign","utm_test":"other value"}}', + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + user_properties: { + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + utm_source: 'google', + utm_medium: 'medium', + utm_term: 'keyword', + utm_content: 'some content', + utm_name: 'some campaign', + utm_test: 'other value', + }, + }), ], }, }, @@ -8377,7 +8436,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: true, trackRevenuePerProduct: false, }, @@ -8402,7 +8461,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -8527,7 +8586,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: true, trackRevenuePerProduct: false, }, @@ -8552,7 +8611,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -8677,7 +8736,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: true, trackRevenuePerProduct: false, }, @@ -8702,7 +8761,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -8853,7 +8912,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', }, @@ -8878,7 +8937,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -9031,7 +9090,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', }, @@ -9056,7 +9115,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -9199,7 +9258,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'name_trait', groupValueTrait: 'value_trait', }, @@ -9224,7 +9283,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -9283,9 +9342,18 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, identification: [ - '{"group_type":"Company","group_value":"ABC","group_properties":{"KEY_3":{"CHILD_KEY_92":"value_95","CHILD_KEY_102":"value_103"},"KEY_2":{"CHILD_KEY_92":"value_95","CHILD_KEY_102":"value_103"},"name_trait":"Company","value_trait":"ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'ABC', + group_properties: { + KEY_3: { CHILD_KEY_92: 'value_95', CHILD_KEY_102: 'value_103' }, + KEY_2: { CHILD_KEY_92: 'value_95', CHILD_KEY_102: 'value_103' }, + name_trait: 'Company', + value_trait: 'ABC', + }, + }), ], }, }, @@ -9333,7 +9401,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -9356,7 +9424,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { event_id: 7, @@ -9468,7 +9536,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -9491,7 +9559,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -9622,7 +9690,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -9646,9 +9714,23 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, mapping: [ - '{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3","event_id":67,"user_properties":{"initial_referrer":"https://docs.rudderstack.com","initial_referring_domain":"docs.rudderstack.com","utm_source":"google","utm_medium":"medium","utm_term":"keyword","utm_content":"some content","utm_name":"some campaign","utm_test":"other value"}}', + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + event_id: 67, + user_properties: { + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + utm_source: 'google', + utm_medium: 'medium', + utm_term: 'keyword', + utm_content: 'some content', + utm_name: 'some campaign', + utm_test: 'other value', + }, + }), ], }, }, @@ -9732,7 +9814,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -9755,7 +9837,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -9870,7 +9952,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -9893,7 +9975,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -10032,7 +10114,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -10055,7 +10137,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -10177,7 +10259,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -10200,7 +10282,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -10330,7 +10412,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'name_trait', groupValueTrait: 'value_trait', }, @@ -10435,7 +10517,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedPageEventName: true, userProvidedPageEventString: 'My custom Page Name is {{ name }} . Custom Name.', }, @@ -10460,7 +10542,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -10591,7 +10673,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedPageEventName: true, userProvidedPageEventString: '{{name}}', }, @@ -10616,7 +10698,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -10748,7 +10830,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedPageEventName: true, userProvidedPageEventString: '', }, @@ -10773,7 +10855,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -10903,7 +10985,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedPageEventName: false, userProvidedPageEventString: 'Viewed {{context.page.title}} event.', }, @@ -10928,7 +11010,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -11010,7 +11092,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedScreenEventName: true, userProvidedScreenEventString: 'My {{ event }} event.', }, @@ -11035,7 +11117,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: 'anon-id-new', @@ -11097,7 +11179,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedScreenEventName: false, userProvidedScreenEventString: 'My {{ event }} event.', }, @@ -11122,7 +11204,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: 'anon-id-new', @@ -11184,7 +11266,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedScreenEventName: true, userProvidedScreenEventString: '{{ event }}', }, @@ -11209,7 +11291,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: 'anon-id-new', @@ -11271,7 +11353,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedScreenEventName: true, userProvidedScreenEventString: '', }, @@ -11296,7 +11378,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: 'anon-id-new', @@ -11353,7 +11435,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedPageEventName: true, userProvidedPageEventString: '', }, diff --git a/test/integrations/destinations/am/router/data.ts b/test/integrations/destinations/am/router/data.ts index 1b4026c85e0..b1f028c7303 100644 --- a/test/integrations/destinations/am/router/data.ts +++ b/test/integrations/destinations/am/router/data.ts @@ -1,3 +1,5 @@ +import { secret2 } from '../maskedSecrets'; + export const data = [ { name: 'am', @@ -61,7 +63,7 @@ export const data = [ }, metadata: { jobId: 1, userId: 'u1' }, destination: { - Config: { apiKey: 'abcde', groupTypeTrait: 'email', groupValueTrait: 'age' }, + Config: { apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age' }, }, }, { @@ -114,7 +116,7 @@ export const data = [ sentAt: '2019-10-14T11:15:53.296Z', }, metadata: { jobId: 2, userId: 'u1' }, - destination: { Config: { apiKey: 'abcde' } }, + destination: { Config: { apiKey: secret2 } }, }, ], destType: 'am', @@ -138,7 +140,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -185,7 +187,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'abcde', groupTypeTrait: 'email', groupValueTrait: 'age' }, + Config: { apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age' }, }, }, { @@ -199,7 +201,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -249,7 +251,7 @@ export const data = [ metadata: [{ jobId: 2, userId: 'u1' }], batched: false, statusCode: 200, - destination: { Config: { apiKey: 'abcde' } }, + destination: { Config: { apiKey: secret2 } }, }, ], }, diff --git a/test/integrations/destinations/amazon_audience/common.ts b/test/integrations/destinations/amazon_audience/common.ts index 728bdf1d257..1aed2084319 100644 --- a/test/integrations/destinations/amazon_audience/common.ts +++ b/test/integrations/destinations/amazon_audience/common.ts @@ -1,3 +1,4 @@ +import { secret1 } from './maskedSecrets'; export const destination = { DestinationDefinition: { Config: { @@ -6,7 +7,7 @@ export const destination = { }, }, Config: { - advertiserId: '{"Dummy Name":"1234"}', + advertiserId: JSON.stringify({ 'Dummy Name': '1234' }), audienceId: 'dummyId', }, ID: 'amazonAud-1234', @@ -22,7 +23,7 @@ export const generateMetadata = (jobId: number, userId?: string): any => { workspaceId: 'default-workspaceId', dontBatch: false, secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, refreshToken: 'dummyRefreshToken', clientId: 'dummyClientId', }, diff --git a/test/integrations/destinations/amazon_audience/dataDelivery/data.ts b/test/integrations/destinations/amazon_audience/dataDelivery/data.ts index c78a53c8994..fa3496bc7f5 100644 --- a/test/integrations/destinations/amazon_audience/dataDelivery/data.ts +++ b/test/integrations/destinations/amazon_audience/dataDelivery/data.ts @@ -1,4 +1,5 @@ import { generateMetadata, generateProxyV0Payload } from '../../../testUtils'; +import { authHeader1, authHeader2 } from '../maskedSecrets'; const commonStatTags = { destType: 'AMAZON_AUDIENCE', @@ -23,7 +24,7 @@ export const data = [ request: { body: generateProxyV0Payload({ headers: { - Authorization: 'Bearer success_access_token', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -86,7 +87,7 @@ export const data = [ request: { body: generateProxyV0Payload({ headers: { - Authorization: 'Bearer success_access_token', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -158,7 +159,7 @@ export const data = [ request: { body: generateProxyV0Payload({ headers: { - Authorization: 'Bearer fail_token', + Authorization: authHeader2, 'Content-Type': 'application/json', Accept: 'application/json', }, diff --git a/test/integrations/destinations/amazon_audience/maskedSecrets.ts b/test/integrations/destinations/amazon_audience/maskedSecrets.ts new file mode 100644 index 00000000000..4141fcbebe4 --- /dev/null +++ b/test/integrations/destinations/amazon_audience/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/amazon_audience/network.ts b/test/integrations/destinations/amazon_audience/network.ts index b0941712c6a..ec63974d83b 100644 --- a/test/integrations/destinations/amazon_audience/network.ts +++ b/test/integrations/destinations/amazon_audience/network.ts @@ -1,8 +1,5 @@ -const headers = { - 'Amazon-Advertising-API-ClientId': 'dummyClientId', - 'Content-Type': 'application/json', - Authorization: 'Bearer success_access_token', -}; +import { authHeader1, authHeader2 } from './maskedSecrets'; + export const networkCallsData = [ { description: 'successful step 1', @@ -23,7 +20,7 @@ export const networkCallsData = [ }, params: {}, headers: { - Authorization: 'Bearer success_access_token', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -51,7 +48,7 @@ export const networkCallsData = [ }, params: {}, headers: { - Authorization: 'Bearer success_access_token', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -80,7 +77,7 @@ export const networkCallsData = [ }, params: {}, headers: { - Authorization: 'Bearer success_access_token', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -107,7 +104,7 @@ export const networkCallsData = [ }, params: {}, headers: { - Authorization: 'Bearer fail_token', + Authorization: authHeader2, 'Content-Type': 'application/json', Accept: 'application/json', }, diff --git a/test/integrations/destinations/amazon_audience/processor/data.ts b/test/integrations/destinations/amazon_audience/processor/data.ts index 49931ed92bc..7a4a25ca53b 100644 --- a/test/integrations/destinations/amazon_audience/processor/data.ts +++ b/test/integrations/destinations/amazon_audience/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { destination, generateMetadata } from '../common'; const sha256 = require('sha256'); @@ -97,7 +98,7 @@ export const data = [ headers: { 'Amazon-Advertising-API-ClientId': 'dummyClientId', 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, method: 'POST', params: {}, @@ -151,7 +152,7 @@ export const data = [ headers: { 'Amazon-Advertising-API-ClientId': 'dummyClientId', 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/amazon_audience/router/data.ts b/test/integrations/destinations/amazon_audience/router/data.ts index 6787e03160e..f663e25b8ec 100644 --- a/test/integrations/destinations/amazon_audience/router/data.ts +++ b/test/integrations/destinations/amazon_audience/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { destination, generateMetadata } from '../common'; export const data = [ @@ -106,7 +107,7 @@ export const data = [ headers: { 'Amazon-Advertising-API-ClientId': 'dummyClientId', 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, params: {}, body: { @@ -157,7 +158,7 @@ export const data = [ headers: { 'Amazon-Advertising-API-ClientId': 'dummyClientId', 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/attentive_tag/maskedSecrets.ts b/test/integrations/destinations/attentive_tag/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/attentive_tag/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/attentive_tag/processor/data.ts b/test/integrations/destinations/attentive_tag/processor/data.ts index 137a9aee9af..80aced02023 100644 --- a/test/integrations/destinations/attentive_tag/processor/data.ts +++ b/test/integrations/destinations/attentive_tag/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const mockFns = (_) => { jest.spyOn(Date, 'now').mockReturnValue(new Date('2023-10-14T00:00:00.000Z').valueOf()); }; @@ -40,7 +41,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '241654', }, }, @@ -60,7 +61,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.attentivemobile.com/v1/subscriptions', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -168,7 +169,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -238,7 +239,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '241654', }, }, @@ -258,7 +259,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.attentivemobile.com/v1/subscriptions/unsubscribe', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -364,7 +365,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -476,7 +477,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -589,7 +590,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -702,7 +703,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -805,7 +806,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -917,7 +918,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -988,7 +989,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '241654', }, }, @@ -1008,7 +1009,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.attentivemobile.com/v1/subscriptions', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1114,7 +1115,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -1223,7 +1224,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -1333,7 +1334,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -1444,7 +1445,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -1514,7 +1515,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '241654', }, }, @@ -1534,7 +1535,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.attentivemobile.com/v1/subscriptions', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1624,7 +1625,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -1644,7 +1645,7 @@ export const data = [ userId: '', endpoint: 'https://api.attentivemobile.com/v1/events/ecommerce/product-view', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1728,7 +1729,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -1748,7 +1749,7 @@ export const data = [ userId: '', endpoint: 'https://api.attentivemobile.com/v1/events/custom', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/attentive_tag/router/data.ts b/test/integrations/destinations/attentive_tag/router/data.ts index 63bd477f0cf..2bbd91c3c05 100644 --- a/test/integrations/destinations/attentive_tag/router/data.ts +++ b/test/integrations/destinations/attentive_tag/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'attentive_tag', @@ -10,7 +11,7 @@ export const data = [ body: { input: [ { - destination: { Config: { apiKey: 'dummyApiKey', signUpSourceId: '241654' } }, + destination: { Config: { apiKey: secret1, signUpSourceId: '241654' } }, metadata: { jobId: 1, userId: 'u1' }, message: { anonymousId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', @@ -59,7 +60,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.attentivemobile.com/v1/subscriptions/unsubscribe', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -74,7 +75,7 @@ export const data = [ metadata: [{ jobId: 1, userId: 'u1' }], batched: false, statusCode: 200, - destination: { Config: { apiKey: 'dummyApiKey', signUpSourceId: '241654' } }, + destination: { Config: { apiKey: secret1, signUpSourceId: '241654' } }, }, ], }, diff --git a/test/integrations/destinations/attribution/data.ts b/test/integrations/destinations/attribution/data.ts index db8d7cb393b..3ed7f3da5a3 100644 --- a/test/integrations/destinations/attribution/data.ts +++ b/test/integrations/destinations/attribution/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from './maskedSecrets'; export const data = [ { name: 'attribution', @@ -22,7 +23,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -80,7 +81,7 @@ export const data = [ endpoint: 'https://track.attributionapp.com/v1/import', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -165,7 +166,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -215,7 +216,7 @@ export const data = [ endpoint: 'https://track.attributionapp.com/v1/import', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -287,7 +288,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -337,7 +338,7 @@ export const data = [ endpoint: 'https://track.attributionapp.com/v1/import', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -406,7 +407,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -458,7 +459,7 @@ export const data = [ endpoint: 'https://track.attributionapp.com/v1/import', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -532,7 +533,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -582,7 +583,7 @@ export const data = [ endpoint: 'https://track.attributionapp.com/v1/import', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/attribution/maskedSecrets.ts b/test/integrations/destinations/attribution/maskedSecrets.ts new file mode 100644 index 00000000000..ba0b28ba8a1 --- /dev/null +++ b/test/integrations/destinations/attribution/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + '')}`; diff --git a/test/integrations/destinations/autopilot/processor/data.ts b/test/integrations/destinations/autopilot/processor/data.ts index 135e3e22f74..0c4edb30203 100644 --- a/test/integrations/destinations/autopilot/processor/data.ts +++ b/test/integrations/destinations/autopilot/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'autopilot', @@ -23,7 +25,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -105,7 +107,7 @@ export const data = [ endpoint: 'https://api2.autopilothq.com/v1/contact', headers: { Accept: 'application/json', - autopilotapikey: 'dummyApiKey', + autopilotapikey: defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -160,7 +162,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -248,7 +250,7 @@ export const data = [ 'https://api2.autopilothq.com/v1/trigger/00XX/contact/testmp@rudderstack.com', headers: { Accept: 'application/json', - autopilotapikey: 'dummyApiKey', + autopilotapikey: defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -300,7 +302,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -426,7 +428,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -551,7 +553,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -675,7 +677,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -801,7 +803,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -881,7 +883,7 @@ export const data = [ endpoint: 'https://api2.autopilothq.com/v1/contact', headers: { Accept: 'application/json', - autopilotapikey: 'dummyApiKey', + autopilotapikey: defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -933,7 +935,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -1058,7 +1060,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -1177,7 +1179,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', diff --git a/test/integrations/destinations/autopilot/router/data.ts b/test/integrations/destinations/autopilot/router/data.ts index 92117a97c80..f05bb198902 100644 --- a/test/integrations/destinations/autopilot/router/data.ts +++ b/test/integrations/destinations/autopilot/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'autopilot', @@ -20,7 +22,7 @@ export const data = [ Config: { excludeKeys: [], includeKeys: [] }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [{ from: '0001', to: 'Signup' }], triggerId: '00XX', }, @@ -76,7 +78,7 @@ export const data = [ Config: { excludeKeys: [], includeKeys: [] }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [{ from: '0001', to: 'Signup' }], triggerId: '00XX', }, @@ -141,7 +143,7 @@ export const data = [ method: 'POST', endpoint: 'https://api2.autopilothq.com/v1/contact', headers: { - autopilotapikey: 'dummyApiKey', + autopilotapikey: defaultApiKey, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -174,7 +176,7 @@ export const data = [ Config: { excludeKeys: [], includeKeys: [] }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [{ from: '0001', to: 'Signup' }], triggerId: '00XX', }, @@ -191,7 +193,7 @@ export const data = [ endpoint: 'https://api2.autopilothq.com/v1/trigger/00XX/contact/testmp@rudderstack.com', headers: { - autopilotapikey: 'dummyApiKey', + autopilotapikey: defaultApiKey, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -218,7 +220,7 @@ export const data = [ Config: { excludeKeys: [], includeKeys: [] }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [{ from: '0001', to: 'Signup' }], triggerId: '00XX', }, diff --git a/test/integrations/destinations/bloomreach/common.ts b/test/integrations/destinations/bloomreach/common.ts index 798e744cbcb..a9acceff6e0 100644 --- a/test/integrations/destinations/bloomreach/common.ts +++ b/test/integrations/destinations/bloomreach/common.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from './maskedSecrets'; import { Destination } from '../../../../src/types'; const destType = 'bloomreach'; @@ -7,8 +8,8 @@ const channel = 'web'; const destination: Destination = { Config: { apiBaseUrl: 'https://demoapp-api.bloomreach.com', - apiKey: 'test-api-key', - apiSecret: 'test-api-secret', + apiKey: secret1, + apiSecret: secret2, projectToken: 'test-project-token', hardID: 'registered', softID: 'cookie', @@ -82,7 +83,7 @@ const proxyV1RetryableErrorStatTags = { const headers = { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC1hcGkta2V5OnRlc3QtYXBpLXNlY3JldA==', + Authorization: authHeader1, }; export { diff --git a/test/integrations/destinations/bloomreach/dataDelivery/other.ts b/test/integrations/destinations/bloomreach/dataDelivery/other.ts index f0dd9cc09a4..9a46448aedb 100644 --- a/test/integrations/destinations/bloomreach/dataDelivery/other.ts +++ b/test/integrations/destinations/bloomreach/dataDelivery/other.ts @@ -34,8 +34,13 @@ export const otherProxyV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/bloomreach/maskedSecrets.ts b/test/integrations/destinations/bloomreach/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/bloomreach/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/bloomreach/processor/identify.ts b/test/integrations/destinations/bloomreach/processor/identify.ts index 2a79cb57e38..cf9486081b7 100644 --- a/test/integrations/destinations/bloomreach/processor/identify.ts +++ b/test/integrations/destinations/bloomreach/processor/identify.ts @@ -30,6 +30,7 @@ export const identify: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -107,6 +108,7 @@ export const identify: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/bloomreach/processor/page.ts b/test/integrations/destinations/bloomreach/processor/page.ts index 3081feeb26a..ae454ba3ef3 100644 --- a/test/integrations/destinations/bloomreach/processor/page.ts +++ b/test/integrations/destinations/bloomreach/processor/page.ts @@ -40,6 +40,7 @@ export const page: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -97,6 +98,7 @@ export const page: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/bloomreach/processor/track.ts b/test/integrations/destinations/bloomreach/processor/track.ts index a369f508b23..bca516a3b4c 100644 --- a/test/integrations/destinations/bloomreach/processor/track.ts +++ b/test/integrations/destinations/bloomreach/processor/track.ts @@ -30,6 +30,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -87,6 +88,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -142,6 +144,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/bloomreach/processor/validation.ts b/test/integrations/destinations/bloomreach/processor/validation.ts index 1a6199abb06..dcd36908377 100644 --- a/test/integrations/destinations/bloomreach/processor/validation.ts +++ b/test/integrations/destinations/bloomreach/processor/validation.ts @@ -34,6 +34,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -78,6 +79,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -118,6 +120,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -162,6 +165,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/bloomreach_catalog/common.ts b/test/integrations/destinations/bloomreach_catalog/common.ts index 2b4266837b5..49853d17d2f 100644 --- a/test/integrations/destinations/bloomreach_catalog/common.ts +++ b/test/integrations/destinations/bloomreach_catalog/common.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from './maskedSecrets'; import { Destination } from '../../../../src/types'; const destType = 'bloomreach_catalog'; @@ -7,8 +8,8 @@ const channel = 'web'; const destination: Destination = { Config: { apiBaseUrl: 'https://demoapp-api.bloomreach.com', - apiKey: 'test-api-key', - apiSecret: 'test-api-secret', + apiKey: secret1, + apiSecret: secret2, projectToken: 'test-project-token', catalogID: 'test-catalog-id', }, @@ -58,7 +59,7 @@ const proxyV1RetryableErrorStatTags = { const headers = { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC1hcGkta2V5OnRlc3QtYXBpLXNlY3JldA==', + Authorization: authHeader1, }; const sampleContext = { diff --git a/test/integrations/destinations/bloomreach_catalog/dataDelivery/data.ts b/test/integrations/destinations/bloomreach_catalog/dataDelivery/data.ts index f8cccd04ed2..83d861e76c7 100644 --- a/test/integrations/destinations/bloomreach_catalog/dataDelivery/data.ts +++ b/test/integrations/destinations/bloomreach_catalog/dataDelivery/data.ts @@ -21,8 +21,10 @@ export const data: ProxyV1TestData[] = [ params: {}, JSON: {}, JSON_ARRAY: { - batch: - '[{"item_id":"test-item-id","properties":{"unprinted":"1"}},{"item_id":"test-item-id-faulty","properties":{"unprinted1":"1"}}]', + batch: JSON.stringify([ + { item_id: 'test-item-id', properties: { unprinted: '1' } }, + { item_id: 'test-item-id-faulty', properties: { unprinted1: '1' } }, + ]), }, endpoint: updateEndpoint, }, @@ -89,8 +91,10 @@ export const data: ProxyV1TestData[] = [ params: {}, JSON: {}, JSON_ARRAY: { - batch: - '[{"item_id":"test-item-id-1","properties":{"unprinted":"1"}},{"item_id":"test-item-id-2","properties":{"unprinted":"2"}}]', + batch: JSON.stringify([ + { item_id: 'test-item-id-1', properties: { unprinted: '1' } }, + { item_id: 'test-item-id-2', properties: { unprinted: '2' } }, + ]), }, endpoint: updateEndpoint, }, @@ -154,7 +158,9 @@ export const data: ProxyV1TestData[] = [ params: {}, JSON: {}, JSON_ARRAY: { - batch: '[{"item_id":"test-item-id-faulty","properties":{"unprinted1":"1"}}]', + batch: JSON.stringify([ + { item_id: 'test-item-id-faulty', properties: { unprinted1: '1' } }, + ]), }, endpoint: updateEndpoint, }, diff --git a/test/integrations/destinations/bloomreach_catalog/maskedSecrets.ts b/test/integrations/destinations/bloomreach_catalog/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/bloomreach_catalog/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/bloomreach_catalog/router/data.ts b/test/integrations/destinations/bloomreach_catalog/router/data.ts index 68ab4224444..2bba2849773 100644 --- a/test/integrations/destinations/bloomreach_catalog/router/data.ts +++ b/test/integrations/destinations/bloomreach_catalog/router/data.ts @@ -211,8 +211,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"item_id":"test-item-id","properties":{"title":"Hardcover Monthbooks","status":"up to date","unprinted":1}},{"item_id":"test-item-id-7","properties":{"title":"Hardcover Monthbooks","status":"up to date","unprinted":1,"test_empty":"","test_null":null,"test_empty_array":[]}}]', + batch: JSON.stringify([ + { + item_id: 'test-item-id', + properties: { + title: 'Hardcover Monthbooks', + status: 'up to date', + unprinted: 1, + }, + }, + { + item_id: 'test-item-id-7', + properties: { + title: 'Hardcover Monthbooks', + status: 'up to date', + unprinted: 1, + test_empty: '', + test_null: null, + test_empty_array: [], + }, + }, + ]), }, XML: {}, FORM: {}, @@ -235,8 +254,24 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"item_id":"test-item-id","properties":{"title":"Hardcover Monthbooks","status":"up to date","unprinted":3}},{"item_id":"test-item-id","properties":{"title":"Hardcover Monthbooks","status":"up to date","unprinted":2}}]', + batch: JSON.stringify([ + { + item_id: 'test-item-id', + properties: { + title: 'Hardcover Monthbooks', + status: 'up to date', + unprinted: 3, + }, + }, + { + item_id: 'test-item-id', + properties: { + title: 'Hardcover Monthbooks', + status: 'up to date', + unprinted: 2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -259,7 +294,7 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: '["test-item-id-1","test-item-id-2"]', + batch: JSON.stringify(['test-item-id-1', 'test-item-id-2']), }, XML: {}, FORM: {}, @@ -282,7 +317,7 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: '["test-item-id-3"]', + batch: JSON.stringify(['test-item-id-3']), }, XML: {}, FORM: {}, diff --git a/test/integrations/destinations/bluecore/identifyTestData.ts b/test/integrations/destinations/bluecore/identifyTestData.ts index fee27ccf0fa..dbc6c3967c3 100644 --- a/test/integrations/destinations/bluecore/identifyTestData.ts +++ b/test/integrations/destinations/bluecore/identifyTestData.ts @@ -237,7 +237,7 @@ export const identifyData = [ body: [ { error: - "[Bluecore] traits.action must be 'identify' for identify action: Workflow: procWorkflow, Step: prepareIdentifyPayload, ChildStep: undefined, OriginalError: [Bluecore] traits.action must be 'identify' for identify action", + "[Bluecore] traits.action must be 'identify' for identify action: Workflow: procWorkflow, Step: prepareIdentifyPayload, ChildStep: undefined, OriginalError: [Bluecore] traits.action must be 'identify' for identify action", metadata: { destinationId: '', destinationType: '', diff --git a/test/integrations/destinations/blueshift/maskedSecrets.ts b/test/integrations/destinations/blueshift/maskedSecrets.ts new file mode 100644 index 00000000000..5c76d3abeb9 --- /dev/null +++ b/test/integrations/destinations/blueshift/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1)}`; +export const authHeader2 = `Basic ${base64Convertor(secret2)}`; diff --git a/test/integrations/destinations/blueshift/processor/data.ts b/test/integrations/destinations/blueshift/processor/data.ts index be235216217..803da039896 100644 --- a/test/integrations/destinations/blueshift/processor/data.ts +++ b/test/integrations/destinations/blueshift/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader2, secret2 } from '../maskedSecrets'; export const data = [ { name: 'blueshift', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, dataCenter: 'standard', }, }, @@ -91,7 +92,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'standard', }, @@ -133,7 +134,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -169,8 +170,8 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + eventApiKey: secret1, + usersApiKey: secret2, dataCenter: 'standard', }, }, @@ -230,7 +231,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -276,7 +277,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'standard', }, @@ -378,7 +379,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -443,7 +444,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'eu', }, @@ -541,7 +542,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.eu.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -602,7 +603,7 @@ export const data = [ { destination: { Config: { - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, dataCenter: 'standard', }, }, @@ -684,7 +685,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, dataCenter: 'standard', }, }, @@ -766,7 +767,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, dataCenter: 'standard', }, }, @@ -852,7 +853,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/customers', headers: { - Authorization: 'Basic YjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q5MjBlYzFlMmU=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -1023,7 +1024,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, dataCenter: 'eu', }, }, @@ -1070,7 +1071,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.eu.getblueshift.com/api/v1/customers', headers: { - Authorization: 'Basic YjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q5MjBlYzFlMmU=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -1112,7 +1113,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, dataCenter: 'eu', }, }, @@ -1180,7 +1181,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, dataCenter: 'eu', }, }, @@ -1248,7 +1249,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'eu', }, @@ -1347,7 +1348,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.eu.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1411,8 +1412,8 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + eventApiKey: secret1, + usersApiKey: secret2, dataCenter: 'eu', }, }, @@ -1472,7 +1473,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.eu.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1518,7 +1519,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'eu', }, @@ -1639,7 +1640,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'eu', }, @@ -1760,7 +1761,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'standard', }, @@ -1845,7 +1846,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/blueshift/router/data.ts b/test/integrations/destinations/blueshift/router/data.ts index 7104beb873f..7f9b1645223 100644 --- a/test/integrations/destinations/blueshift/router/data.ts +++ b/test/integrations/destinations/blueshift/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader2, secret2 } from '../maskedSecrets'; export const data = [ { name: 'blueshift', @@ -12,7 +13,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', datacenterEU: false, }, @@ -44,7 +45,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', datacenterEU: false, }, @@ -86,7 +87,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, datacenterEU: false, }, }, @@ -164,7 +165,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -186,7 +187,7 @@ export const data = [ statusCode: 200, destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', datacenterEU: false, }, @@ -221,7 +222,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.getblueshift.com/api/v1/event', @@ -231,7 +232,7 @@ export const data = [ statusCode: 200, destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', datacenterEU: false, }, @@ -244,7 +245,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/customers', headers: { - Authorization: 'Basic YjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q5MjBlYzFlMmU=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -291,7 +292,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, datacenterEU: false, }, }, diff --git a/test/integrations/destinations/branch/processor/data.ts b/test/integrations/destinations/branch/processor/data.ts index dc1bdd33bca..ba8fb3f6d19 100644 --- a/test/integrations/destinations/branch/processor/data.ts +++ b/test/integrations/destinations/branch/processor/data.ts @@ -1,7 +1,53 @@ -export const data = [ +/** + * Auto-migrated and optimized test cases + * Generated on: 2024-12-30T11:04:59.426Z + */ + +import { ProcessorTestData } from '../../../testTypes'; +import { Metadata } from '../../../../../src/types'; + +const baseMetadata: Partial = { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-30T11:04:58.693Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, +}; + +export const data: ProcessorTestData[] = [ { + id: 'processor-1735556699424', name: 'branch', description: 'Test 0', + scenario: + 'Success scenario where the event will be mapped to standard event through default mappings', + successCriteria: 'Should hit the standard endpoint', feature: 'processor', module: 'destination', version: 'v0', @@ -9,21 +55,6 @@ export const data = [ request: { body: [ { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, message: { anonymousId: 'sampath', channel: 'web', @@ -80,8 +111,30 @@ export const data = [ type: 'track', userId: 'sampath', }, + metadata: baseMetadata, + destination: { + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', + DestinationDefinition: { + DisplayName: 'Branch Metrics', + ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', + Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], + method: 'POST', }, }, output: { @@ -129,6 +182,7 @@ export const data = [ files: {}, userId: 'sampath', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -136,8 +190,11 @@ export const data = [ }, }, { + id: 'processor-1735556699424', name: 'branch', description: 'Test 1', + scenario: 'Success scenario with identify event', + successCriteria: 'Should hit the custom endpoint with userId as event name', feature: 'processor', module: 'destination', version: 'v0', @@ -145,21 +202,6 @@ export const data = [ request: { body: [ { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, message: { anonymousId: 'sampath', channel: 'web', @@ -212,8 +254,30 @@ export const data = [ type: 'identify', userId: 'sampath', }, + metadata: baseMetadata, + destination: { + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', + DestinationDefinition: { + DisplayName: 'Branch Metrics', + ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', + Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], + method: 'POST', }, }, output: { @@ -261,6 +325,7 @@ export const data = [ files: {}, userId: 'sampath', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -268,8 +333,11 @@ export const data = [ }, }, { + id: 'processor-1735556699424', name: 'branch', description: 'Test 2', + scenario: 'Default processor scenario', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', @@ -277,112 +345,6 @@ export const data = [ request: { body: [ { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - integrations: { - All: true, - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'page', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - statTags: { - destType: 'BRANCH', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - }, - error: 'Message type is not supported', - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 3', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, message: { anonymousId: 'sampath', channel: 'web', @@ -409,7 +371,7 @@ export const data = [ }, locale: 'en-US', os: { - name: 'watchos', + name: 'tvos', }, screen: { density: 2, @@ -437,8 +399,30 @@ export const data = [ type: 'track', userId: 'sampath', }, + metadata: baseMetadata, + destination: { + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', + DestinationDefinition: { + DisplayName: 'Branch Metrics', + ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', + Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], + method: 'POST', }, }, output: { @@ -464,7 +448,7 @@ export const data = [ }, ], user_data: { - os: 'watchos', + os: 'tvos', app_version: '1.0.0', screen_dpi: 2, developer_identity: 'sampath', @@ -485,6 +469,7 @@ export const data = [ files: {}, userId: 'sampath', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -492,8 +477,11 @@ export const data = [ }, }, { + id: 'processor-1735556699424', name: 'branch', - description: 'Test 4', + description: 'Test 3', + scenario: 'Successful scenario with track event but without any products', + successCriteria: 'The transformed payload should not contain any content_items', feature: 'processor', module: 'destination', version: 'v0', @@ -501,21 +489,6 @@ export const data = [ request: { body: [ { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, message: { anonymousId: 'sampath', channel: 'web', @@ -533,6 +506,7 @@ export const data = [ manufacturer: 'Google', model: 'AOSP on IA Emulator', name: 'generic_x86_arm', + type: 'ios', attTrackingStatus: 3, }, ip: '0.0.0.0', @@ -542,7 +516,8 @@ export const data = [ }, locale: 'en-US', os: { - name: 'ipados', + name: 'iOS', + version: '14.4.1', }, screen: { density: 2, @@ -560,9 +535,6 @@ export const data = [ }, messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', originalTimestamp: '2020-01-17T04:53:51.185Z', - properties: { - name: 'sampath', - }, receivedAt: '2020-01-17T10:23:52.688+05:30', request_ip: '[::1]:64059', sentAt: '2020-01-17T04:53:52.667Z', @@ -570,8 +542,30 @@ export const data = [ type: 'track', userId: 'sampath', }, + metadata: baseMetadata, + destination: { + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', + DestinationDefinition: { + DisplayName: 'Branch Metrics', + ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', + Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], + method: 'POST', }, }, output: { @@ -591,13 +585,9 @@ export const data = [ params: {}, body: { JSON: { - content_items: [ - { - $product_name: 'sampath', - }, - ], user_data: { - os: 'ipados', + os: 'iOS', + os_version: '14.4.1', app_version: '1.0.0', screen_dpi: 2, developer_identity: 'sampath', @@ -618,6 +608,7 @@ export const data = [ files: {}, userId: 'sampath', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -625,8 +616,11 @@ export const data = [ }, }, { + id: 'processor-1735556699425', name: 'branch', - description: 'Test 5', + description: 'Test 4', + scenario: 'Failure scenario when event name is not present', + successCriteria: 'Should return error message for missing event name', feature: 'processor', module: 'destination', version: 'v0', @@ -634,31 +628,10 @@ export const data = [ request: { body: [ { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, message: { anonymousId: 'sampath', channel: 'web', context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, device: { adTrackingEnabled: true, advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -666,6 +639,7 @@ export const data = [ manufacturer: 'Google', model: 'AOSP on IA Emulator', name: 'generic_x86_arm', + type: 'ios', attTrackingStatus: 3, }, ip: '0.0.0.0', @@ -675,10 +649,8 @@ export const data = [ }, locale: 'en-US', os: { - name: 'tvos', - }, - screen: { - density: 2, + name: 'iOS', + version: '14.4.1', }, traits: { anonymousId: 'sampath', @@ -687,753 +659,42 @@ export const data = [ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', }, - event: 'product added', integrations: { All: true, }, messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', originalTimestamp: '2020-01-17T04:53:51.185Z', - properties: { - name: 'sampath', - }, - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'track', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api2.branch.io/v2/event/standard', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json', - }, - params: {}, - body: { - JSON: { - content_items: [ - { - $product_name: 'sampath', - }, - ], - user_data: { - os: 'tvos', - app_version: '1.0.0', - screen_dpi: 2, - developer_identity: 'sampath', - idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - limit_ad_tracking: false, - model: 'AOSP on IA Emulator', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - name: 'ADD_TO_CART', - branch_key: '', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: 'sampath', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 6', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - device: { - adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - manufacturer: 'Google', - model: 'AOSP on IA Emulator', - name: 'generic_x86_arm', - type: 'ios', - attTrackingStatus: 3, - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - os: { - name: 'iOS', - version: '14.4.1', - }, - screen: { - density: 2, - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - event: 'product added', - integrations: { - All: true, - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'track', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api2.branch.io/v2/event/standard', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json', - }, - params: {}, - body: { - JSON: { - user_data: { - os: 'iOS', - os_version: '14.4.1', - app_version: '1.0.0', - screen_dpi: 2, - developer_identity: 'sampath', - idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - limit_ad_tracking: false, - model: 'AOSP on IA Emulator', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - name: 'ADD_TO_CART', - branch_key: '', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: 'sampath', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 7', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - device: { - adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - manufacturer: 'Google', - model: 'AOSP on IA Emulator', - name: 'generic_x86_arm', - type: 'ios', - attTrackingStatus: 3, - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - screen: { - density: 2, - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - event: 'product added', - integrations: { - All: true, - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'track', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api2.branch.io/v2/event/standard', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json', - }, - params: {}, - body: { - JSON: { - user_data: { - app_version: '1.0.0', - screen_dpi: 2, - developer_identity: 'sampath', - limit_ad_tracking: false, - model: 'AOSP on IA Emulator', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - name: 'ADD_TO_CART', - branch_key: '', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: 'sampath', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 8', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - device: { - adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - manufacturer: 'Google', - model: 'AOSP on IA Emulator', - name: 'generic_x86_arm', - type: 'ios', - attTrackingStatus: 3, - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - os: { - name: 'iOS', - version: '14.4.1', - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - event: 'product added', - integrations: { - All: true, - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'track', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api2.branch.io/v2/event/standard', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json', - }, - params: {}, - body: { - JSON: { - user_data: { - os: 'iOS', - os_version: '14.4.1', - developer_identity: 'sampath', - idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - limit_ad_tracking: false, - model: 'AOSP on IA Emulator', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - name: 'ADD_TO_CART', - branch_key: '', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: 'sampath', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 9', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - device: { - adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - manufacturer: 'Google', - model: 'AOSP on IA Emulator', - name: 'generic_x86_arm', - type: 'ios', - attTrackingStatus: 3, - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - os: { - name: 'iOS', - version: '14.4.1', - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - integrations: { - All: true, - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'track', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: 'Event name is required', - statTags: { - destType: 'BRANCH', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - }, - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 10', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - device: { - adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - manufacturer: 'Google', - model: 'AOSP on IA Emulator', - name: 'generic_x86_arm', - type: 'Android', - attTrackingStatus: 2, - brand: 'testBrand', - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - os: { - name: 'Android', - version: '9', - }, - screen: { - density: 2, - height: 1794, - width: 1080, - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - integrations: { - All: true, - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', receivedAt: '2020-01-17T10:23:52.688+05:30', request_ip: '[::1]:64059', sentAt: '2020-01-17T04:53:52.667Z', timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'identify', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api2.branch.io/v2/event/custom', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json', - }, - params: {}, - body: { - JSON: { - custom_data: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - content_items: [{}], - user_data: { - os: 'Android', - os_version: '9', - app_version: '1.0.0', - model: 'AOSP on IA Emulator', - brand: 'testBrand', - screen_dpi: 2, - screen_height: 1794, - screen_width: 1080, - developer_identity: 'sampath', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - aaid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - limit_ad_tracking: true, - }, - name: 'sampath', - branch_key: '', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, + type: 'track', userId: 'sampath', }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 11', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { + metadata: baseMetadata, destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', DestinationDefinition: { DisplayName: 'Branch Metrics', ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, }, Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', + WorkspaceID: 'default-workspace', Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - device: { - adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - manufacturer: 'Google', - model: 'AOSP on IA Emulator', - name: 'generic_x86_arm', - type: 'ios', - attTrackingStatus: 2, - brand: 'testBrand', - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - os: { - name: 'iOS', - version: '14.4.1', - }, - screen: { - density: 2, - height: 1794, - width: 1080, - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - integrations: { - All: true, - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'identify', - userId: 'sampath', + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, ], + method: 'POST', }, }, output: { @@ -1441,86 +702,38 @@ export const data = [ status: 200, body: [ { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api2.branch.io/v2/event/custom', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json', - }, - params: {}, - body: { - JSON: { - custom_data: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - content_items: [{}], - user_data: { - os: 'iOS', - os_version: '14.4.1', - app_version: '1.0.0', - model: 'AOSP on IA Emulator', - brand: 'testBrand', - screen_dpi: 2, - screen_height: 1794, - screen_width: 1080, - developer_identity: 'sampath', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - limit_ad_tracking: true, - }, - name: 'sampath', - branch_key: '', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: 'sampath', + metadata: baseMetadata, + statusCode: 400, + error: 'Event name is required', + statTags: { + destType: 'BRANCH', + destinationId: 'default-destination', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspace', }, - statusCode: 200, }, ], }, }, }, { + id: 'processor-1735556699425', name: 'branch', - description: 'Map event name to branch standard event name in track call', + description: 'Test 5', + scenario: 'Default processor scenario', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - branchKey: 'test_branch_key', - eventsMapping: [ - { - from: 'Order Completed', - to: 'PURCHASE', - }, - ], - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, message: { anonymousId: 'anonId123', channel: 'web', @@ -1561,7 +774,7 @@ export const data = [ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', }, - event: 'Order Completed', + event: 'Some Random Event', integrations: { All: true, }, @@ -1582,6 +795,33 @@ export const data = [ type: 'track', userId: 'userId123', }, + metadata: baseMetadata, + destination: { + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', + DestinationDefinition: { + DisplayName: 'Branch Metrics', + ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', + Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: 'test_branch_key', + eventsMapping: [ + { + from: 'Some Random Event', + to: 'PURCHASE', + }, + ], + useNativeSDK: false, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], }, @@ -1640,6 +880,7 @@ export const data = [ files: {}, userId: 'anonId123', }, + metadata: baseMetadata, statusCode: 200, }, ], diff --git a/test/integrations/destinations/branch/router/data.ts b/test/integrations/destinations/branch/router/data.ts index 6451c463f18..3076adf1758 100644 --- a/test/integrations/destinations/branch/router/data.ts +++ b/test/integrations/destinations/branch/router/data.ts @@ -1,7 +1,18 @@ -export const data = [ +/** + * Auto-migrated and optimized test cases + * Generated on: 2024-12-30T12:23:26.084Z + */ + +import { RouterTestData } from '../../../testTypes'; +import { Metadata } from '../../../../../src/types'; + +export const data: RouterTestData[] = [ { + id: 'router-1735561406084', name: 'branch', description: 'Test 0', + scenario: 'Default router scenario', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -10,19 +21,6 @@ export const data = [ body: { input: [ { - destination: { - Config: { branchKey: '', useNativeSDK: false }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - metadata: { jobId: 1, userId: 'u1' }, message: { anonymousId: 'sampath', channel: 'web', @@ -34,19 +32,34 @@ export const data = [ version: '1.0.0', }, ip: '0.0.0.0', - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, locale: 'en-US', - os: { name: 'iOS', version: '' }, - screen: { density: 2 }, - traits: { anonymousId: 'sampath', email: 'sampath@gmail.com' }, + os: { + name: 'iOS', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', }, event: 'product added', - integrations: { All: true }, + integrations: { + All: true, + }, messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', originalTimestamp: '2020-01-17T04:53:51.185Z', - properties: { name: 'sampath' }, + properties: { + name: 'sampath', + }, receivedAt: '2020-01-17T10:23:52.688+05:30', request_ip: '[::1]:64059', sentAt: '2020-01-17T04:53:52.667Z', @@ -54,21 +67,61 @@ export const data = [ type: 'track', userId: 'sampath', }, - }, - { + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-30T12:23:25.430Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, destination: { - Config: { branchKey: '', useNativeSDK: false }, + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', DestinationDefinition: { DisplayName: 'Branch Metrics', ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, }, Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', + WorkspaceID: 'default-workspace', Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: { jobId: 2, userId: 'u1' }, + }, + { message: { anonymousId: 'sampath', channel: 'web', @@ -80,15 +133,28 @@ export const data = [ version: '1.0.0', }, ip: '0.0.0.0', - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, locale: 'en-US', - os: { name: 'iOS', version: '' }, - screen: { density: 2 }, + os: { + name: 'iOS', + version: '', + }, + screen: { + density: 2, + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', }, - integrations: { All: true }, - traits: { anonymousId: 'sampath', email: 'sampath@gmail.com' }, + integrations: { + All: true, + }, + traits: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', originalTimestamp: '2020-01-17T04:53:51.185Z', receivedAt: '2020-01-17T10:23:52.688+05:30', @@ -98,6 +164,59 @@ export const data = [ type: 'identify', userId: 'sampath', }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-30T12:23:25.430Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + } as unknown as Metadata, + destination: { + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', + DestinationDefinition: { + DisplayName: 'Branch Metrics', + ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', + Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], destType: 'branch', @@ -116,13 +235,20 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api2.branch.io/v2/event/standard', - headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, params: {}, body: { JSON: { branch_key: '', name: 'ADD_TO_CART', - content_items: [{ $product_name: 'sampath' }], + content_items: [ + { + $product_name: 'sampath', + }, + ], user_data: { os: 'iOS', os_version: '', @@ -140,21 +266,63 @@ export const data = [ files: {}, userId: 'sampath', }, - metadata: [{ jobId: 1, userId: 'u1' }], - batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-30T12:23:25.430Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], statusCode: 200, destination: { - Config: { branchKey: '', useNativeSDK: false }, + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', DestinationDefinition: { DisplayName: 'Branch Metrics', ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, }, Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', + WorkspaceID: 'default-workspace', Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: false, }, { batchedRequest: { @@ -162,13 +330,19 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api2.branch.io/v2/event/custom', - headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, params: {}, body: { JSON: { branch_key: '', name: 'sampath', - custom_data: { anonymousId: 'sampath', email: 'sampath@gmail.com' }, + custom_data: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, content_items: [{}], user_data: { os: 'iOS', @@ -187,21 +361,63 @@ export const data = [ files: {}, userId: 'sampath', }, - metadata: [{ jobId: 2, userId: 'u1' }], - batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-30T12:23:25.430Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], statusCode: 200, destination: { - Config: { branchKey: '', useNativeSDK: false }, + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', DestinationDefinition: { DisplayName: 'Branch Metrics', ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, }, Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', + WorkspaceID: 'default-workspace', Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: false, }, ], }, diff --git a/test/integrations/destinations/braze/dataDelivery/business.ts b/test/integrations/destinations/braze/dataDelivery/business.ts index 4997c5ffaeb..a69a8fc20c8 100644 --- a/test/integrations/destinations/braze/dataDelivery/business.ts +++ b/test/integrations/destinations/braze/dataDelivery/business.ts @@ -1,6 +1,7 @@ import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; +import { authHeader1 } from '../maskedSecrets'; const BRAZE_USERS_TRACK_ENDPOINT = 'https://rest.iad-03.braze.com/users/track'; @@ -8,7 +9,7 @@ const partner = 'RudderStack'; const headers = { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }; @@ -128,7 +129,7 @@ const BrazePurchaseEvent = { const metadataArray = [generateMetadata(1), generateMetadata(2), generateMetadata(3)]; const errorMessages = { - message_1: '{"events_processed":2,"purchases_processed":1,"message":"success"}', + message_1: JSON.stringify({ events_processed: 2, purchases_processed: 1, message: 'success' }), message_2: '{"events_processed":1,"message":"success","errors":[{"type":"\'external_id\', \'braze_id\', \'user_alias\', \'email\' or \'phone\' is required","input_array":"events","index":1},{"type":"\'quantity\' is not valid","input_array":"purchases","index":0}]}', message_3: @@ -351,17 +352,17 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ output: { response: [ { - error: '{"message":"Invalid API Key"}', + error: JSON.stringify({ message: 'Invalid API Key' }), statusCode: 401, metadata: generateMetadata(1), }, { - error: '{"message":"Invalid API Key"}', + error: JSON.stringify({ message: 'Invalid API Key' }), statusCode: 401, metadata: generateMetadata(2), }, { - error: '{"message":"Invalid API Key"}', + error: JSON.stringify({ message: 'Invalid API Key' }), statusCode: 401, metadata: generateMetadata(3), }, diff --git a/test/integrations/destinations/braze/dataDelivery/data.ts b/test/integrations/destinations/braze/dataDelivery/data.ts index 2596a4b9592..1d46883b975 100644 --- a/test/integrations/destinations/braze/dataDelivery/data.ts +++ b/test/integrations/destinations/braze/dataDelivery/data.ts @@ -1,6 +1,7 @@ import MockAdapter from 'axios-mock-adapter'; import { testScenariosForV1API } from './business'; import { otherScenariosV1 } from './other'; +import { authHeader1 } from '../maskedSecrets'; export const existingTestData = [ { @@ -18,7 +19,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -79,7 +80,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -140,7 +141,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -211,7 +212,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -269,7 +270,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -337,7 +338,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -404,7 +405,7 @@ export const existingTestData = [ }, { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -431,7 +432,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -499,7 +500,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -549,7 +550,7 @@ export const existingTestData = [ message: 'Request for braze Processed Successfully', response: [ { - error: '{"aliases_processed":1,"message":"success"}', + error: JSON.stringify({ aliases_processed: 1, message: 'success' }), statusCode: 201, metadata: { jobId: 2, @@ -587,7 +588,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -637,7 +638,7 @@ export const existingTestData = [ status: 401, response: [ { - error: '{"code":400,"message":"Bad Req","status":"Fail Case"}', + error: JSON.stringify({ code: 400, message: 'Bad Req', status: 'Fail Case' }), statusCode: 401, metadata: { jobId: 2, @@ -686,7 +687,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { diff --git a/test/integrations/destinations/braze/dataDelivery/other.ts b/test/integrations/destinations/braze/dataDelivery/other.ts index 9353899a654..61e1a65da2f 100644 --- a/test/integrations/destinations/braze/dataDelivery/other.ts +++ b/test/integrations/destinations/braze/dataDelivery/other.ts @@ -38,8 +38,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/braze/deleteUsers/data.ts b/test/integrations/destinations/braze/deleteUsers/data.ts index cad61fd12d8..ae2d65a8fab 100644 --- a/test/integrations/destinations/braze/deleteUsers/data.ts +++ b/test/integrations/destinations/braze/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { secret1, secret2 } from '../maskedSecrets'; + export const data = [ { name: 'braze', @@ -167,7 +169,7 @@ export const data = [ ], config: { dataCenter: 'US-03', - restApiKey: '1234', + restApiKey: secret2, }, }, ], @@ -353,7 +355,7 @@ export const data = [ ], config: { dataCenter: 'US-03', - restApiKey: '1234', + restApiKey: secret2, }, }, ], @@ -461,7 +463,7 @@ export const data = [ }, ], config: { - restApiKey: 'b1bd90e2-d203-480a-962c-f7bb03ea0afe', + restApiKey: secret1, dataCenter: 'US-03', }, }, diff --git a/test/integrations/destinations/braze/maskedSecrets.ts b/test/integrations/destinations/braze/maskedSecrets.ts new file mode 100644 index 00000000000..c598977b6a1 --- /dev/null +++ b/test/integrations/destinations/braze/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; +export const secret2 = path.basename(__dirname) + 1; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/braze/network.ts b/test/integrations/destinations/braze/network.ts index bcfa78de5de..a2c4f9dff88 100644 --- a/test/integrations/destinations/braze/network.ts +++ b/test/integrations/destinations/braze/network.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2 } from './maskedSecrets'; const dataDeliveryMocksData = [ { httpReq: { @@ -13,7 +14,7 @@ const dataDeliveryMocksData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -35,7 +36,7 @@ const dataDeliveryMocksData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -57,7 +58,7 @@ const dataDeliveryMocksData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -82,7 +83,7 @@ const dataDeliveryMocksData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -104,7 +105,7 @@ const dataDeliveryMocksData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -126,7 +127,7 @@ const dataDeliveryMocksData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -197,7 +198,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer 1234', + Authorization: authHeader2, }, }, httpRes: { @@ -269,7 +270,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer 1234', + Authorization: authHeader2, }, }, httpRes: { @@ -288,7 +289,7 @@ const deleteNwData = [ data: { external_ids: ['test_user_id51'] }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer 1234', + Authorization: authHeader2, }, }, httpRes: { @@ -311,7 +312,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer 1234', + Authorization: authHeader2, }, }, httpRes: { @@ -339,7 +340,7 @@ const deleteNwData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -386,7 +387,7 @@ const deleteNwData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -421,7 +422,7 @@ const deleteNwData = [ 'user_aliases', ], }, - headers: { Authorization: 'Bearer dummyApiKey' }, + headers: { Authorization: authHeader1 }, url: 'https://rest.iad-03.braze.com/users/export/ids', }, httpRes: { @@ -511,7 +512,7 @@ const deleteNwData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, diff --git a/test/integrations/destinations/braze/processor/data.ts b/test/integrations/destinations/braze/processor/data.ts index 9b6f6dac65b..10a0546bf5b 100644 --- a/test/integrations/destinations/braze/processor/data.ts +++ b/test/integrations/destinations/braze/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'braze', @@ -11,10 +12,10 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, - dataCenter: 'us-01', + dataCenter: 'au-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -86,11 +87,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://rest.iad-01.braze.com/users/track', + endpoint: 'https://rest.au-01.braze.com/users/track', headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -135,7 +136,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -224,9 +225,10 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -298,7 +300,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -341,9 +343,10 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -419,7 +422,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -469,7 +472,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'eu-01', @@ -547,7 +550,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -597,7 +600,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -674,7 +677,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -717,10 +720,11 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, enableNestedArrayOperations: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -800,7 +804,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -861,9 +865,10 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -970,7 +975,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1132,9 +1137,10 @@ export const data = [ }, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -1231,9 +1237,10 @@ export const data = [ }, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -1262,7 +1269,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1300,7 +1307,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -1383,7 +1390,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1421,9 +1428,10 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -1530,7 +1538,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1601,9 +1609,10 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -1710,7 +1719,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1781,10 +1790,11 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, enableNestedArrayOperations: true, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -1908,7 +1918,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2012,10 +2022,11 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, enableNestedArrayOperations: true, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -2133,7 +2144,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2229,7 +2240,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -2310,7 +2321,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2360,7 +2371,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -2441,7 +2452,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2491,7 +2502,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'US-03', @@ -2556,7 +2567,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2597,7 +2608,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'US-03', @@ -2680,7 +2691,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'US-03', @@ -2763,7 +2774,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -2845,7 +2856,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2898,7 +2909,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -3005,7 +3016,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -3119,10 +3130,11 @@ export const data = [ }, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, enableSubscriptionGroupInGroupCall: true, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -3151,7 +3163,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -3240,10 +3252,11 @@ export const data = [ }, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, enableSubscriptionGroupInGroupCall: true, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -3272,7 +3285,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -3311,9 +3324,10 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -3393,7 +3407,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -3442,10 +3456,11 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, sendPurchaseEventWithExtraProperties: true, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -3552,7 +3567,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -3633,7 +3648,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -3711,10 +3726,11 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, sendPurchaseEventWithExtraProperties: true, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -3856,7 +3872,7 @@ export const data = [ files: {}, headers: { Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -3883,9 +3899,10 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -3959,7 +3976,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -4029,7 +4046,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -4091,7 +4108,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -4196,9 +4213,10 @@ export const data = [ }, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -4295,9 +4313,10 @@ export const data = [ }, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', diff --git a/test/integrations/destinations/braze/router/data.ts b/test/integrations/destinations/braze/router/data.ts index 8ab04c5d04c..02b6506b7f3 100644 --- a/test/integrations/destinations/braze/router/data.ts +++ b/test/integrations/destinations/braze/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'braze', @@ -12,7 +13,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'eu-01', @@ -68,7 +69,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -122,7 +123,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -150,7 +151,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -178,7 +179,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -200,7 +201,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -222,7 +223,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -268,7 +269,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -320,7 +321,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -354,7 +355,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -390,7 +391,7 @@ export const data = [ statusCode: 200, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'eu-01', @@ -432,7 +433,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -501,7 +502,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -570,7 +571,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -623,7 +624,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -676,7 +677,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -738,7 +739,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -828,7 +829,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -863,7 +864,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], diff --git a/test/integrations/destinations/campaign_manager/dataDelivery/business.ts b/test/integrations/destinations/campaign_manager/dataDelivery/business.ts index e663f3212a8..040d2392adb 100644 --- a/test/integrations/destinations/campaign_manager/dataDelivery/business.ts +++ b/test/integrations/destinations/campaign_manager/dataDelivery/business.ts @@ -1,12 +1,13 @@ import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV0Payload, generateProxyV1Payload } from '../../../testUtils'; +import { authHeader1 } from '../../am/maskedSecrets'; // Boilerplate data for the test cases // ====================================== const commonHeaders = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }; diff --git a/test/integrations/destinations/campaign_manager/dataDelivery/oauth.ts b/test/integrations/destinations/campaign_manager/dataDelivery/oauth.ts index 288a06bfe6f..44f5aeb7638 100644 --- a/test/integrations/destinations/campaign_manager/dataDelivery/oauth.ts +++ b/test/integrations/destinations/campaign_manager/dataDelivery/oauth.ts @@ -1,10 +1,12 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload, generateProxyV0Payload } from '../../../testUtils'; +import { defaultAccessToken } from '../../../common/secrets'; +import { authHeader1 } from '../../am/maskedSecrets'; // Boilerplat data for the test cases // ====================================== const commonHeaders = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }; @@ -331,8 +333,34 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ output: { 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.","errors":[{"message":"Login Required.","domain":"global","reason":"required","location":"Authorization","locationType":"header"}],"status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"CREDENTIALS_MISSING","domain":"googleapis.com","metadata":{"method":"google.ads.xfa.op.v4.DfareportingConversions.Batchinsert","service":"googleapis.com"}}]}}', + error: JSON.stringify({ + 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.', + errors: [ + { + message: 'Login Required.', + domain: 'global', + reason: 'required', + location: 'Authorization', + locationType: 'header', + }, + ], + status: 'UNAUTHENTICATED', + details: [ + { + '@type': 'type.googleapis.com/google.rpc.ErrorInfo', + reason: 'CREDENTIALS_MISSING', + domain: 'googleapis.com', + metadata: { + method: 'google.ads.xfa.op.v4.DfareportingConversions.Batchinsert', + service: 'googleapis.com', + }, + }, + ], + }, + }), statusCode: 401, metadata: { jobId: 1, @@ -342,7 +370,7 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -394,8 +422,31 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"code":403,"message":"Request had insufficient authentication scopes.","errors":[{"message":"Insufficient Permission","domain":"global","reason":"insufficientPermissions"}],"status":"PERMISSION_DENIED","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"ACCESS_TOKEN_SCOPE_INSUFFICIENT","domain":"googleapis.com","metadata":{"service":"gmail.googleapis.com","method":"caribou.api.proto.MailboxService.GetProfile"}}]}}', + error: JSON.stringify({ + error: { + code: 403, + message: 'Request had insufficient authentication scopes.', + errors: [ + { + message: 'Insufficient Permission', + domain: 'global', + reason: 'insufficientPermissions', + }, + ], + status: 'PERMISSION_DENIED', + details: [ + { + '@type': 'type.googleapis.com/google.rpc.ErrorInfo', + reason: 'ACCESS_TOKEN_SCOPE_INSUFFICIENT', + domain: 'googleapis.com', + metadata: { + service: 'gmail.googleapis.com', + method: 'caribou.api.proto.MailboxService.GetProfile', + }, + }, + ], + }, + }), statusCode: 403, metadata: { jobId: 1, @@ -405,7 +456,7 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -457,8 +508,9 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"code":403,"message":"invalid_grant","error_description":"Bad accesss"}}', + error: JSON.stringify({ + error: { code: 403, message: 'invalid_grant', error_description: 'Bad accesss' }, + }), statusCode: 403, metadata: { jobId: 1, @@ -468,7 +520,7 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -519,8 +571,10 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":"unauthorized","error_description":"Access token expired: 2020-10-20T12:00:00.000Z"}', + error: JSON.stringify({ + error: 'unauthorized', + error_description: 'Access token expired: 2020-10-20T12:00:00.000Z', + }), statusCode: 401, metadata: { jobId: 1, @@ -530,7 +584,7 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, diff --git a/test/integrations/destinations/campaign_manager/dataDelivery/other.ts b/test/integrations/destinations/campaign_manager/dataDelivery/other.ts index 1c0c45728c0..fe006755762 100644 --- a/test/integrations/destinations/campaign_manager/dataDelivery/other.ts +++ b/test/integrations/destinations/campaign_manager/dataDelivery/other.ts @@ -1,6 +1,6 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV0Payload, generateProxyV1Payload } from '../../../testUtils'; - +import { defaultAccessToken } from '../../../common/secrets'; export const otherScenariosV0 = [ { id: 'cm360_v0_other_scenario_1', @@ -258,8 +258,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: { jobId: 1, @@ -269,7 +274,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -327,7 +332,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -385,7 +390,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -443,7 +448,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -502,7 +507,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, diff --git a/test/integrations/destinations/campaign_manager/maskedSecrets.ts b/test/integrations/destinations/campaign_manager/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/campaign_manager/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/campaign_manager/network.ts b/test/integrations/destinations/campaign_manager/network.ts index b7c23012481..11121559317 100644 --- a/test/integrations/destinations/campaign_manager/network.ts +++ b/test/integrations/destinations/campaign_manager/network.ts @@ -1,5 +1,7 @@ +import { authHeader1 } from '../am/maskedSecrets'; + const commonHeaders = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }; diff --git a/test/integrations/destinations/campaign_manager/processor/data.ts b/test/integrations/destinations/campaign_manager/processor/data.ts index 9aa41691c68..8f4351815fe 100644 --- a/test/integrations/destinations/campaign_manager/processor/data.ts +++ b/test/integrations/destinations/campaign_manager/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'campaign_manager', @@ -79,7 +80,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -110,7 +111,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchinsert', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -148,7 +149,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -239,7 +240,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -270,7 +271,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchupdate', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -300,7 +301,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -393,7 +394,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -419,7 +420,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -472,7 +473,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -498,7 +499,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -599,7 +600,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -630,7 +631,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchinsert', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -662,7 +663,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -753,7 +754,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -784,7 +785,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchinsert', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -816,7 +817,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -907,7 +908,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -940,7 +941,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchupdate', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1000,7 +1001,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1091,7 +1092,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1124,7 +1125,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchupdate', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1180,7 +1181,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1260,7 +1261,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1293,7 +1294,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchupdate', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1329,7 +1330,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, diff --git a/test/integrations/destinations/campaign_manager/router/data.ts b/test/integrations/destinations/campaign_manager/router/data.ts index 5b4e5bcce4c..3b237887aec 100644 --- a/test/integrations/destinations/campaign_manager/router/data.ts +++ b/test/integrations/destinations/campaign_manager/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'campaign_manager', @@ -12,7 +13,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -92,7 +93,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -172,7 +173,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -271,7 +272,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/437689/conversions/batchinsert', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -309,7 +310,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -337,7 +338,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/437689/conversions/batchupdate', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -373,7 +374,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -409,7 +410,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -445,7 +446,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -487,7 +488,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -529,7 +530,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -587,7 +588,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/437689/conversions/batchinsert', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -645,7 +646,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -654,7 +655,7 @@ export const data = [ }, { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -663,7 +664,7 @@ export const data = [ }, { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -701,7 +702,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -743,7 +744,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -785,7 +786,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -843,7 +844,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/437689/conversions/batchupdate', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -884,7 +885,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -893,7 +894,7 @@ export const data = [ }, { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -921,7 +922,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/437689/conversions/batchinsert', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -953,7 +954,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -991,7 +992,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1032,7 +1033,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1073,7 +1074,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1126,7 +1127,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1160,7 +1161,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1194,7 +1195,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, diff --git a/test/integrations/destinations/candu/maskedSecrets.ts b/test/integrations/destinations/candu/maskedSecrets.ts new file mode 100644 index 00000000000..74d160ff192 --- /dev/null +++ b/test/integrations/destinations/candu/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1)}`; diff --git a/test/integrations/destinations/candu/processor/data.ts b/test/integrations/destinations/candu/processor/data.ts index 22bd0b35672..a81317afb4f 100644 --- a/test/integrations/destinations/candu/processor/data.ts +++ b/test/integrations/destinations/candu/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'candu', @@ -42,7 +43,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -122,7 +123,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { - Authorization: 'Basic RlhMa0xVRWhHSnl2bVk0', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -198,7 +199,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -280,7 +281,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { - Authorization: 'Basic RlhMa0xVRWhHSnl2bVk0', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -358,7 +359,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -484,7 +485,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -753,7 +754,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -885,7 +886,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -965,7 +966,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { - Authorization: 'Basic RlhMa0xVRWhHSnl2bVk0', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1042,7 +1043,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -1124,7 +1125,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { - Authorization: 'Basic RlhMa0xVRWhHSnl2bVk0', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1202,7 +1203,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -1284,7 +1285,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { - Authorization: 'Basic RlhMa0xVRWhHSnl2bVk0', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/candu/router/data.ts b/test/integrations/destinations/candu/router/data.ts index 02e1caa3e93..2498286c4c7 100644 --- a/test/integrations/destinations/candu/router/data.ts +++ b/test/integrations/destinations/candu/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'candu', @@ -40,7 +41,7 @@ export const data = [ }, ResponseRules: {}, }, - Config: { apiKey: 'FXLkLUEhGJyvmY4' }, + Config: { apiKey: secret1 }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -109,7 +110,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { - Authorization: 'Basic RlhMa0xVRWhHSnl2bVk0', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -167,7 +168,7 @@ export const data = [ }, ResponseRules: {}, }, - Config: { apiKey: 'FXLkLUEhGJyvmY4' }, + Config: { apiKey: secret1 }, Enabled: true, Transformations: [], IsProcessorEnabled: true, diff --git a/test/integrations/destinations/canny/maskedSecrets.ts b/test/integrations/destinations/canny/maskedSecrets.ts new file mode 100644 index 00000000000..aaf5a0cbb37 --- /dev/null +++ b/test/integrations/destinations/canny/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${secret1}`; +export const authHeader2 = `Basic ${secret2}`; diff --git a/test/integrations/destinations/canny/network.ts b/test/integrations/destinations/canny/network.ts index db1b6396327..68ff8b638dd 100644 --- a/test/integrations/destinations/canny/network.ts +++ b/test/integrations/destinations/canny/network.ts @@ -1,3 +1,5 @@ +import { secret2 } from './maskedSecrets'; + export const networkCallsData = [ { httpReq: { @@ -5,7 +7,7 @@ export const networkCallsData = [ Accept: 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', }, - data: 'apiKey=apikey123&email=test%40rudderstack.com', + data: `apiKey=${secret2}&email=test%40rudderstack.com`, method: 'POST', url: 'https://canny.io/api/v1/users/retrieve', }, diff --git a/test/integrations/destinations/canny/data.ts b/test/integrations/destinations/canny/processor/data.ts similarity index 98% rename from test/integrations/destinations/canny/data.ts rename to test/integrations/destinations/canny/processor/data.ts index 3c6823ca1b5..ad28652d5f5 100644 --- a/test/integrations/destinations/canny/data.ts +++ b/test/integrations/destinations/canny/processor/data.ts @@ -1,5 +1,4 @@ -import { enhanceRequestOptions } from '../../../../src/adapters/network'; -import qs from 'qs'; +import { authHeader1, secret1, authHeader2, secret2 } from '../maskedSecrets'; export const data = [ { @@ -14,7 +13,7 @@ export const data = [ { destination: { Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, }, message: { @@ -93,7 +92,7 @@ export const data = [ method: 'POST', endpoint: 'https://canny.io/api/v1/users/create_or_update', headers: { - Authorization: 'Basic FXLkLUEhGJyvmY4', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -104,7 +103,7 @@ export const data = [ title: 'VP', gender: 'female', }, - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, userID: 'user123456001', email: 'firstUser@testmail.com', name: 'First User', @@ -135,7 +134,7 @@ export const data = [ { destination: { Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, }, message: { @@ -232,7 +231,7 @@ export const data = [ { destination: { Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, }, message: { @@ -329,7 +328,7 @@ export const data = [ { destination: { Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, }, message: { @@ -619,7 +618,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'abc', @@ -719,7 +718,7 @@ export const data = [ method: 'POST', endpoint: 'https://canny.io/api/v1/votes/create', headers: { - Authorization: 'Basic apikey123', + Authorization: authHeader2, 'Content-Type': 'application/x-www-form-urlencoded', }, params: {}, @@ -729,7 +728,7 @@ export const data = [ XML: {}, FORM: { postID: 'postid', - apiKey: 'apikey123', + apiKey: secret2, voterID: '52d14c90fff7c80abcd12345', }, }, @@ -745,13 +744,13 @@ export const data = [ method: 'POST', endpoint: 'https://canny.io/api/v1/posts/create', headers: { - Authorization: 'Basic apikey123', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, body: { JSON: { - apiKey: 'apikey123', + apiKey: secret2, boardID: 'boardid', details: 'details', title: 'title', @@ -781,7 +780,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'abc def', @@ -872,7 +871,7 @@ export const data = [ userId: '', endpoint: 'https://canny.io/api/v1/posts/create', headers: { - Authorization: 'Basic apikey123', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -881,7 +880,7 @@ export const data = [ JSON_ARRAY: {}, XML: {}, JSON: { - apiKey: 'apikey123', + apiKey: secret2, authorID: '52d14c90fff7c80abcd12345', boardID: 'boardid', details: 'details', @@ -908,7 +907,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'sample', @@ -1001,7 +1000,7 @@ export const data = [ method: 'POST', endpoint: 'https://canny.io/api/v1/posts/create', headers: { - Authorization: 'Basic apikey123', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -1010,7 +1009,7 @@ export const data = [ JSON_ARRAY: {}, XML: {}, JSON: { - apiKey: 'apikey123', + apiKey: secret2, authorID: '62d1', boardID: '62de8', details: 'Array of images', @@ -1042,7 +1041,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'sample', @@ -1151,7 +1150,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'sample', @@ -1263,7 +1262,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [], }, }, @@ -1363,7 +1362,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'abc', @@ -1474,7 +1473,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'abc def', @@ -1585,7 +1584,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'abc def', @@ -1695,7 +1694,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'abc def', diff --git a/test/integrations/destinations/clevertap/dataDelivery/business.ts b/test/integrations/destinations/clevertap/dataDelivery/business.ts index d9f83f52f35..cd5bcd1e6fd 100644 --- a/test/integrations/destinations/clevertap/dataDelivery/business.ts +++ b/test/integrations/destinations/clevertap/dataDelivery/business.ts @@ -57,10 +57,15 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, identity: 'anon_id', }, @@ -83,7 +88,7 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ response: [ { metadata: generateMetadata(123), - error: '{"status":"success","processed":1,"unprocessed":[]}', + error: JSON.stringify({ status: 'success', processed: 1, unprocessed: [] }), statusCode: 200, }, ], @@ -141,7 +146,7 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ response: [ { metadata: generateMetadata(123), - error: '{"status":"fail","error":"Invalid Credentials","code":401}', + error: JSON.stringify({ status: 'fail', error: 'Invalid Credentials', code: 401 }), statusCode: 401, }, ], @@ -200,7 +205,7 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ response: [ { metadata: generateMetadata(123), - error: '{"status":"fail","processed":0,"unprocessed":[]}', + error: JSON.stringify({ status: 'fail', processed: 0, unprocessed: [] }), statusCode: 400, }, ], @@ -271,8 +276,23 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ response: [ { metadata: generateMetadata(123), - error: - '{"status":"partial","processed":2,"unprocessed":[{"status":"fail","code":509,"error":"Event Name is incorrect. ErrorCode: 509 - Event name is mandatory. Skipped record number : 2","record":{"evtData":{"name":1234,"revenue":4.99},"type":"event","identity":"user123"}}]}', + error: JSON.stringify({ + status: 'partial', + processed: 2, + unprocessed: [ + { + status: 'fail', + code: 509, + error: + 'Event Name is incorrect. ErrorCode: 509 - Event name is mandatory. Skipped record number : 2', + record: { + evtData: { name: 1234, revenue: 4.99 }, + type: 'event', + identity: 'user123', + }, + }, + ], + }), statusCode: 400, }, ], diff --git a/test/integrations/destinations/clevertap/dataDelivery/data.ts b/test/integrations/destinations/clevertap/dataDelivery/data.ts index 57e0d0ceea1..f83c0bc9f6b 100644 --- a/test/integrations/destinations/clevertap/dataDelivery/data.ts +++ b/test/integrations/destinations/clevertap/dataDelivery/data.ts @@ -39,10 +39,15 @@ const oldV0TestCases = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, identity: 'anon_id', }, diff --git a/test/integrations/destinations/clevertap/network.ts b/test/integrations/destinations/clevertap/network.ts index 9122ba11293..103fcfb1c5b 100644 --- a/test/integrations/destinations/clevertap/network.ts +++ b/test/integrations/destinations/clevertap/network.ts @@ -21,10 +21,15 @@ const dataDeliveryMocksData = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, identity: 'anon_id', }, diff --git a/test/integrations/destinations/clevertap/processor/data.ts b/test/integrations/destinations/clevertap/processor/data.ts index f15fc409fba..de84242d231 100644 --- a/test/integrations/destinations/clevertap/processor/data.ts +++ b/test/integrations/destinations/clevertap/processor/data.ts @@ -99,10 +99,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), 'category-unsubscribe': { email: ['Marketing', 'Transactional'] }, }, identity: 'anon_id', @@ -223,10 +228,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), 'category-unsubscribe': { email: ['Marketing', 'Transactional'] }, }, identity: 'anon_id', @@ -368,10 +378,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, identity: 'anon_id', }, @@ -1094,10 +1109,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, identity: 'anon_id', }, @@ -1237,10 +1257,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, identity: 'anon_id', }, @@ -1818,10 +1843,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, ts: 1615377562, identity: 'anon_id', @@ -2203,10 +2233,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), first_name: 'John', last_name: 'Doe', }, @@ -2356,10 +2391,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), first_name: 'John', last_name: 'Doe', }, diff --git a/test/integrations/destinations/clevertap/router/data.ts b/test/integrations/destinations/clevertap/router/data.ts index 5f25bbe83e7..dea46f52e0d 100644 --- a/test/integrations/destinations/clevertap/router/data.ts +++ b/test/integrations/destinations/clevertap/router/data.ts @@ -162,10 +162,22 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), + custom_mappings: JSON.stringify({ + Office: 'Trastkiv', + Country: 'Russia', + }), + custom_tags: JSON.stringify([ + 'Test_User', + 'Interested_User', + 'DIY_Hobby', + ]), }, objectId: 'anon_id', }, diff --git a/test/integrations/destinations/clicksend/commonConfig.ts b/test/integrations/destinations/clicksend/commonConfig.ts index c5c49e2b926..d68c466ce7d 100644 --- a/test/integrations/destinations/clicksend/commonConfig.ts +++ b/test/integrations/destinations/clicksend/commonConfig.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from './maskedSecrets'; export const destination = { ID: 'random_id', Name: 'clicksend', @@ -7,8 +8,8 @@ export const destination = { }, }, Config: { - clicksendUsername: 'dummy', - clicksendPassword: 'dummy', + clicksendUsername: secret1, + clicksendPassword: secret1, defaultCampaignScheduleUnit: 'day', defaultCampaignSchedule: '2', defaultSource: 'php', @@ -74,8 +75,8 @@ export const routerInstrumentationErrorStatTags = { module: 'destination', }; export const commonIdentifyOutput = { - address_line_1: '{"city":"New York","country":"USA","pinCode":"123456"}', - address_line_2: '{"city":"New York","country":"USA","pinCode":"123456"}', + address_line_1: JSON.stringify({ city: 'New York', country: 'USA', pinCode: '123456' }), + address_line_2: JSON.stringify({ city: 'New York', country: 'USA', pinCode: '123456' }), city: 'New York', email: 'abc@gmail.com', first_name: 'John', @@ -93,6 +94,6 @@ export const processInstrumentationErrorStatTags = { }; export const commonHeader = { - Authorization: 'Basic ZHVtbXk6ZHVtbXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }; diff --git a/test/integrations/destinations/clicksend/dataDelivery/data.ts b/test/integrations/destinations/clicksend/dataDelivery/data.ts index f376e757ea9..a6c79684051 100644 --- a/test/integrations/destinations/clicksend/dataDelivery/data.ts +++ b/test/integrations/destinations/clicksend/dataDelivery/data.ts @@ -1,9 +1,11 @@ import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; +import { defaultAccessToken } from '../../../common/secrets'; +import { secret1 } from '../maskedSecrets'; export const headerBlockWithCorrectAccessToken = { 'Content-Type': 'application/json', - Authorization: 'dummy-key', + Authorization: secret1, }; export const contactPayload = { @@ -32,7 +34,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -44,7 +46,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -56,7 +58,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -68,7 +70,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -83,7 +85,7 @@ export const singleMetadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -224,8 +226,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 404, metadata: generateMetadata(1), - error: - '{"http_code":404,"response_code":"NOT_FOUND","response_msg":"Contact record not found.","data":null}', + error: JSON.stringify({ + http_code: 404, + response_code: 'NOT_FOUND', + response_msg: 'Contact record not found.', + data: null, + }), }, ], }, @@ -267,8 +273,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 404, metadata: generateMetadata(1), - error: - '{"http_code":404,"response_code":"NOT_FOUND","response_msg":"Contact record not found.","data":null}', + error: JSON.stringify({ + http_code: 404, + response_code: 'NOT_FOUND', + response_msg: 'Contact record not found.', + data: null, + }), }, ], }, @@ -310,8 +320,13 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: - '{"http_code":400,"response_code":400,"response_msg":"preg_replace(): Parameter mismatch, pattern is a string while replacement is an array","data":null}', + error: JSON.stringify({ + http_code: 400, + response_code: 400, + response_msg: + 'preg_replace(): Parameter mismatch, pattern is a string while replacement is an array', + data: null, + }), }, ], }, @@ -353,8 +368,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 404, metadata: generateMetadata(1), - error: - '{"http_code":404,"response_code":"NOT_FOUND","response_msg":"Your list is not found.","data":null}', + error: JSON.stringify({ + http_code: 404, + response_code: 'NOT_FOUND', + response_msg: 'Your list is not found.', + data: null, + }), }, ], }, diff --git a/test/integrations/destinations/clicksend/maskedSecrets.ts b/test/integrations/destinations/clicksend/maskedSecrets.ts new file mode 100644 index 00000000000..22256c7d5f0 --- /dev/null +++ b/test/integrations/destinations/clicksend/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret1)}`; diff --git a/test/integrations/destinations/clicksend/network.ts b/test/integrations/destinations/clicksend/network.ts index aa1013d8169..e0cfbae8085 100644 --- a/test/integrations/destinations/clicksend/network.ts +++ b/test/integrations/destinations/clicksend/network.ts @@ -1,6 +1,8 @@ +import { secret1 } from './maskedSecrets'; + export const headerBlockWithCorrectAccessToken = { 'Content-Type': 'application/json', - Authorization: 'dummy-key', + Authorization: secret1, }; export const contactPayload = { diff --git a/test/integrations/destinations/clicksend/processor/track.ts b/test/integrations/destinations/clicksend/processor/track.ts index e4a8c5be979..eee7c573e9a 100644 --- a/test/integrations/destinations/clicksend/processor/track.ts +++ b/test/integrations/destinations/clicksend/processor/track.ts @@ -62,7 +62,7 @@ export const track = [ body: 'abcd', from: 'abc@gmail.com', name: 'new campaign', - schedule: 1631201576, + schedule: 1611761576, }, userId: '', }), @@ -227,7 +227,7 @@ export const track = [ from: 'abc@gmail.com', from_email: 'dummy@gmail.com', custom_string: 'test string', - schedule: 1631201576, + schedule: 1611761576, source: 'php', to: '+9182XXXX068', }, diff --git a/test/integrations/destinations/clicksend/router/data.ts b/test/integrations/destinations/clicksend/router/data.ts index 54018787b03..0c072800db6 100644 --- a/test/integrations/destinations/clicksend/router/data.ts +++ b/test/integrations/destinations/clicksend/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { commonInput, destination, @@ -11,8 +12,8 @@ const commonDestination = { ID: 'random_id', Name: 'clicksend', Config: { - clicksendPassword: 'dummy', - clicksendUsername: 'dummy', + clicksendPassword: secret1, + clicksendUsername: secret1, defaultCampaignSchedule: '2', defaultCampaignScheduleUnit: 'day', defaultSenderId: 'abc@gmail.com', @@ -121,7 +122,7 @@ export const data = [ from: 'abc@gmail.com', list_id: 123345, name: 'new campaign', - schedule: 1631201576, + schedule: 1611761576, }, JSON_ARRAY: {}, XML: {}, @@ -129,7 +130,7 @@ export const data = [ endpoint: 'https://rest.clicksend.com/v3/sms-campaigns/send', files: {}, headers: { - Authorization: 'Basic ZHVtbXk6ZHVtbXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -160,7 +161,7 @@ export const data = [ email: 'abc@gmail.com', from: 'abc@gmail.com', from_email: 'dummy@gmail.com', - schedule: 1631201576, + schedule: 1611761576, source: 'php', to: '+9182XXXX068', }, @@ -172,7 +173,7 @@ export const data = [ endpoint: 'https://rest.clicksend.com/v3/sms/send', files: {}, headers: { - Authorization: 'Basic ZHVtbXk6ZHVtbXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -196,8 +197,16 @@ export const data = [ body: { FORM: {}, JSON: { - address_line_1: '{"city":"New York","country":"USA","pinCode":"123456"}', - address_line_2: '{"city":"New York","country":"USA","pinCode":"123456"}', + address_line_1: JSON.stringify({ + city: 'New York', + country: 'USA', + pinCode: '123456', + }), + address_line_2: JSON.stringify({ + city: 'New York', + country: 'USA', + pinCode: '123456', + }), city: 'New York', contact_id: '111', email: 'abc@gmail.com', @@ -211,7 +220,7 @@ export const data = [ endpoint: 'https://rest.clicksend.com/v3/lists/123345/contacts/111', files: {}, headers: { - Authorization: 'Basic ZHVtbXk6ZHVtbXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PUT', @@ -373,7 +382,7 @@ export const data = [ from: 'abc@gmail.com', list_id: 123345, name: 'new campaign', - schedule: 1631201576, + schedule: 1611761576, }, JSON_ARRAY: {}, XML: {}, @@ -381,7 +390,7 @@ export const data = [ endpoint: 'https://rest.clicksend.com/v3/sms-campaigns/send', files: {}, headers: { - Authorization: 'Basic ZHVtbXk6ZHVtbXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -412,7 +421,7 @@ export const data = [ email: 'abc@gmail.com', from: 'abc@gmail.com', from_email: 'dummy@gmail.com', - schedule: 1631201576, + schedule: 1611761576, source: 'php', to: '+9182XXXX068', }, @@ -422,7 +431,7 @@ export const data = [ email: 'abc@gmail.com', from: 'abc@gmail.com', from_email: 'dummy@gmail.com', - schedule: 1631201576, + schedule: 1611761576, source: 'php', to: '+9182XXXX068', }, @@ -432,7 +441,7 @@ export const data = [ email: 'abc@gmail.com', from: 'abc@gmail.com', from_email: 'dummy@gmail.com', - schedule: 1631201576, + schedule: 1611761576, source: 'php', to: '+9182XXXX068', }, @@ -444,7 +453,7 @@ export const data = [ endpoint: 'https://rest.clicksend.com/v3/sms/send', files: {}, headers: { - Authorization: 'Basic ZHVtbXk6ZHVtbXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', diff --git a/test/integrations/destinations/clickup/maskedSecrets.ts b/test/integrations/destinations/clickup/maskedSecrets.ts new file mode 100644 index 00000000000..67e579d0869 --- /dev/null +++ b/test/integrations/destinations/clickup/maskedSecrets.ts @@ -0,0 +1,3 @@ +import path from 'path'; + +export const secretApiToken = path.basename(__dirname) + 1; diff --git a/test/integrations/destinations/clickup/processor/data.ts b/test/integrations/destinations/clickup/processor/data.ts index 686bf670e2e..e553c54711c 100644 --- a/test/integrations/destinations/clickup/processor/data.ts +++ b/test/integrations/destinations/clickup/processor/data.ts @@ -1,3 +1,5 @@ +import { secretApiToken } from '../maskedSecrets'; + export const data = [ { name: 'clickup', @@ -11,7 +13,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', }, ID: 'clickup-1234', @@ -64,7 +66,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { @@ -122,7 +124,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { @@ -180,7 +182,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { @@ -238,7 +240,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { @@ -300,7 +302,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { @@ -358,7 +360,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { @@ -460,7 +462,7 @@ export const data = [ endpoint: 'https://api.clickup.com/api/v2/list/correctListId123/task', headers: { 'Content-Type': 'application/json', - Authorization: 'pk_123', + Authorization: secretApiToken, }, params: {}, body: { @@ -557,7 +559,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', }, ID: 'clickup-1234', @@ -604,7 +606,7 @@ export const data = [ endpoint: 'https://api.clickup.com/api/v2/list/correctListId123/task', headers: { 'Content-Type': 'application/json', - Authorization: 'pk_123', + Authorization: secretApiToken, }, params: {}, body: { @@ -637,7 +639,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', whitelistedEvents: [ { @@ -698,7 +700,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', whitelistedEvents: [ { @@ -759,7 +761,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', }, ID: 'clickup-1234', @@ -795,7 +797,7 @@ export const data = [ endpoint: 'https://api.clickup.com/api/v2/list/correctListId456/task', headers: { 'Content-Type': 'application/json', - Authorization: 'pk_123', + Authorization: secretApiToken, }, params: {}, body: { diff --git a/test/integrations/destinations/clickup/router/data.ts b/test/integrations/destinations/clickup/router/data.ts index b77cb90b473..8306081ff91 100644 --- a/test/integrations/destinations/clickup/router/data.ts +++ b/test/integrations/destinations/clickup/router/data.ts @@ -1,3 +1,5 @@ +import { secretApiToken } from '../maskedSecrets'; + export const data = [ { name: 'clickup', @@ -12,7 +14,7 @@ export const data = [ { description: 'Creating task using listId from externalId array', destination: { - Config: { apiToken: 'pk_123', listId: 'correctListId123' }, + Config: { apiToken: secretApiToken, listId: 'correctListId123' }, ID: 'clickup-1234', }, metadata: { jobId: 1, userId: 'u1' }, @@ -28,7 +30,7 @@ export const data = [ { description: 'Creating task with assignees', destination: { - Config: { apiToken: 'pk_123', listId: 'correctListId123' }, + Config: { apiToken: secretApiToken, listId: 'correctListId123' }, ID: 'clickup-1234', }, metadata: { jobId: 2, userId: 'u1' }, @@ -52,7 +54,7 @@ export const data = [ description: 'Creating task with valid custom fields values', destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { from: 'industry', to: 'Industry' }, @@ -111,7 +113,7 @@ export const data = [ description: 'Custom field: Invalid location latitude', destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [{ from: 'location', to: 'Location' }], }, @@ -147,14 +149,14 @@ export const data = [ body: { FORM: {}, JSON: { name: 'anonymous page visit' }, JSON_ARRAY: {}, XML: {} }, endpoint: 'https://api.clickup.com/api/v2/list/correctListId456/task', files: {}, - headers: { Authorization: 'pk_123', 'Content-Type': 'application/json' }, + headers: { Authorization: secretApiToken, 'Content-Type': 'application/json' }, method: 'POST', params: {}, type: 'REST', version: '1', }, destination: { - Config: { apiToken: 'pk_123', listId: 'correctListId123' }, + Config: { apiToken: secretApiToken, listId: 'correctListId123' }, ID: 'clickup-1234', }, metadata: [{ jobId: 1, userId: 'u1' }], @@ -171,14 +173,14 @@ export const data = [ }, endpoint: 'https://api.clickup.com/api/v2/list/correctListId123/task', files: {}, - headers: { Authorization: 'pk_123', 'Content-Type': 'application/json' }, + headers: { Authorization: secretApiToken, 'Content-Type': 'application/json' }, method: 'POST', params: {}, type: 'REST', version: '1', }, destination: { - Config: { apiToken: 'pk_123', listId: 'correctListId123' }, + Config: { apiToken: secretApiToken, listId: 'correctListId123' }, ID: 'clickup-1234', }, metadata: [{ jobId: 2, userId: 'u1' }], @@ -244,7 +246,7 @@ export const data = [ }, endpoint: 'https://api.clickup.com/api/v2/list/correctListId123/task', files: {}, - headers: { Authorization: 'pk_123', 'Content-Type': 'application/json' }, + headers: { Authorization: secretApiToken, 'Content-Type': 'application/json' }, method: 'POST', params: {}, type: 'REST', @@ -252,7 +254,7 @@ export const data = [ }, destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, keyToCustomFieldName: [ { from: 'industry', to: 'Industry' }, { from: 'Payment Status', to: 'Payment Status' }, @@ -276,7 +278,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [{ from: 'location', to: 'Location' }], }, diff --git a/test/integrations/destinations/cordial/common.ts b/test/integrations/destinations/cordial/common.ts index 1ebd0db34b0..1ac3a951e7f 100644 --- a/test/integrations/destinations/cordial/common.ts +++ b/test/integrations/destinations/cordial/common.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from './maskedSecrets'; import { Destination } from '../../../../src/types'; const destType = 'cordial'; @@ -6,7 +7,7 @@ const displayName = 'Cordial'; const destination: Destination = { Config: { apiBaseUrl: 'https://abc.example.com', - apiKey: 'test-api-key', + apiKey: secret1, }, DestinationDefinition: { DisplayName: displayName, @@ -46,7 +47,7 @@ const context = { }; const headers = { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC1hcGkta2V5Og==', + Authorization: authHeader1, }; const properties = { product_id: '622c6f5d5cf86a4c77358033', diff --git a/test/integrations/destinations/cordial/maskedSecrets.ts b/test/integrations/destinations/cordial/maskedSecrets.ts new file mode 100644 index 00000000000..ba0b28ba8a1 --- /dev/null +++ b/test/integrations/destinations/cordial/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + '')}`; diff --git a/test/integrations/destinations/cordial/network.ts b/test/integrations/destinations/cordial/network.ts index 9cc6f42408e..c7b62c86769 100644 --- a/test/integrations/destinations/cordial/network.ts +++ b/test/integrations/destinations/cordial/network.ts @@ -1,10 +1,11 @@ +import { authHeader1 } from './maskedSecrets'; import { destination } from './common'; export const networkCallsData = [ { httpReq: { url: `${destination.Config.apiBaseUrl}/v2/contacts/email:johndoe@example.com`, headers: { - Authorization: 'Basic dGVzdC1hcGkta2V5Og==', + Authorization: authHeader1, }, method: 'GET', }, @@ -38,7 +39,7 @@ export const networkCallsData = [ httpReq: { url: `${destination.Config.apiBaseUrl}/v2/contacts/6690fe3655e334d6270287b5`, headers: { - Authorization: 'Basic dGVzdC1hcGkta2V5Og==', + Authorization: authHeader1, }, method: 'GET', }, diff --git a/test/integrations/destinations/cordial/processor/identify.ts b/test/integrations/destinations/cordial/processor/identify.ts index 074852b1993..ef7636a7162 100644 --- a/test/integrations/destinations/cordial/processor/identify.ts +++ b/test/integrations/destinations/cordial/processor/identify.ts @@ -39,6 +39,7 @@ export const identify: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -102,6 +103,7 @@ export const identify: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -166,6 +168,7 @@ export const identify: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/cordial/processor/track.ts b/test/integrations/destinations/cordial/processor/track.ts index 3e7a560a52d..3ead5a959cb 100644 --- a/test/integrations/destinations/cordial/processor/track.ts +++ b/test/integrations/destinations/cordial/processor/track.ts @@ -40,6 +40,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -96,6 +97,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/cordial/processor/validation.ts b/test/integrations/destinations/cordial/processor/validation.ts index 61f2e1cbed9..ea7dff6dac9 100644 --- a/test/integrations/destinations/cordial/processor/validation.ts +++ b/test/integrations/destinations/cordial/processor/validation.ts @@ -27,6 +27,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -71,6 +72,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/courier/maskedSecrets.ts b/test/integrations/destinations/courier/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/courier/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/courier/processor/data.ts b/test/integrations/destinations/courier/processor/data.ts index 9371f9e7b25..32e11e6a284 100644 --- a/test/integrations/destinations/courier/processor/data.ts +++ b/test/integrations/destinations/courier/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'courier', @@ -73,7 +74,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -92,7 +93,7 @@ export const data = [ endpoint: 'https://api.courier.com/inbound/rudderstack', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -151,7 +152,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -170,7 +171,7 @@ export const data = [ endpoint: 'https://api.courier.com/inbound/rudderstack', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -229,7 +230,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -281,7 +282,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -300,7 +301,7 @@ export const data = [ endpoint: 'https://api.courier.com/inbound/rudderstack', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/courier/router/data.ts b/test/integrations/destinations/courier/router/data.ts index 268504b9033..83a02f0e898 100644 --- a/test/integrations/destinations/courier/router/data.ts +++ b/test/integrations/destinations/courier/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'courier', @@ -21,7 +22,7 @@ export const data = [ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: secret1 } }, metadata: { jobId: 1, userId: 'u1' }, }, { @@ -66,7 +67,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.courier.com/inbound/rudderstack', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -88,7 +89,7 @@ export const data = [ }, files: {}, }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: secret1 } }, metadata: [{ jobId: 1, userId: 'u1' }], statusCode: 200, }, diff --git a/test/integrations/destinations/criteo_audience/dataDelivery/business.ts b/test/integrations/destinations/criteo_audience/dataDelivery/business.ts index f30bf73d7a9..a8767869a7d 100644 --- a/test/integrations/destinations/criteo_audience/dataDelivery/business.ts +++ b/test/integrations/destinations/criteo_audience/dataDelivery/business.ts @@ -1,7 +1,9 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload, generateMetadata } from '../../../testUtils'; +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; + export const headers = { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }; @@ -230,8 +232,15 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ message: 'AudienceId is Invalid. Please Provide Valid AudienceId', response: [ { - error: - '{"errors":[{"traceIdentifier":"80a1a0ba3981b04da847d05700752c77","type":"authorization","code":"audience-invalid"}]}', + error: JSON.stringify({ + errors: [ + { + traceIdentifier: '80a1a0ba3981b04da847d05700752c77', + type: 'authorization', + code: 'audience-invalid', + }, + ], + }), metadata: generateMetadata(4), statusCode: 400, }, diff --git a/test/integrations/destinations/criteo_audience/dataDelivery/data.ts b/test/integrations/destinations/criteo_audience/dataDelivery/data.ts index c603ef66648..f3e3fa911fb 100644 --- a/test/integrations/destinations/criteo_audience/dataDelivery/data.ts +++ b/test/integrations/destinations/criteo_audience/dataDelivery/data.ts @@ -1,3 +1,4 @@ +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; import { generateMetadata } from '../../../testUtils'; import { V1BusinessTestScenarion } from './business'; import { v1OauthScenarios } from './oauth'; @@ -18,7 +19,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34894/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -80,7 +81,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/3485/contactlist/expiredAccessToken', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -160,7 +161,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34895/contactlist/invalidAccessToken', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -240,7 +241,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34896/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -320,7 +321,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34897/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -399,7 +400,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34898/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -471,7 +472,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34899/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, diff --git a/test/integrations/destinations/criteo_audience/dataDelivery/other.ts b/test/integrations/destinations/criteo_audience/dataDelivery/other.ts index 145be62528a..2c6a599b125 100644 --- a/test/integrations/destinations/criteo_audience/dataDelivery/other.ts +++ b/test/integrations/destinations/criteo_audience/dataDelivery/other.ts @@ -172,7 +172,7 @@ export const v1OtherScenarios: ProxyV1TestData[] = [ status: 400, response: [ { - error: '{"message":"unknown error"}', + error: JSON.stringify({ message: 'unknown error' }), metadata: generateMetadata(3), statusCode: 400, }, diff --git a/test/integrations/destinations/criteo_audience/maskedSecrets.ts b/test/integrations/destinations/criteo_audience/maskedSecrets.ts new file mode 100644 index 00000000000..30165eac945 --- /dev/null +++ b/test/integrations/destinations/criteo_audience/maskedSecrets.ts @@ -0,0 +1,3 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; diff --git a/test/integrations/destinations/criteo_audience/network.ts b/test/integrations/destinations/criteo_audience/network.ts index 7ccf649e2a0..6fb61153402 100644 --- a/test/integrations/destinations/criteo_audience/network.ts +++ b/test/integrations/destinations/criteo_audience/network.ts @@ -1,5 +1,7 @@ +import { defaultAccessTokenAuthHeader } from '../../common/secrets'; + const headers = { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', 'User-Agent': 'RudderLabs', diff --git a/test/integrations/destinations/criteo_audience/processor/data.ts b/test/integrations/destinations/criteo_audience/processor/data.ts index 61573fed9b2..14e771d98c2 100644 --- a/test/integrations/destinations/criteo_audience/processor/data.ts +++ b/test/integrations/destinations/criteo_audience/processor/data.ts @@ -1,3 +1,6 @@ +import { defaultAccessToken, defaultAccessTokenAuthHeader } from '../../../common/secrets'; +import { secret1 } from '../maskedSecrets'; + export const data = [ { name: 'criteo_audience', @@ -11,7 +14,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -58,7 +61,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34894', audienceType: 'email', }, @@ -79,7 +82,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34894/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -112,7 +115,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -133,7 +136,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -197,7 +200,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'madid', }, @@ -218,7 +221,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -252,7 +255,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -264,7 +267,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -298,7 +301,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -319,7 +322,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -360,7 +363,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34894', audienceType: 'email', }, @@ -381,7 +384,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34894/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -407,7 +410,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -428,7 +431,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -466,7 +469,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34895', audienceType: 'madid', }, @@ -487,7 +490,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34895/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -513,7 +516,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -534,7 +537,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -580,7 +583,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'madid', }, @@ -601,7 +604,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -627,7 +630,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -639,7 +642,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -665,7 +668,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -686,7 +689,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -732,7 +735,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'identityLink', }, @@ -753,7 +756,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -779,7 +782,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -791,7 +794,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -817,7 +820,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -838,7 +841,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -884,7 +887,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'gum', gumCallerId: '329739', @@ -906,7 +909,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -933,7 +936,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -945,7 +948,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -972,7 +975,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -993,7 +996,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -1034,7 +1037,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -1051,7 +1054,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, @@ -1081,13 +1084,13 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -1149,7 +1152,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, @@ -1179,13 +1182,13 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -1240,7 +1243,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, @@ -1270,7 +1273,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -1290,7 +1293,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -1307,7 +1310,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, @@ -1337,13 +1340,13 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -1397,7 +1400,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, @@ -1427,7 +1430,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, destination: { @@ -1508,7 +1511,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, @@ -1538,7 +1541,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -1578,7 +1581,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34894', audienceType: 'email', }, @@ -1595,7 +1598,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, diff --git a/test/integrations/destinations/criteo_audience/router/data.ts b/test/integrations/destinations/criteo_audience/router/data.ts index 755d83547e1..faa503caa3e 100644 --- a/test/integrations/destinations/criteo_audience/router/data.ts +++ b/test/integrations/destinations/criteo_audience/router/data.ts @@ -1,3 +1,6 @@ +import { defaultAccessToken, defaultAccessTokenAuthHeader } from '../../../common/secrets'; +import { secret1 } from '../maskedSecrets'; + export const data = [ { name: 'criteo_audience', @@ -13,13 +16,13 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, ID: 'iwehr83843', }, - metadata: { secret: { accessToken: 'success_access_token' }, jobId: 1, userId: 'u1' }, + metadata: { secret: { accessToken: defaultAccessToken }, jobId: 1, userId: 'u1' }, message: { userId: 'user 1', type: 'audiencelist', @@ -55,13 +58,13 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'madid', }, ID: 'iwehr83843', }, - metadata: { secret: { accessToken: 'success_access_token' }, jobId: 2, userId: 'u1' }, + metadata: { secret: { accessToken: defaultAccessToken }, jobId: 2, userId: 'u1' }, message: { userId: 'user 1', type: 'audiencelist', @@ -120,7 +123,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -144,15 +147,13 @@ export const data = [ files: {}, }, ], - metadata: [ - { jobId: 1, secret: { accessToken: 'success_access_token' }, userId: 'u1' }, - ], + metadata: [{ jobId: 1, secret: { accessToken: defaultAccessToken }, userId: 'u1' }], batched: false, statusCode: 200, destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -167,7 +168,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -196,7 +197,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -220,15 +221,13 @@ export const data = [ files: {}, }, ], - metadata: [ - { jobId: 2, secret: { accessToken: 'success_access_token' }, userId: 'u1' }, - ], + metadata: [{ jobId: 2, secret: { accessToken: defaultAccessToken }, userId: 'u1' }], batched: false, statusCode: 200, destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'madid', }, @@ -254,7 +253,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -262,7 +261,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, jobId: 1, userId: 'u1', @@ -316,7 +315,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceType: 'email', 'warehouse-adAccountId': '123', }, @@ -324,7 +323,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, jobId: 2, userId: 'u1', @@ -393,7 +392,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -422,7 +421,7 @@ export const data = [ jobId: 1, userId: 'u1', secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, ], @@ -431,7 +430,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -447,7 +446,7 @@ export const data = [ endpoint: 'https://api.criteo.com/2022-10/audiences/23848494844100489/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -476,7 +475,7 @@ export const data = [ jobId: 2, userId: 'u1', secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, ], @@ -485,7 +484,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, 'warehouse-adAccountId': '123', audienceType: 'email', }, diff --git a/test/integrations/destinations/custify/deleteUsers/data.ts b/test/integrations/destinations/custify/deleteUsers/data.ts index 22a120770a1..0d0b758f926 100644 --- a/test/integrations/destinations/custify/deleteUsers/data.ts +++ b/test/integrations/destinations/custify/deleteUsers/data.ts @@ -1,3 +1,4 @@ +import { secret1 } from '../maskedSecrets'; const destType = 'custify'; const commonData = { name: destType, @@ -48,7 +49,7 @@ export const data = [ }, ], config: { - apiToken: 'dummyApiKey', + apiToken: secret1, }, }, ], @@ -83,7 +84,7 @@ export const data = [ }, ], config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, ], @@ -114,7 +115,7 @@ export const data = [ }, ], config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, ], @@ -123,7 +124,9 @@ export const data = [ output: { response: { status: 400, - body: [{ statusCode: 400, error: '{"error":"User: rudder3 has a problem"}' }], + body: [ + { statusCode: 400, error: JSON.stringify({ error: 'User: rudder3 has a problem' }) }, + ], }, }, }, @@ -142,7 +145,7 @@ export const data = [ {}, ], config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, ], diff --git a/test/integrations/destinations/custify/maskedSecrets.ts b/test/integrations/destinations/custify/maskedSecrets.ts new file mode 100644 index 00000000000..da90788f323 --- /dev/null +++ b/test/integrations/destinations/custify/maskedSecrets.ts @@ -0,0 +1,10 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = undefined; + +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; +export const authHeader3 = `Bearer ${secret4}`; diff --git a/test/integrations/destinations/custify/network.ts b/test/integrations/destinations/custify/network.ts index 242f54c97b2..5bddb89ad16 100644 --- a/test/integrations/destinations/custify/network.ts +++ b/test/integrations/destinations/custify/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { @@ -39,7 +40,7 @@ export const networkCallsData = [ method: 'delete', url: 'https://api.custify.com/people?user_id=rudder1', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, }, httpRes: { @@ -56,7 +57,7 @@ export const networkCallsData = [ method: 'delete', url: 'https://api.custify.com/people?user_id=rudder2', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, }, httpRes: { @@ -72,7 +73,7 @@ export const networkCallsData = [ method: 'delete', url: 'https://api.custify.com/people?user_id=rudder3', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, }, httpRes: { diff --git a/test/integrations/destinations/custify/processor/data.ts b/test/integrations/destinations/custify/processor/data.ts index b5bd8bd753f..e53005b2ac5 100644 --- a/test/integrations/destinations/custify/processor/data.ts +++ b/test/integrations/destinations/custify/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader2, secret2 } from '../maskedSecrets'; export const data = [ { name: 'custify', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: false, }, ID: 'custify-1234', @@ -63,7 +64,7 @@ export const data = [ endpoint: 'https://api.custify.com/people', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apiKey_key_test_001', + Authorization: authHeader2, Accept: 'application/json', }, params: {}, @@ -120,7 +121,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: false, }, ID: 'custify-1234', @@ -173,7 +174,7 @@ export const data = [ endpoint: 'https://api.custify.com/people', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apiKey_key_test_001', + Authorization: authHeader2, Accept: 'application/json', }, params: {}, @@ -230,7 +231,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: false, }, ID: 'custify-1234', @@ -300,7 +301,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: false, }, ID: 'custify-1234', @@ -371,7 +372,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: true, }, ID: 'custify-1234', @@ -422,7 +423,7 @@ export const data = [ endpoint: 'https://api.custify.com/people', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apiKey_key_test_001', + Authorization: authHeader2, Accept: 'application/json', }, params: {}, @@ -478,7 +479,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: false, }, ID: 'custify-1234', @@ -529,7 +530,7 @@ export const data = [ endpoint: 'https://api.custify.com/event', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apiKey_key_test_001', + Authorization: authHeader2, Accept: 'application/json', }, params: {}, @@ -572,7 +573,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: false, }, ID: 'custify-1234', @@ -631,7 +632,7 @@ export const data = [ endpoint: 'https://api.custify.com/people', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apiKey_key_test_001', + Authorization: authHeader2, Accept: 'application/json', }, params: {}, diff --git a/test/integrations/destinations/custify/router/data.ts b/test/integrations/destinations/custify/router/data.ts index a88f36fc698..bbefaf755c4 100644 --- a/test/integrations/destinations/custify/router/data.ts +++ b/test/integrations/destinations/custify/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader2, authHeader3, secret2, secret3 } from '../maskedSecrets'; export const data = [ { name: 'custify', @@ -12,7 +13,7 @@ export const data = [ { description: 'Group callw with all parameters', destination: { - Config: { apiKey: 'apiKey_key_test_001', sendAnonymousId: false }, + Config: { apiKey: secret2, sendAnonymousId: false }, ID: 'custify-1234', }, metadata: { jobId: 1, userId: 'u1' }, @@ -54,7 +55,7 @@ export const data = [ { description: 'Identify with all parameters', destination: { - Config: { apiKeyToken: 'pk_123', listId: 'correctListId123' }, + Config: { apiKeyToken: secret3, listId: 'correctListId123' }, ID: 'custify-1234', }, metadata: { jobId: 2, userId: 'u1' }, @@ -108,7 +109,7 @@ export const data = [ endpoint: 'https://api.custify.com/people', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apiKey_key_test_001', + Authorization: authHeader2, Accept: 'application/json', }, params: {}, @@ -139,7 +140,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'apiKey_key_test_001', sendAnonymousId: false }, + Config: { apiKey: secret2, sendAnonymousId: false }, ID: 'custify-1234', }, }, @@ -151,8 +152,8 @@ export const data = [ endpoint: 'https://api.custify.com/people', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer undefined', Accept: 'application/json', + Authorization: authHeader3, }, params: {}, body: { @@ -189,7 +190,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKeyToken: 'pk_123', listId: 'correctListId123' }, + Config: { apiKeyToken: secret3, listId: 'correctListId123' }, ID: 'custify-1234', }, }, diff --git a/test/integrations/destinations/customerio/maskedSecrets.ts b/test/integrations/destinations/customerio/maskedSecrets.ts new file mode 100644 index 00000000000..ff4c3b6cd40 --- /dev/null +++ b/test/integrations/destinations/customerio/maskedSecrets.ts @@ -0,0 +1,15 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const secret5 = path.basename(__dirname) + 5; +export const secret6 = path.basename(__dirname) + 6; +export const secret7 = path.basename(__dirname) + 7; +export const secret8 = path.basename(__dirname) + 8; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; +export const authHeader2 = `Basic ${base64Convertor(secret3 + ':' + secret4)}`; +export const authHeader3 = `Basic ${base64Convertor(secret5 + ':' + secret6)}`; +export const authHeader4 = `Basic ${base64Convertor(secret7 + ':' + secret8)}`; diff --git a/test/integrations/destinations/customerio/processor/data.ts b/test/integrations/destinations/customerio/processor/data.ts index 92cea4250d8..a9957449ba4 100644 --- a/test/integrations/destinations/customerio/processor/data.ts +++ b/test/integrations/destinations/customerio/processor/data.ts @@ -1,3 +1,17 @@ +import { + authHeader1, + secret1, + secret2, + authHeader2, + secret3, + secret4, + authHeader3, + secret5, + secret6, + authHeader4, + secret7, + secret8, +} from '../maskedSecrets'; export const data = [ { name: 'customerio', @@ -25,8 +39,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -52,7 +66,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/cio_1234', userId: 'cio_1234', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -143,7 +157,7 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', + siteID: secret1, }, }, }, @@ -247,8 +261,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -283,7 +297,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/123456', userId: '123456', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -371,8 +385,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -475,8 +489,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -511,7 +525,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/test@gmail.com', userId: '123456', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -585,8 +599,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -620,7 +634,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -692,8 +706,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -725,7 +739,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -797,8 +811,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -830,7 +844,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/test@rudderstack.com/events', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -901,8 +915,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -935,7 +949,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/events', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1023,8 +1037,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1057,7 +1071,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/devices', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1145,8 +1159,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1169,7 +1183,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/devices/abcxyz', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1248,8 +1262,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1272,7 +1286,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/devices/somel', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1350,8 +1364,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1375,7 +1389,7 @@ export const data = [ 'https://track.customer.io/api/v1/customers/test@rudderstack.com/devices/somel', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1452,8 +1466,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1544,8 +1558,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1577,7 +1591,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/test@rudderstack.com/devices', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1654,8 +1668,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1688,7 +1702,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/events', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1767,8 +1781,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1800,7 +1814,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/devices', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1878,8 +1892,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1911,7 +1925,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1989,8 +2003,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2022,7 +2036,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2101,8 +2115,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2134,7 +2148,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/devices', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2213,8 +2227,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2238,7 +2252,7 @@ export const data = [ 'https://track.customer.io/api/v1/customers/12345/devices/sample_device_token', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2328,8 +2342,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2363,7 +2377,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/123456', userId: '123456', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2437,8 +2451,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2472,7 +2486,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2544,8 +2558,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2577,7 +2591,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2649,8 +2663,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2682,7 +2696,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/test@rudderstack.com/events', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2753,8 +2767,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2787,7 +2801,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/events', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2875,8 +2889,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2909,7 +2923,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2997,8 +3011,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3021,7 +3035,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices/abcxyz', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3100,8 +3114,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3124,7 +3138,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices/somel', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3201,8 +3215,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3293,8 +3307,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3327,7 +3341,7 @@ export const data = [ 'https://track-eu.customer.io/api/v1/customers/test@rudderstack.com/devices', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3404,8 +3418,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3438,7 +3452,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/events', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3517,8 +3531,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3550,7 +3564,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3628,8 +3642,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3661,7 +3675,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3739,8 +3753,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3772,7 +3786,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3851,8 +3865,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3884,7 +3898,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3963,8 +3977,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3988,7 +4002,7 @@ export const data = [ 'https://track-eu.customer.io/api/v1/customers/12345/devices/sample_device_token', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -4059,8 +4073,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -4078,7 +4092,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v1/events', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, params: {}, body: { @@ -4165,8 +4179,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -4184,7 +4198,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v1/customers/test@rudderstack.com/events', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, params: {}, body: { @@ -4269,8 +4283,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -4288,7 +4302,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v1/events', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, params: {}, body: { @@ -4375,8 +4389,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -4394,7 +4408,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v1/customers/test@rudderstack.com/events', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, params: {}, body: { @@ -4491,8 +4505,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: 'abc', - apiKey: 'xyz', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -4510,7 +4524,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v1/customers/dummy-user-id-100/events', headers: { - Authorization: 'Basic YWJjOnh5eg==', + Authorization: authHeader1, }, params: {}, body: { @@ -4605,8 +4619,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -4624,7 +4638,7 @@ export const data = [ method: 'PUT', endpoint: 'https://track-eu.customer.io/api/v1/customers/dummy-user-id-100', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, params: {}, body: { @@ -4729,9 +4743,9 @@ export const data = [ ResponseRules: null, }, Config: { - apiKey: 'a292d85ac36de15fc219', + apiKey: secret4, datacenter: 'US', - siteID: 'eead090ab9e2e35004dc', + siteID: secret3, }, Enabled: true, Transformations: [], @@ -4756,7 +4770,7 @@ export const data = [ method: 'PUT', endpoint: 'https://track.customer.io/api/v1/customers/xaviercharles@hotmail.com', headers: { - Authorization: 'Basic ZWVhZDA5MGFiOWUyZTM1MDA0ZGM6YTI5MmQ4NWFjMzZkZTE1ZmMyMTk=', + Authorization: authHeader2, }, params: {}, body: { @@ -4856,9 +4870,9 @@ export const data = [ ResponseRules: null, }, Config: { - apiKey: 'a292d85ac36de15fc219', + apiKey: secret4, datacenter: 'US', - siteID: 'eead090ab9e2e35004dc', + siteID: secret3, }, Enabled: true, Transformations: [], @@ -4883,7 +4897,7 @@ export const data = [ method: 'PUT', endpoint: 'https://track.customer.io/api/v1/customers/xaviercharles', headers: { - Authorization: 'Basic ZWVhZDA5MGFiOWUyZTM1MDA0ZGM6YTI5MmQ4NWFjMzZkZTE1ZmMyMTk=', + Authorization: authHeader2, }, params: {}, body: { @@ -5033,10 +5047,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -5058,7 +5072,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -5210,10 +5224,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -5235,7 +5249,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/events', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -5386,10 +5400,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -5411,7 +5425,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -5562,10 +5576,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -5587,7 +5601,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -5735,10 +5749,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -5760,7 +5774,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -5911,10 +5925,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -5936,7 +5950,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -6088,10 +6102,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -6113,7 +6127,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/events', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -6265,10 +6279,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -6290,7 +6304,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -6441,10 +6455,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -6466,7 +6480,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -6614,10 +6628,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -6639,7 +6653,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -6790,10 +6804,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -6815,7 +6829,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -6932,10 +6946,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -6956,7 +6970,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -7085,10 +7099,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -7109,7 +7123,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -7241,10 +7255,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -7265,7 +7279,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -7397,10 +7411,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -7421,7 +7435,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -7553,10 +7567,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -7577,7 +7591,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -7723,10 +7737,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -7747,7 +7761,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -7893,10 +7907,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'EU', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -7917,7 +7931,7 @@ export const data = [ method: 'POST', endpoint: 'https://track-eu.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -8028,8 +8042,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -8063,7 +8077,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -8135,8 +8149,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -8168,7 +8182,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -8234,8 +8248,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -8261,7 +8275,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -8301,8 +8315,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, diff --git a/test/integrations/destinations/customerio/router/data.ts b/test/integrations/destinations/customerio/router/data.ts index 12751477109..0f4d6fe0eb6 100644 --- a/test/integrations/destinations/customerio/router/data.ts +++ b/test/integrations/destinations/customerio/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'customerio', @@ -65,8 +66,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -109,8 +110,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -147,8 +148,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -185,8 +186,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -207,7 +208,7 @@ export const data = [ type: 'REST', method: 'PUT', endpoint: 'https://track.customer.io/api/v1/customers/123456', - headers: { Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=' }, + headers: { Authorization: authHeader1 }, params: {}, body: { JSON: { @@ -237,8 +238,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -248,7 +249,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://track.customer.io/api/v1/customers/12345/events', - headers: { Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=' }, + headers: { Authorization: authHeader1 }, params: {}, body: { JSON: { @@ -277,8 +278,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -289,7 +290,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -335,8 +336,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, diff --git a/test/integrations/destinations/customerio_audience/common.ts b/test/integrations/destinations/customerio_audience/common.ts new file mode 100644 index 00000000000..e54190d04ac --- /dev/null +++ b/test/integrations/destinations/customerio_audience/common.ts @@ -0,0 +1,105 @@ +import { authHeader1, secret1, secret2 } from './maskedSecrets'; +import { Connection, Destination } from '../../../../src/types'; +import { VDM_V2_SCHEMA_VERSION } from '../../../../src/v0/util/constant'; + +const destType = 'customerio_audience'; +const destTypeInUpperCase = 'CUSTOMERIO_AUDIENCE'; +const displayName = 'Customer.io Audience'; +const channel = 'web'; +const destination: Destination = { + Config: { + apiKey: secret2, + appApiKey: 'test-app-api-key', + connectionMode: 'cloud', + siteId: secret1, + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: {}, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', +}; +const connection: Connection = { + sourceId: 'dummy-source-id', + destinationId: 'dummy-destination-id', + enabled: true, + config: { + destination: { + schemaVersion: VDM_V2_SCHEMA_VERSION, + audienceId: 'test-segment-id', + identifierMappings: [ + { + from: 'some-key', + to: 'id', + }, + ], + }, + }, +}; + +const inValidConnection: Connection = { + ...connection, + config: { + ...connection.config, + destination: { + audienceId: '', + }, + }, +}; + +const insertOrUpdateEndpoint = + 'https://track.customer.io/api/v1/segments/test-segment-id/add_customers'; + +const deleteEndpoint = 'https://track.customer.io/api/v1/segments/test-segment-id/remove_customers'; + +const processorInstrumentationErrorStatTags = { + destType: destTypeInUpperCase, + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', +}; + +const RouterInstrumentationErrorStatTags = { + ...processorInstrumentationErrorStatTags, + feature: 'router', +}; + +const RouterConfigurationErrorStatTags = { + ...processorInstrumentationErrorStatTags, + feature: 'router', + errorType: 'configuration', +}; + +const headers = { + 'Content-Type': 'application/json', + Authorization: authHeader1, +}; + +const params = { + id_type: 'id', +}; + +export { + destType, + channel, + destination, + connection, + inValidConnection, + processorInstrumentationErrorStatTags, + RouterInstrumentationErrorStatTags, + RouterConfigurationErrorStatTags, + headers, + params, + insertOrUpdateEndpoint, + deleteEndpoint, +}; diff --git a/test/integrations/destinations/customerio_audience/maskedSecrets.ts b/test/integrations/destinations/customerio_audience/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/customerio_audience/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/customerio_audience/mocks.ts b/test/integrations/destinations/customerio_audience/mocks.ts new file mode 100644 index 00000000000..2c613706e67 --- /dev/null +++ b/test/integrations/destinations/customerio_audience/mocks.ts @@ -0,0 +1,5 @@ +import * as config from '../../../../src/v0/destinations/customerio_audience/config'; + +export const defaultMockFns = () => { + jest.replaceProperty(config, 'MAX_ITEMS', 3 as typeof config.MAX_ITEMS); +}; diff --git a/test/integrations/destinations/customerio_audience/router/data.ts b/test/integrations/destinations/customerio_audience/router/data.ts new file mode 100644 index 00000000000..f9964a79ecd --- /dev/null +++ b/test/integrations/destinations/customerio_audience/router/data.ts @@ -0,0 +1,377 @@ +import { generateMetadata, generateRecordPayload, overrideDestination } from '../../../testUtils'; +import { defaultMockFns } from '../mocks'; +import { + destType, + destination, + headers, + RouterInstrumentationErrorStatTags, + insertOrUpdateEndpoint, + deleteEndpoint, + connection, + params, + inValidConnection, + RouterConfigurationErrorStatTags, +} from '../common'; + +const routerRequest1 = { + input: [ + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-1', + }, + action: 'insert', + }), + metadata: generateMetadata(1), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-2', + }, + action: 'insert', + }), + metadata: generateMetadata(2), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-3', + }, + action: 'insert', + }), + metadata: generateMetadata(3), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-4', + }, + action: 'insert', + }), + metadata: generateMetadata(4), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-5', + }, + action: 'update', + }), + metadata: generateMetadata(5), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-6', + }, + action: 'delete', + }), + metadata: generateMetadata(6), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-7', + }, + action: 'delete', + }), + metadata: generateMetadata(7), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-8', + }, + action: 'dummy-action', + }), + metadata: generateMetadata(8), + destination, + connection, + }, + { + message: { + type: 'identify', + action: 'insert', + identifiers: { + id: 'test-id-9', + }, + anonymousId: 'anonId1', + userId: 'userId1', + integrations: { + All: true, + }, + originalTimestamp: '2024-03-04T15:32:56.409Z', + }, + metadata: generateMetadata(9), + destination, + connection, + }, + { + message: generateRecordPayload({ + action: 'insert', + }), + metadata: generateMetadata(10), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-7', + email: 'test@gmail.com', + }, + action: 'insert', + }), + metadata: generateMetadata(11), + destination, + connection, + }, + ], + destType, +}; + +// scenario when all the events are malfunctioned +const routerRequest2 = { + input: [ + { + message: generateRecordPayload({ + identifiers: { + id: [], + }, + action: 'insert', + }), + metadata: generateMetadata(1), + destination, + connection: inValidConnection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-1', + }, + action: 'insert', + }), + metadata: generateMetadata(2), + destination, + connection: inValidConnection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-1', + }, + action: 'insert', + }), + metadata: generateMetadata(3), + destination, + connection: { + ...connection, + config: { + ...connection.config, + destination: { + audienceId: 'test-audience-id', + }, + }, + }, + }, + ], + destType, +}; + +export const data = [ + { + id: 'customerio-segment-router-test-1', + name: destType, + description: 'Basic Router Test to test correct record payloads', + scenario: 'Framework+Business', + successCriteria: 'All events should be transformed successfully and status code should be 200', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: routerRequest1, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: insertOrUpdateEndpoint, + headers, + params, + body: { + JSON: { + ids: ['test-id-1', 'test-id-2', 'test-id-3'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [generateMetadata(1), generateMetadata(2), generateMetadata(3)], + batched: true, + statusCode: 200, + destination, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: insertOrUpdateEndpoint, + headers, + params, + body: { + JSON: { + ids: ['test-id-4', 'test-id-5'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [generateMetadata(4), generateMetadata(5)], + batched: true, + statusCode: 200, + destination, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: deleteEndpoint, + headers, + params, + body: { + JSON: { + ids: ['test-id-6', 'test-id-7'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [generateMetadata(6), generateMetadata(7)], + batched: true, + statusCode: 200, + destination, + }, + { + metadata: [generateMetadata(8)], + batched: false, + statusCode: 400, + error: + "action: Invalid enum value. Expected 'insert' | 'update' | 'delete', received 'dummy-action'", + statTags: RouterInstrumentationErrorStatTags, + destination, + }, + { + metadata: [generateMetadata(9)], + batched: false, + statusCode: 400, + error: 'type: Invalid literal value, expected "record"', + statTags: RouterInstrumentationErrorStatTags, + destination, + }, + { + metadata: [generateMetadata(10)], + batched: false, + statusCode: 400, + error: 'identifiers: cannot be empty', + statTags: RouterInstrumentationErrorStatTags, + destination, + }, + { + metadata: [generateMetadata(11)], + batched: false, + statusCode: 400, + error: 'identifiers: only one identifier is supported', + statTags: RouterInstrumentationErrorStatTags, + destination, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + id: 'customerio-segment-router-test-2', + name: destType, + description: 'Basic Router Test to test incorrect connection config', + scenario: 'Framework', + successCriteria: 'All events should throw error', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: routerRequest2, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + metadata: [generateMetadata(1)], + batched: false, + statusCode: 400, + error: + 'audienceId: String must contain at least 1 character(s); identifierMappings: Required', + statTags: RouterConfigurationErrorStatTags, + destination, + }, + { + metadata: [generateMetadata(2)], + batched: false, + statusCode: 400, + error: + 'audienceId: String must contain at least 1 character(s); identifierMappings: Required', + statTags: RouterConfigurationErrorStatTags, + destination, + }, + { + metadata: [generateMetadata(3)], + batched: false, + statusCode: 400, + error: 'identifierMappings: Required', + statTags: RouterConfigurationErrorStatTags, + destination, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, +]; diff --git a/test/integrations/destinations/delighted/maskedSecrets.ts b/test/integrations/destinations/delighted/maskedSecrets.ts new file mode 100644 index 00000000000..74d160ff192 --- /dev/null +++ b/test/integrations/destinations/delighted/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1)}`; diff --git a/test/integrations/destinations/delighted/network.ts b/test/integrations/destinations/delighted/network.ts index 1ccc785ea32..ce7c7da9dc5 100644 --- a/test/integrations/destinations/delighted/network.ts +++ b/test/integrations/destinations/delighted/network.ts @@ -1,9 +1,11 @@ +import { authHeader1 } from './maskedSecrets'; + export const networkCallsData = [ { httpReq: { url: 'https://api.delighted.com/v1/people.json', method: 'GET', - headers: { Authorization: `Basic ZHVtbXlBcGlLZXk=` }, + headers: { Authorization: authHeader1 }, params: { email: 'identified_user@email.com', }, @@ -17,7 +19,7 @@ export const networkCallsData = [ httpReq: { url: 'https://api.delighted.com/v1/people.json', method: 'GET', - headers: { Authorization: `Basic ZHVtbXlBcGlLZXlmb3JmYWlsdXJl` }, + headers: { Authorization: authHeader1 }, params: { email: 'unidentified_user@email.com', }, @@ -31,9 +33,9 @@ export const networkCallsData = [ httpReq: { url: 'https://api.delighted.com/v1/people.json', method: 'GET', - headers: { Authorization: `Basic ZHVtbXlBcGlLZXlmb3JmYWlsdXJl` }, + headers: { Authorization: authHeader1 }, params: { - email: 'test@rudderlabs.com', + email: 'test429@rudderlabs.com', }, }, httpRes: { diff --git a/test/integrations/destinations/delighted/processor/data.ts b/test/integrations/destinations/delighted/processor/data.ts index f35c2d8ecb8..41d4b8987fb 100644 --- a/test/integrations/destinations/delighted/processor/data.ts +++ b/test/integrations/destinations/delighted/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'delighted', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -77,7 +78,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.delighted.com/v1/people.json', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -116,7 +117,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -186,7 +187,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -211,7 +212,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -295,7 +296,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -320,7 +321,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKeyforfailure', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -409,7 +410,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -497,7 +498,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -585,7 +586,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -666,7 +667,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -754,7 +755,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -847,7 +848,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -918,7 +919,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.delighted.com/v1/people.json', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -956,7 +957,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKeyforfailure', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -995,7 +996,7 @@ export const data = [ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', originalTimestamp: '2019-10-14T09:03:17.562Z', type: 'track', - userId: 'test@rudderlabs.com', + userId: 'test429@rudderlabs.com', event: 'Product Reviewed', properties: { review_id: '12345', @@ -1017,8 +1018,10 @@ export const data = [ status: 200, body: [ { - error: - '{"message":"Error occurred while checking user: {}","destinationResponse":{"response":{},"status":429}}', + error: JSON.stringify({ + message: 'Error occurred while checking user: {}', + destinationResponse: { response: {}, status: 429 }, + }), statTags: { destType: 'DELIGHTED', errorCategory: 'network', diff --git a/test/integrations/destinations/delighted/router/data.ts b/test/integrations/destinations/delighted/router/data.ts index b9e98823831..776f0680a9f 100644 --- a/test/integrations/destinations/delighted/router/data.ts +++ b/test/integrations/destinations/delighted/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'delighted', @@ -12,7 +13,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [{ event: '' }], @@ -54,7 +55,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [{ event: '' }], @@ -120,7 +121,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -131,7 +132,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [{ event: '' }], @@ -151,7 +152,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -162,7 +163,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [{ event: '' }], diff --git a/test/integrations/destinations/drip/maskedSecrets.ts b/test/integrations/destinations/drip/maskedSecrets.ts new file mode 100644 index 00000000000..74d160ff192 --- /dev/null +++ b/test/integrations/destinations/drip/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1)}`; diff --git a/test/integrations/destinations/drip/processor/data.ts b/test/integrations/destinations/drip/processor/data.ts index 1874f932fa1..c0065b128e7 100644 --- a/test/integrations/destinations/drip/processor/data.ts +++ b/test/integrations/destinations/drip/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'drip', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '', enableUserCreation: true, @@ -75,7 +76,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/subscribers', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -119,7 +120,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '', enableUserCreation: true, @@ -204,7 +205,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '', enableUserCreation: true, @@ -266,7 +267,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/subscribers', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -311,7 +312,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: true, @@ -375,7 +376,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/campaigns/915194776/subscribers', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -413,7 +414,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: true, @@ -475,7 +476,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/events', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -517,7 +518,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: true, @@ -600,7 +601,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: false, @@ -662,7 +663,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/events', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -704,7 +705,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: false, @@ -764,7 +765,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/events', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -806,7 +807,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: false, @@ -887,7 +888,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: false, @@ -949,7 +950,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v3/1809802/shopper_activity/order', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -986,7 +987,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: false, @@ -1054,7 +1055,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v3/1809802/shopper_activity/order', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1097,7 +1098,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: false, @@ -1160,7 +1161,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/events', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1202,7 +1203,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '', enableUserCreation: true, @@ -1443,7 +1444,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/subscribers', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/drip/router/data.ts b/test/integrations/destinations/drip/router/data.ts index 44aac7dd1ab..47bae3d87ef 100644 --- a/test/integrations/destinations/drip/router/data.ts +++ b/test/integrations/destinations/drip/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'drip', @@ -12,7 +13,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '', enableUserCreation: true, @@ -54,7 +55,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: true, @@ -123,7 +124,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -134,7 +135,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '', enableUserCreation: true, @@ -163,7 +164,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -174,7 +175,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: true, diff --git a/test/integrations/destinations/dynamic_yield/processor/data.ts b/test/integrations/destinations/dynamic_yield/processor/data.ts index f72f1574f71..76537a589b2 100644 --- a/test/integrations/destinations/dynamic_yield/processor/data.ts +++ b/test/integrations/destinations/dynamic_yield/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'dynamic_yield', @@ -32,7 +34,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: true, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -62,7 +64,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -126,7 +128,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: false, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -156,7 +158,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -233,7 +235,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: false, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -263,7 +265,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -326,7 +328,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: false, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -356,7 +358,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -433,7 +435,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: false, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -463,7 +465,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -541,7 +543,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: false, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -571,7 +573,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -667,7 +669,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: false, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -697,7 +699,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -774,7 +776,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -845,7 +847,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -999,7 +1001,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, diff --git a/test/integrations/destinations/emarsys/dataDelivery/data.ts b/test/integrations/destinations/emarsys/dataDelivery/data.ts index ac3ec780f7a..6f3ae661a7a 100644 --- a/test/integrations/destinations/emarsys/dataDelivery/data.ts +++ b/test/integrations/destinations/emarsys/dataDelivery/data.ts @@ -1,6 +1,6 @@ import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; - +import { defaultAccessToken } from '../../../common/secrets'; export const headerBlockWithCorrectAccessToken = { 'Content-Type': 'application/json', Accept: 'application/json', @@ -115,7 +115,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -127,7 +127,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -220,12 +220,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: '{"2004":"Invalid key field id: 100"}', + error: JSON.stringify({ '2004': 'Invalid key field id: 100' }), }, { statusCode: 400, metadata: generateMetadata(2), - error: '{"2004":"Invalid key field id: 100"}', + error: JSON.stringify({ '2004': 'Invalid key field id: 100' }), }, ], }, @@ -337,7 +337,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(2), - error: '{"2010":"Contacts with the external id already exist: 3"}', + error: JSON.stringify({ '2010': 'Contacts with the external id already exist: 3' }), }, ], }, @@ -427,12 +427,20 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: '{"replyCode":2004,"replyText":"Invalid key field id: wrong_id","data":""}', + error: JSON.stringify({ + replyCode: 2004, + replyText: 'Invalid key field id: wrong_id', + data: '', + }), }, { statusCode: 400, metadata: generateMetadata(2), - error: '{"replyCode":2004,"replyText":"Invalid key field id: wrong_id","data":""}', + error: JSON.stringify({ + replyCode: 2004, + replyText: 'Invalid key field id: wrong_id', + data: '', + }), }, ], }, @@ -495,12 +503,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(2), - error: '{"2008":"No contact found with the external id: 3"}', + error: JSON.stringify({ '2008': 'No contact found with the external id: 3' }), }, { statusCode: 400, metadata: generateMetadata(3), - error: '{"2008":"No contact found with the external id: 3"}', + error: JSON.stringify({ '2008': 'No contact found with the external id: 3' }), }, { statusCode: 200, @@ -547,7 +555,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: '{"replyCode":1,"replyText":"Action Wrong-id is invalid.","data":""}', + error: JSON.stringify({ + replyCode: 1, + replyText: 'Action Wrong-id is invalid.', + data: '', + }), }, ], }, diff --git a/test/integrations/destinations/engage/deleteUsers/data.ts b/test/integrations/destinations/engage/deleteUsers/data.ts index 5a6ea9d2680..d4e76549c6c 100644 --- a/test/integrations/destinations/engage/deleteUsers/data.ts +++ b/test/integrations/destinations/engage/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { secret1, secret2 } from '../maskedSecrets'; + export const data = [ { name: 'engage', @@ -22,8 +24,8 @@ export const data = [ }, ], config: { - publicKey: 'abcd', - privateKey: 'efgh', + publicKey: secret1, + privateKey: secret2, }, }, ], @@ -64,8 +66,8 @@ export const data = [ }, ], config: { - publicKey: 'abcd', - privateKey: 'efgh', + publicKey: secret1, + privateKey: secret2, }, }, ], @@ -106,8 +108,8 @@ export const data = [ }, ], config: { - publicKey: 'abcd', - privateKey: 'efgh', + publicKey: secret1, + privateKey: secret2, }, }, ], @@ -142,8 +144,8 @@ export const data = [ }, ], config: { - publicKey: 'abcd', - privateKey: 'efgh', + publicKey: secret1, + privateKey: secret2, }, }, ], @@ -181,7 +183,7 @@ export const data = [ }, ], config: { - privateKey: 'abcd', + privateKey: secret2, }, }, ], @@ -219,8 +221,8 @@ export const data = [ }, ], config: { - publicKey: 'abcd', - privateKey: 'efgh', + publicKey: secret1, + privateKey: secret2, }, }, ], diff --git a/test/integrations/destinations/engage/maskedSecrets.ts b/test/integrations/destinations/engage/maskedSecrets.ts new file mode 100644 index 00000000000..cc8cbd337ba --- /dev/null +++ b/test/integrations/destinations/engage/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/engage/network.ts b/test/integrations/destinations/engage/network.ts index a675603d4ec..0a748e4eb33 100644 --- a/test/integrations/destinations/engage/network.ts +++ b/test/integrations/destinations/engage/network.ts @@ -1,3 +1,5 @@ +import { authHeader1 } from './maskedSecrets'; + const deleteNwData = [ { httpReq: { @@ -61,7 +63,7 @@ const deleteNwData = [ url: 'https://api.engage.so/v1/users/6', 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZDplZmdo', + Authorization: authHeader1, }, httpRes: { data: { @@ -78,7 +80,7 @@ const deleteNwData = [ url: 'https://api.engage.so/v1/users/7', 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZDplZmdo', + Authorization: authHeader1, }, httpRes: { status: 200, @@ -91,7 +93,7 @@ const deleteNwData = [ url: 'https://api.engage.so/v1/users/8', 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZDplZmdo', + Authorization: authHeader1, }, httpRes: { data: { @@ -108,7 +110,7 @@ const deleteNwData = [ url: 'https://api.engage.so/v1/users/9', 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZDplZmdo', + Authorization: authHeader1, }, httpRes: { status: 200, diff --git a/test/integrations/destinations/engage/processor/data.ts b/test/integrations/destinations/engage/processor/data.ts index b0b3ae8ec3e..1bca1fb1a32 100644 --- a/test/integrations/destinations/engage/processor/data.ts +++ b/test/integrations/destinations/engage/processor/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; + export const data = [ { name: 'engage', @@ -21,8 +23,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, }, }, }, @@ -83,8 +85,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -127,8 +129,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/users/1', @@ -168,8 +169,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -212,8 +213,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/users/1', @@ -253,8 +253,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, }, }, }, @@ -293,8 +293,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/users/1', @@ -326,8 +325,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, }, }, }, @@ -357,8 +356,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/users/1/events', @@ -384,8 +382,8 @@ export const data = [ message: { userId: 1, name: 'Contact Customer Care', category: 'Help', type: 'page' }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, }, }, }, @@ -411,8 +409,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/users/1/events', @@ -447,8 +444,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -472,8 +469,7 @@ export const data = [ endpoint: 'https://api.engage.so/v1/lists/17/subscribers/246', headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, params: {}, body: { JSON: { subscribed: 'false' }, JSON_ARRAY: {}, XML: {}, FORM: {} }, @@ -503,8 +499,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -559,8 +555,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -597,8 +593,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/lists/17/subscribers', @@ -630,8 +625,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -656,8 +651,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/lists/17/subscribers/1', diff --git a/test/integrations/destinations/engage/router/data.ts b/test/integrations/destinations/engage/router/data.ts index 248deff04dc..2dec38eebda 100644 --- a/test/integrations/destinations/engage/router/data.ts +++ b/test/integrations/destinations/engage/router/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; + export const data = [ { name: 'engage', @@ -18,8 +20,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -47,8 +49,7 @@ export const data = [ endpoint: 'https://api.engage.so/v1/lists/17/subscribers/246', headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, params: {}, body: { JSON: { subscribed: true }, JSON_ARRAY: {}, XML: {}, FORM: {} }, @@ -56,8 +57,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -107,8 +108,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -155,16 +156,15 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/users/1', }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -199,8 +199,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -224,8 +224,8 @@ export const data = [ metadata: [{ jobId: 3, userId: 'u1' }], destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, diff --git a/test/integrations/destinations/eventbridge/data.ts b/test/integrations/destinations/eventbridge/data.ts index e9edde68dcd..5a5bc3d64d9 100644 --- a/test/integrations/destinations/eventbridge/data.ts +++ b/test/integrations/destinations/eventbridge/data.ts @@ -142,8 +142,97 @@ export const data = [ { output: { DetailType: 'newDetailType', - Detail: - '{"channel":"web","context":{"app":{"build":"1.0.0","name":"RudderLabs JavaScript SDK","namespace":"com.rudderlabs.javascript","version":"1.1.2"},"traits":{"abc":"1234"},"library":{"name":"RudderLabs JavaScript SDK","version":"1.1.2"},"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36","locale":"en-GB","os":{"name":"","version":""},"screen":{"density":2},"page":{"path":"/tests/html/ecomm_test.html","referrer":"http://0.0.0.0:1112/tests/html/","search":"","title":"GA Ecommerce Test","url":"http://0.0.0.0:1112/tests/html/ecomm_test.html"}},"type":"track","messageId":"9116b734-7e6b-4497-ab51-c16744d4487e","originalTimestamp":"2020-06-24T12:05:19.394Z","anonymousId":"38e169a1-3234-46f7-9ceb-c1a6a69005fe","userId":"123","event":"Checkout Started","properties":{"order_id":"5241735","value":31.98,"revenue":31.98,"shipping":4,"coupon":"APPARELSALE","currency":"GBP","products":[{"id":"product-bacon-jam","sku":"sku-1","category":"Merch","name":"Food/Drink","brand":"","variant":"Extra topped","price":3,"quantity":2,"currency":"GBP","position":1,"value":6,"typeOfProduct":"Food","url":"https://www.example.com/product/bacon-jam","image_url":"https://www.example.com/product/bacon-jam.jpg"},{"id":"product-t-shirt","sku":"sku-2","category":"Merch","name":"T-Shirt","brand":"Levis","variant":"White","price":12.99,"quantity":1,"currency":"GBP","position":2,"value":12.99,"typeOfProduct":"Shirt","url":"https://www.example.com/product/t-shirt","image_url":"https://www.example.com/product/t-shirt.jpg"},{"id":"offer-t-shirt","sku":"sku-3","category":"Merch","name":"T-Shirt-on-offer","brand":"Levis","variant":"Black","price":12.99,"quantity":1,"currency":"GBP","value":12.99,"coupon":"APPARELSALE","typeOfProduct":"Shirt","url":"https://www.example.com/product/offer-t-shirt","image_url":"https://www.example.com/product/offer-t-shirt.jpg"}]},"integrations":{"All":true},"sentAt":"2020-06-24T12:05:19.395Z"}', + Detail: JSON.stringify({ + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { abc: '1234' }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.2' }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { name: '', version: '' }, + screen: { density: 2 }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'GA Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2020-06-24T12:05:19.394Z', + anonymousId: '38e169a1-3234-46f7-9ceb-c1a6a69005fe', + userId: '123', + event: 'Checkout Started', + properties: { + order_id: '5241735', + value: 31.98, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'GBP', + products: [ + { + id: 'product-bacon-jam', + sku: 'sku-1', + category: 'Merch', + name: 'Food/Drink', + brand: '', + variant: 'Extra topped', + price: 3, + quantity: 2, + currency: 'GBP', + position: 1, + value: 6, + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + }, + { + id: 'product-t-shirt', + sku: 'sku-2', + category: 'Merch', + name: 'T-Shirt', + brand: 'Levis', + variant: 'White', + price: 12.99, + quantity: 1, + currency: 'GBP', + position: 2, + value: 12.99, + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/t-shirt', + image_url: 'https://www.example.com/product/t-shirt.jpg', + }, + { + id: 'offer-t-shirt', + sku: 'sku-3', + category: 'Merch', + name: 'T-Shirt-on-offer', + brand: 'Levis', + variant: 'Black', + price: 12.99, + quantity: 1, + currency: 'GBP', + value: 12.99, + coupon: 'APPARELSALE', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/offer-t-shirt', + image_url: 'https://www.example.com/product/offer-t-shirt.jpg', + }, + ], + }, + integrations: { All: true }, + sentAt: '2020-06-24T12:05:19.395Z', + }), EventBusName: 'rudder-test1', Resources: [ 'arn:aws:events:*****:*****:event-bus/rudder-test1', @@ -300,8 +389,96 @@ export const data = [ { output: { DetailType: 'newDetailType', - Detail: - '{"channel":"web","context":{"app":{"build":"1.0.0","name":"RudderLabs JavaScript SDK","namespace":"com.rudderlabs.javascript","version":"1.1.2"},"traits":{"abc":"1234"},"library":{"name":"RudderLabs JavaScript SDK","version":"1.1.2"},"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36","locale":"en-GB","os":{"name":"","version":""},"screen":{"density":2},"page":{"path":"/tests/html/ecomm_test.html","referrer":"http://0.0.0.0:1112/tests/html/","search":"","title":"GA Ecommerce Test","url":"http://0.0.0.0:1112/tests/html/ecomm_test.html"}},"type":"track","messageId":"9116b734-7e6b-4497-ab51-c16744d4487e","originalTimestamp":"2020-06-24T12:05:19.394Z","anonymousId":"38e169a1-3234-46f7-9ceb-c1a6a69005fe","event":"Checkout Started","properties":{"order_id":"5241735","value":31.98,"revenue":31.98,"shipping":4,"coupon":"APPARELSALE","currency":"GBP","products":[{"id":"product-bacon-jam","sku":"sku-1","category":"Merch","name":"Food/Drink","brand":"","variant":"Extra topped","price":3,"quantity":2,"currency":"GBP","position":1,"value":6,"typeOfProduct":"Food","url":"https://www.example.com/product/bacon-jam","image_url":"https://www.example.com/product/bacon-jam.jpg"},{"id":"product-t-shirt","sku":"sku-2","category":"Merch","name":"T-Shirt","brand":"Levis","variant":"White","price":12.99,"quantity":1,"currency":"GBP","position":2,"value":12.99,"typeOfProduct":"Shirt","url":"https://www.example.com/product/t-shirt","image_url":"https://www.example.com/product/t-shirt.jpg"},{"id":"offer-t-shirt","sku":"sku-3","category":"Merch","name":"T-Shirt-on-offer","brand":"Levis","variant":"Black","price":12.99,"quantity":1,"currency":"GBP","value":12.99,"coupon":"APPARELSALE","typeOfProduct":"Shirt","url":"https://www.example.com/product/offer-t-shirt","image_url":"https://www.example.com/product/offer-t-shirt.jpg"}]},"integrations":{"All":true},"sentAt":"2020-06-24T12:05:19.395Z"}', + Detail: JSON.stringify({ + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { abc: '1234' }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.2' }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { name: '', version: '' }, + screen: { density: 2 }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'GA Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2020-06-24T12:05:19.394Z', + anonymousId: '38e169a1-3234-46f7-9ceb-c1a6a69005fe', + event: 'Checkout Started', + properties: { + order_id: '5241735', + value: 31.98, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'GBP', + products: [ + { + id: 'product-bacon-jam', + sku: 'sku-1', + category: 'Merch', + name: 'Food/Drink', + brand: '', + variant: 'Extra topped', + price: 3, + quantity: 2, + currency: 'GBP', + position: 1, + value: 6, + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + }, + { + id: 'product-t-shirt', + sku: 'sku-2', + category: 'Merch', + name: 'T-Shirt', + brand: 'Levis', + variant: 'White', + price: 12.99, + quantity: 1, + currency: 'GBP', + position: 2, + value: 12.99, + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/t-shirt', + image_url: 'https://www.example.com/product/t-shirt.jpg', + }, + { + id: 'offer-t-shirt', + sku: 'sku-3', + category: 'Merch', + name: 'T-Shirt-on-offer', + brand: 'Levis', + variant: 'Black', + price: 12.99, + quantity: 1, + currency: 'GBP', + value: 12.99, + coupon: 'APPARELSALE', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/offer-t-shirt', + image_url: 'https://www.example.com/product/offer-t-shirt.jpg', + }, + ], + }, + integrations: { All: true }, + sentAt: '2020-06-24T12:05:19.395Z', + }), EventBusName: 'rudder-test1', Resources: [ 'arn:aws:events:*****:*****:event-bus/rudder-test1', diff --git a/test/integrations/destinations/examples/processor/data.ts b/test/integrations/destinations/examples/processor/data.ts new file mode 100644 index 00000000000..bd108005a78 --- /dev/null +++ b/test/integrations/destinations/examples/processor/data.ts @@ -0,0 +1,24 @@ +import { TestCaseData } from '../../../testTypes'; +export const skip = true; +export const data: TestCaseData[] = [ + { + name: 'test', + module: 'test', + description: 'test', + feature: 'test', + input: { + request: { + method: 'GET', + body: { + test: 'test', + }, + }, + }, + output: { + response: { + status: 200, + body: 'test', + }, + }, + }, +]; diff --git a/test/integrations/destinations/examples/router/data.ts b/test/integrations/destinations/examples/router/data.ts new file mode 100644 index 00000000000..601fedd66e0 --- /dev/null +++ b/test/integrations/destinations/examples/router/data.ts @@ -0,0 +1,24 @@ +import { TestCaseData } from '../../../testTypes'; +export const data: TestCaseData[] = [ + { + name: 'test', + module: 'test', + description: 'test', + feature: 'test', + skip: true, + input: { + request: { + method: 'GET', + body: { + test: 'test', + }, + }, + }, + output: { + response: { + status: 200, + body: 'test', + }, + }, + }, +]; diff --git a/test/integrations/destinations/facebook_conversions/processor/data.ts b/test/integrations/destinations/facebook_conversions/processor/data.ts index 49d2416726c..7832962f7ed 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/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -323,7 +323,21 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"spin_result","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"value":400,"currency":"USD"}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'spin_result', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + value: 400, + currency: 'USD', + }, + }), ], }, }, @@ -433,7 +447,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -442,7 +456,24 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Search","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"content_type":"product","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'Search', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + content_ids: [], + contents: [], + content_type: 'product', + currency: 'USD', + value: 400, + }, + }), ], }, }, @@ -552,7 +583,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -561,7 +592,24 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddToCart","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"content_type":"product","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'AddToCart', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + content_ids: [], + contents: [], + content_type: 'product', + currency: 'USD', + value: 400, + }, + }), ], }, }, @@ -671,7 +719,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -680,7 +728,24 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"ViewContent","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"content_type":"product","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'ViewContent', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + content_ids: [], + contents: [], + content_type: 'product', + currency: 'USD', + value: 400, + }, + }), ], }, }, @@ -797,7 +862,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -806,7 +871,25 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"ViewContent","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"products":[{"product_id":1234,"quantity":5,"price":55}],"content_ids":[1234],"contents":[{"id":1234,"quantity":5,"item_price":55}],"content_type":"product","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'ViewContent', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + products: [{ product_id: 1234, quantity: 5, price: 55 }], + content_ids: [1234], + contents: [{ id: 1234, quantity: 5, item_price: 55 }], + content_type: 'product', + currency: 'USD', + value: 400, + }, + }), ], }, }, @@ -917,7 +1000,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -926,7 +1009,26 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"ViewContent","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"category":"randomCategory","content_ids":["randomCategory"],"contents":[{"id":"randomCategory","quantity":1}],"content_type":"product_group","content_category":"randomCategory","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'ViewContent', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + category: 'randomCategory', + content_ids: ['randomCategory'], + contents: [{ id: 'randomCategory', quantity: 1 }], + content_type: 'product_group', + content_category: 'randomCategory', + currency: 'USD', + value: 400, + }, + }), ], }, }, @@ -1036,7 +1138,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1045,7 +1147,24 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddToWishlist","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"currency":"USD","value":400,"num_items":0}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'AddToWishlist', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + content_ids: [], + contents: [], + currency: 'USD', + value: 400, + num_items: 0, + }, + }), ], }, }, @@ -1165,7 +1284,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1174,7 +1293,27 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddPaymentInfo","event_time":1699784211,"action_source":"website","custom_data":{"application_tracking_enabled":1,"content_name":"Checkout","content_type":"product","num_items":1,"products":[{"id":"12809","price":80,"quantity":1}],"revenue":93.99,"content_ids":["12809"],"contents":[{"id":"12809","quantity":1,"item_price":80}],"currency":"USD","value":93.99}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'AddPaymentInfo', + event_time: 1699784211, + action_source: 'website', + custom_data: { + application_tracking_enabled: 1, + content_name: 'Checkout', + content_type: 'product', + num_items: 1, + products: [{ id: '12809', price: 80, quantity: 1 }], + revenue: 93.99, + content_ids: ['12809'], + contents: [{ id: '12809', quantity: 1, item_price: 80 }], + currency: 'USD', + value: 93.99, + }, + }), ], }, }, @@ -1290,7 +1429,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1299,7 +1438,29 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddPaymentInfo","event_time":1699784211,"action_source":"website","custom_data":{"application_tracking_enabled":1,"content_name":"Checkout","content_type":"product","num_items":1,"id":"12809","price":80,"quantity":1,"revenue":93.99,"content_ids":["12809"],"contents":[{"id":"12809","quantity":1,"item_price":80}],"currency":"USD","value":93.99}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'AddPaymentInfo', + event_time: 1699784211, + action_source: 'website', + custom_data: { + application_tracking_enabled: 1, + content_name: 'Checkout', + content_type: 'product', + num_items: 1, + id: '12809', + price: 80, + quantity: 1, + revenue: 93.99, + content_ids: ['12809'], + contents: [{ id: '12809', quantity: 1, item_price: 80 }], + currency: 'USD', + value: 93.99, + }, + }), ], }, }, @@ -1418,7 +1579,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1427,7 +1588,40 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Purchase","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"products":[{"product_id":1234,"quantity":5,"price":55,"delivery_category":"home_delivery"}],"content_ids":[1234],"contents":[{"id":1234,"quantity":5,"item_price":55,"delivery_category":"home_delivery"}],"content_type":"product","currency":"USD","value":400,"num_items":1}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'Purchase', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + products: [ + { + product_id: 1234, + quantity: 5, + price: 55, + delivery_category: 'home_delivery', + }, + ], + content_ids: [1234], + contents: [ + { + id: 1234, + quantity: 5, + item_price: 55, + delivery_category: 'home_delivery', + }, + ], + content_type: 'product', + currency: 'USD', + value: 400, + num_items: 1, + }, + }), ], }, }, @@ -1546,7 +1740,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1555,7 +1749,34 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Purchase","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"delivery_category":"home_delivery","products":[{"product_id":1234,"quantity":5,"price":55}],"content_ids":[1234],"contents":[{"id":1234,"quantity":5,"item_price":55,"delivery_category":"home_delivery"}],"content_type":"product","currency":"USD","value":400,"num_items":1}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'Purchase', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + delivery_category: 'home_delivery', + products: [{ product_id: 1234, quantity: 5, price: 55 }], + content_ids: [1234], + contents: [ + { + id: 1234, + quantity: 5, + item_price: 55, + delivery_category: 'home_delivery', + }, + ], + content_type: 'product', + currency: 'USD', + value: 400, + num_items: 1, + }, + }), ], }, }, @@ -1646,7 +1867,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1655,7 +1876,26 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Purchase","event_time":1699784211,"action_source":"website","custom_data":{"content_type":"product_group","revenue":400,"additional_bet_index":0,"products":[{"product_id":1234,"quantity":5,"price":55}],"content_ids":[1234],"contents":[{"id":1234,"quantity":5,"item_price":55}],"currency":"USD","value":400,"num_items":1}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'Purchase', + event_time: 1699784211, + action_source: 'website', + custom_data: { + content_type: 'product_group', + revenue: 400, + additional_bet_index: 0, + products: [{ product_id: 1234, quantity: 5, price: 55 }], + content_ids: [1234], + contents: [{ id: 1234, quantity: 5, item_price: 55 }], + currency: 'USD', + value: 400, + num_items: 1, + }, + }), ], }, }, @@ -1767,7 +2007,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1776,7 +2016,26 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddToCart","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"id":"452345234","quantity":5,"content_ids":"452345234","contents":[{"id":"452345234","quantity":5}],"content_type":"product","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'AddToCart', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + id: '452345234', + quantity: 5, + content_ids: '452345234', + contents: [{ id: '452345234', quantity: 5 }], + content_type: 'product', + currency: 'USD', + value: 400, + }, + }), ], }, }, diff --git a/test/integrations/destinations/facebook_conversions/router/data.ts b/test/integrations/destinations/facebook_conversions/router/data.ts index 5a9c0c513fe..2a9bed98f75 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/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -121,7 +121,21 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"spin_result","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"value":400,"currency":"USD"}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'spin_result', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + value: 400, + currency: 'USD', + }, + }), ], }, }, @@ -150,7 +164,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -159,7 +173,24 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Search","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"content_type":"product","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'Search', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + content_ids: [], + contents: [], + content_type: 'product', + currency: 'USD', + value: 400, + }, + }), ], }, }, diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/business.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/business.ts index 2b4af61ac3e..60f382e5661 100644 --- a/test/integrations/destinations/facebook_pixel/dataDelivery/business.ts +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/business.ts @@ -4,7 +4,19 @@ import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/confi export const testFormData = { data: [ - '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + JSON.stringify({ + user_data: { + external_id: 'c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab', + client_ip_address: '32.122.223.26', + client_user_agent: + 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1', + }, + event_name: 'Checkout Step Viewed', + event_time: 1654772112, + event_source_url: 'https://www.my.kaiser.com/checkout', + event_id: '4f002656-a7b2-4c17-b9bd-8caa5a29190a', + custom_data: { checkout_id: '26SF29B', site: 'www.my.kaiser.com', step: 1 }, + }), ], }; export const statTags = { @@ -91,7 +103,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: '{"events_received":1,"fbtrace_id":"facebook_trace_id"}', + error: JSON.stringify({ events_received: 1, fbtrace_id: 'facebook_trace_id' }), statusCode: 200, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts index 0e004c11832..9e38548834a 100644 --- a/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts @@ -467,8 +467,13 @@ export const v0TestData = [ body: { output: { status: 500, - message: - '{"message":"Unhandled random error","type":"RandomException","code":5,"error_subcode":12,"fbtrace_id":"facebook_px_trace_id_10"}', + message: JSON.stringify({ + message: 'Unhandled random error', + type: 'RandomException', + code: 5, + error_subcode: 12, + fbtrace_id: 'facebook_px_trace_id_10', + }), destinationResponse: { error: { message: 'Unhandled random error', diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/other.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/other.ts index 154c6f75ad9..a327bd782f2 100644 --- a/test/integrations/destinations/facebook_pixel/dataDelivery/other.ts +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/other.ts @@ -72,8 +72,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ body: { output: { status: 500, - message: - '{"message":"Unhandled random error","type":"RandomException","code":5,"error_subcode":12,"fbtrace_id":"facebook_px_trace_id_10"}', + message: JSON.stringify({ + message: 'Unhandled random error', + type: 'RandomException', + code: 5, + error_subcode: 12, + fbtrace_id: 'facebook_px_trace_id_10', + }), statTags: { ...statTags, errorType: 'retryable', @@ -81,8 +86,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ }, response: [ { - error: - '{"message":"Unhandled random error","type":"RandomException","code":5,"error_subcode":12,"fbtrace_id":"facebook_px_trace_id_10"}', + error: JSON.stringify({ + message: 'Unhandled random error', + type: 'RandomException', + code: 5, + error_subcode: 12, + fbtrace_id: 'facebook_px_trace_id_10', + }), statusCode: 500, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/facebook_pixel/processor/configLevelFeaturesTestData.ts b/test/integrations/destinations/facebook_pixel/processor/configLevelFeaturesTestData.ts index 5a7beb41740..a8baee05863 100644 --- a/test/integrations/destinations/facebook_pixel/processor/configLevelFeaturesTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/configLevelFeaturesTestData.ts @@ -116,6 +116,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -203,6 +204,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -294,6 +296,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -397,6 +400,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { @@ -500,6 +504,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { @@ -611,6 +616,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { @@ -702,6 +708,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts b/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts index 8e7f50ec2d2..a08469f5531 100644 --- a/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts @@ -124,6 +124,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -207,6 +208,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -218,7 +220,7 @@ export const ecommTestData: ProcessorTestData[] = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, FORM: { @@ -314,6 +316,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -398,6 +401,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -482,6 +486,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -561,6 +566,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -572,7 +578,7 @@ export const ecommTestData: ProcessorTestData[] = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, FORM: { @@ -669,6 +675,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -754,6 +761,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -800,6 +808,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -879,6 +888,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -890,7 +900,7 @@ export const ecommTestData: ProcessorTestData[] = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, FORM: { @@ -988,6 +998,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -1097,6 +1108,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts b/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts index d315b03cead..70419f7a0b0 100644 --- a/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts @@ -1,5 +1,5 @@ import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; -import { Destination } from '../../../../../src/types'; +import { Destination, RudderMessage } from '../../../../../src/types'; import { generateMetadata, transformResultBuilder, overrideDestination } from '../../../testUtils'; import { ProcessorTestData } from '../../../testTypes'; @@ -81,7 +81,7 @@ const commonMessage = { plan: 'standard plan', name: 'rudder test', }, - type: 'identify', + type: 'identify' as const, messageId: '84e26acc-56a5-4835-8233-591137fca468', originalTimestamp: '2023-10-14T15:46:51.693229+05:30', anonymousId: '00000000000000000000000000', @@ -120,6 +120,7 @@ export const identifyTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { advancedMapping: false }), }, ], + method: 'POST', }, }, output: { @@ -160,6 +161,7 @@ export const identifyTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/facebook_pixel/processor/pageScreenTestData.ts b/test/integrations/destinations/facebook_pixel/processor/pageScreenTestData.ts index dee772522ab..443c9e25be6 100644 --- a/test/integrations/destinations/facebook_pixel/processor/pageScreenTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/pageScreenTestData.ts @@ -148,6 +148,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -228,6 +229,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { standardPageCall: true }), }, ], + method: 'POST', }, }, output: { @@ -288,6 +290,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { standardPageCall: true }), }, ], + method: 'POST', }, }, output: { @@ -371,6 +374,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -455,6 +459,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -532,6 +537,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { standardPageCall: true }), }, ], + method: 'POST', }, }, output: { @@ -590,6 +596,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { standardPageCall: true }), }, ], + method: 'POST', }, }, output: { @@ -673,6 +680,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/facebook_pixel/processor/trackTestData.ts b/test/integrations/destinations/facebook_pixel/processor/trackTestData.ts index 9fd65945c4d..a3f2ff0ed41 100644 --- a/test/integrations/destinations/facebook_pixel/processor/trackTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/trackTestData.ts @@ -86,6 +86,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -159,6 +160,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts b/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts index d242ac990d1..eca683e2bbe 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/v20.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.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 f3df4506a5a..e711ba103f1 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/v20.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, body: { @@ -135,7 +135,15 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08"},"event_name":"spin_result","event_time":1697278611,"action_source":"other","custom_data":{"additional_bet_index":0,"value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + }, + event_name: 'spin_result', + event_time: 1697278611, + action_source: 'other', + custom_data: { additional_bet_index: 0, value: 400 }, + }), ], }, }, @@ -165,7 +173,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, body: { @@ -174,7 +182,24 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"external_id":"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","ph":"593a6d58f34eb5c3de4f47e38d1faaa7d389fafe332a85400b1e54498391c579","ge":"252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111","ln":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","fn":"2c2ccf28d806f6f9a34b67aa874d2113b7ac1444f1a4092541b8b75b84771747","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"identify","event_time":1697221800,"event_id":"84e26acc-56a5-4835-8233-591137fca468","action_source":"website"}', + JSON.stringify({ + user_data: { + external_id: + '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + ph: '593a6d58f34eb5c3de4f47e38d1faaa7d389fafe332a85400b1e54498391c579', + ge: '252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111', + ln: '532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25', + fn: '2c2ccf28d806f6f9a34b67aa874d2113b7ac1444f1a4092541b8b75b84771747', + client_ip_address: '0.0.0.0', + client_user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + }, + event_name: 'identify', + event_time: 1697221800, + event_id: '84e26acc-56a5-4835-8233-591137fca468', + action_source: 'website', + }), ], }, }, diff --git a/test/integrations/destinations/factorsai/data.ts b/test/integrations/destinations/factorsai/data.ts index be13c291f42..cf1286140d6 100644 --- a/test/integrations/destinations/factorsai/data.ts +++ b/test/integrations/destinations/factorsai/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from './maskedSecrets'; export const data = [ { name: 'factorsai', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -87,7 +88,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -110,7 +111,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -175,7 +176,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -251,7 +252,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -274,7 +275,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -332,7 +333,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -355,7 +356,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -403,7 +404,7 @@ export const data = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -426,7 +427,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -532,7 +533,7 @@ export const data = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -555,7 +556,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -631,7 +632,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -654,7 +655,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -726,7 +727,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -749,7 +750,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -799,7 +800,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', diff --git a/test/integrations/destinations/factorsai/maskedSecrets.ts b/test/integrations/destinations/factorsai/maskedSecrets.ts new file mode 100644 index 00000000000..ba0b28ba8a1 --- /dev/null +++ b/test/integrations/destinations/factorsai/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + '')}`; diff --git a/test/integrations/destinations/fb/dataDelivery/business.ts b/test/integrations/destinations/fb/dataDelivery/business.ts index 156dc265725..57e4f3447b2 100644 --- a/test/integrations/destinations/fb/dataDelivery/business.ts +++ b/test/integrations/destinations/fb/dataDelivery/business.ts @@ -10,19 +10,96 @@ export const testData1 = { 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 640, + 480, + '1.23', + 0, + 0, + 0, + 'Europe/Berlin', + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), advertiser_tracking_enabled: '0', application_tracking_enabled: '0', }; export const testData2 = { - extinfo: '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Main.1233"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { _logTime: 1567333011693, _eventName: 'Viewed Screen', fb_description: 'Main.1233' }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -123,7 +200,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: '{"events_received":1,"fbtrace_id":"facebook_trace_id"}', + error: JSON.stringify({ events_received: 1, fbtrace_id: 'facebook_trace_id' }), statusCode: 200, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/fb/dataDelivery/data.ts b/test/integrations/destinations/fb/dataDelivery/data.ts index dfa5dbc65e3..1fb4e394168 100644 --- a/test/integrations/destinations/fb/dataDelivery/data.ts +++ b/test/integrations/destinations/fb/dataDelivery/data.ts @@ -23,11 +23,70 @@ export const existingTestData = [ 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 640, + 480, + '1.23', + 0, + 0, + 0, + 'Europe/Berlin', + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), advertiser_tracking_enabled: '0', application_tracking_enabled: '0', }, @@ -103,11 +162,70 @@ export const existingTestData = [ 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 640, + 480, + '1.23', + 0, + 0, + 0, + 'Europe/Berlin', + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), advertiser_tracking_enabled: '0', application_tracking_enabled: '0', }, @@ -167,11 +285,70 @@ export const existingTestData = [ 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 640, + 480, + '1.23', + 0, + 0, + 0, + 'Europe/Berlin', + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), advertiser_tracking_enabled: '0', application_tracking_enabled: '0', }, @@ -249,10 +426,31 @@ export const existingTestData = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Main.1233"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Main.1233', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -319,10 +517,31 @@ export const existingTestData = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Main.1233"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Main.1233', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', diff --git a/test/integrations/destinations/fb/processor/data.ts b/test/integrations/destinations/fb/processor/data.ts index b0b4ba9ecf8..049e1728057 100644 --- a/test/integrations/destinations/fb/processor/data.ts +++ b/test/integrations/destinations/fb/processor/data.ts @@ -610,11 +610,70 @@ export const data = [ 'ud[fn]': '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 640, + 480, + '1.23', + 0, + 0, + 0, + 'Europe/Berlin', + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), advertiser_tracking_enabled: '0', application_tracking_enabled: '0', }, @@ -795,11 +854,70 @@ export const data = [ 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 640, + 480, + '1.23', + 0, + 0, + 0, + 'Europe/Berlin', + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), advertiser_tracking_enabled: '0', application_tracking_enabled: '0', }, @@ -903,10 +1021,31 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Main.1233"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Main.1233', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -1003,10 +1142,31 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Main Screen","fb_description":"Main"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Main Screen', + fb_description: 'Main', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -1187,10 +1347,31 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["i2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Viewed Main Screen1 by expicit call Screen"}]', + extinfo: JSON.stringify([ + 'i2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Viewed Main Screen1 by expicit call Screen', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -1287,10 +1468,31 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Viewed Main Screen1 by expicit call Screen"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Viewed Main Screen1 by expicit call Screen', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -1387,10 +1589,31 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Viewed Main Screen1 by expicit call Screen"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Viewed Main Screen1 by expicit call Screen', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -1561,10 +1784,69 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', advertiser_id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', @@ -1741,10 +2023,69 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', advertiser_id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', @@ -1843,9 +2184,31 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - extinfo: '["i2","","","","","","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Viewed Main Screen1 by expicit call Screen"}]', + extinfo: JSON.stringify([ + 'i2', + '', + '', + '', + '', + '', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Viewed Main Screen1 by expicit call Screen', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -2163,10 +2526,69 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":0,"fb_currency":"INR","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345"]}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 0, + fb_currency: 'INR', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345'], + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', diff --git a/test/integrations/destinations/fb_custom_audience/dataDelivery/business.ts b/test/integrations/destinations/fb_custom_audience/dataDelivery/business.ts index 6334094b3a9..1b81fc46cb2 100644 --- a/test/integrations/destinations/fb_custom_audience/dataDelivery/business.ts +++ b/test/integrations/destinations/fb_custom_audience/dataDelivery/business.ts @@ -107,8 +107,13 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"audience_id":"aud1","session_id":"123","num_received":4,"num_invalid_entries":0,"invalid_entry_samples":{}}', + error: JSON.stringify({ + audience_id: 'aud1', + session_id: '123', + num_received: 4, + num_invalid_entries: 0, + invalid_entry_samples: {}, + }), statusCode: 200, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts b/test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts index cd440aaa37c..ed057427e61 100644 --- a/test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts +++ b/test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts @@ -648,6 +648,74 @@ export const existingTestData = [ }, }, }, + { + name: 'fb_custom_audience', + description: 'User not accepted TOS for messaging API', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'DELETE', + endpoint: getEndPoint('aud1'), + headers: { + 'test-dest-response-key': 'messagingTOSNotAccepted', + }, + params: { + access_token: 'ABC', + payload: { + is_raw: true, + data_source: { + sub_type: 'ANYTHING', + }, + schema: ['DOBY', 'PHONE', 'GEN', 'FI', 'MADID', 'ZIP', 'ST', 'COUNTRY'], + data: [['2013', '@09432457768', 'f', 'Ms.', 'ABC', 'ZIP ', '123abc ', 'IN']], + }, + }, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + }, + }, + output: { + response: { + status: 400, + body: { + output: { + destinationResponse: { + error: { + code: 2655, + fbtrace_id: 'fbtrace_id', + message: '(#2655) Marketing Messaging TOS not accepted', + type: 'OAuthException', + }, + status: 400, + }, + message: 'Marketing Messaging TOS not accepted.', + statTags: { + destType: 'FB_CUSTOM_AUDIENCE', + destinationId: 'Non-determininable', + errorCategory: 'network', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + workspaceId: 'Non-determininable', + }, + status: 400, + }, + }, + }, + }, + }, ]; export const data = [...existingTestData, ...testScenariosForV1API, ...otherScenariosV1]; diff --git a/test/integrations/destinations/fb_custom_audience/network.ts b/test/integrations/destinations/fb_custom_audience/network.ts index ba14d537ad6..f7546cc95a7 100644 --- a/test/integrations/destinations/fb_custom_audience/network.ts +++ b/test/integrations/destinations/fb_custom_audience/network.ts @@ -626,4 +626,45 @@ export const networkCallsData = [ status: 400, }, }, + { + httpReq: { + version: '1', + type: 'REST', + method: 'DELETE', + endpoint: getEndPoint('aud-new'), + headers: { + 'test-dest-response-key': 'messagingTOSNotAccepted', + }, + params: { + access_token: 'XYZ', + payload: { + is_raw: true, + data_source: { + sub_type: 'ANYTHING', + }, + schema: ['DOBY', 'PHONE', 'GEN', 'FI', 'MADID', 'ZIP', 'ST', 'COUNTRY'], + data: [['2013', '@09432457768', 'f', 'Ms.', 'ABC', 'ZIP ', '123abc ', 'IN']], + }, + }, + userId: '', + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + httpRes: { + data: { + error: { + message: '(#2655) Marketing Messaging TOS not accepted', + type: 'OAuthException', + code: 2655, + fbtrace_id: 'fbtrace_id', + }, + }, + status: 400, + }, + }, ]; diff --git a/test/integrations/destinations/fb_custom_audience/processor/data.ts b/test/integrations/destinations/fb_custom_audience/processor/data.ts index 44d4ecaa71e..b5592394319 100644 --- a/test/integrations/destinations/fb_custom_audience/processor/data.ts +++ b/test/integrations/destinations/fb_custom_audience/processor/data.ts @@ -2327,7 +2327,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/aud1/users', + endpoint: 'https://graph.facebook.com/v22.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -2395,7 +2395,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/aud1/users', + endpoint: 'https://graph.facebook.com/v22.0/aud1/users', headers: {}, params: { access_token: 'ABC', diff --git a/test/integrations/destinations/fb_custom_audience/router/data.ts b/test/integrations/destinations/fb_custom_audience/router/data.ts index 834b6315f6a..d4cf4f5b89b 100644 --- a/test/integrations/destinations/fb_custom_audience/router/data.ts +++ b/test/integrations/destinations/fb_custom_audience/router/data.ts @@ -10,7 +10,7 @@ import { rETLRecordV2RouterInvalidRequest, } from './rETL'; import { mockFns } from '../mocks'; - +import { defaultAccessToken } from '../../../common/secrets'; export const data = [ { name: 'fb_custom_audience', @@ -36,7 +36,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v20.0/aud1/users', + endpoint: 'https://graph.facebook.com/v22.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -87,7 +87,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/aud1/users', + endpoint: 'https://graph.facebook.com/v22.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -142,7 +142,7 @@ export const data = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -159,7 +159,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v20.0/aud1/users', + endpoint: 'https://graph.facebook.com/v22.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -210,7 +210,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/aud1/users', + endpoint: 'https://graph.facebook.com/v22.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -265,7 +265,7 @@ export const data = [ dontBatch: false, jobId: 2, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -305,7 +305,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -339,7 +339,7 @@ export const data = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -351,7 +351,7 @@ export const data = [ dontBatch: false, jobId: 2, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -368,7 +368,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -398,7 +398,7 @@ export const data = [ dontBatch: false, jobId: 3, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -415,7 +415,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -453,7 +453,7 @@ export const data = [ dontBatch: false, jobId: 4, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -465,7 +465,7 @@ export const data = [ dontBatch: false, jobId: 5, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -477,7 +477,7 @@ export const data = [ dontBatch: false, jobId: 6, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -496,7 +496,7 @@ export const data = [ dontBatch: false, jobId: 7, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -546,7 +546,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -583,7 +583,7 @@ export const data = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -595,7 +595,7 @@ export const data = [ dontBatch: false, jobId: 2, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -637,7 +637,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -670,7 +670,7 @@ export const data = [ dontBatch: false, jobId: 3, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -712,7 +712,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -753,7 +753,7 @@ export const data = [ dontBatch: false, jobId: 4, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -765,7 +765,7 @@ export const data = [ dontBatch: false, jobId: 5, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -777,7 +777,7 @@ export const data = [ dontBatch: false, jobId: 6, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -821,7 +821,7 @@ export const data = [ dontBatch: false, jobId: 7, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -849,9 +849,10 @@ export const data = [ }, { name: 'fb_custom_audience', - description: 'rETL record V2 tests', + description: 'rETL record V2 tests with null values', scenario: 'Framework', - successCriteria: 'all record events should be transformed correctly based on their operation', + successCriteria: + 'all record events should be transformed correctly including records with null values', feature: 'router', module: 'destination', version: 'v0', @@ -871,7 +872,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -890,6 +891,7 @@ export const data = [ 'b100c2ec0718fe6b4805b623aeec6710719d042ceea55f5c8135b010ec1c7b36', '1e14a2f476f7611a8b22bc85d14237fdc88aac828737e739416c32c5bce3bd16', ], + ['', ''], ], }, }, @@ -909,7 +911,7 @@ export const data = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -921,7 +923,7 @@ export const data = [ dontBatch: false, jobId: 2, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -933,7 +935,19 @@ export const data = [ dontBatch: false, jobId: 3, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, + }, + sourceId: 'default-sourceId', + userId: 'default-userId', + workspaceId: 'default-workspaceId', + }, + { + attemptNum: 1, + destinationId: 'default-destinationId', + dontBatch: false, + jobId: 4, + secret: { + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -1000,7 +1014,7 @@ export const data = [ destinationId: 'default-destinationId', workspaceId: 'default-workspaceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, diff --git a/test/integrations/destinations/fb_custom_audience/router/rETL.ts b/test/integrations/destinations/fb_custom_audience/router/rETL.ts index f8d5fc89a03..5182b5380df 100644 --- a/test/integrations/destinations/fb_custom_audience/router/rETL.ts +++ b/test/integrations/destinations/fb_custom_audience/router/rETL.ts @@ -116,8 +116,8 @@ export const rETLRecordV2RouterRequest: RouterTransformationRequest = { version: '895/merge', }, }, - recordId: '2', - rudderId: '2', + recordId: '3', + rudderId: '3', identifiers: { EMAIL: 'subscribed@eewrfrd.com', FI: 'ghui', @@ -126,6 +126,29 @@ export const rETLRecordV2RouterRequest: RouterTransformationRequest = { }, metadata: generateMetadata(3), }, + { + destination: destinationV2, + connection: connection, + message: { + action: 'insert', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '4', + rudderId: '4', + identifiers: { + EMAIL: null, + FI: null, + }, + type: 'record', + }, + metadata: generateMetadata(4), + }, ], destType: 'fb_custom_audience', }; diff --git a/test/integrations/destinations/freshmarketer/maskedSecrets.ts b/test/integrations/destinations/freshmarketer/maskedSecrets.ts new file mode 100644 index 00000000000..30889820e0e --- /dev/null +++ b/test/integrations/destinations/freshmarketer/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Token token=${secret1}`; diff --git a/test/integrations/destinations/freshmarketer/processor/data.ts b/test/integrations/destinations/freshmarketer/processor/data.ts index 07112d762f9..825d59fb91d 100644 --- a/test/integrations/destinations/freshmarketer/processor/data.ts +++ b/test/integrations/destinations/freshmarketer/processor/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'freshmarketer', @@ -11,7 +13,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -97,7 +99,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -122,7 +124,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -208,7 +210,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -233,7 +235,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -318,7 +320,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -402,7 +404,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -509,7 +511,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', @@ -533,7 +535,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -621,7 +623,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -708,7 +710,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -796,7 +798,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -884,7 +886,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -951,7 +953,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1054,7 +1056,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1158,7 +1160,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1270,7 +1272,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1309,7 +1311,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -1400,7 +1402,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1419,7 +1421,7 @@ export const data = [ method: 'POST', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1523,7 +1525,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1630,7 +1632,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1741,7 +1743,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1852,7 +1854,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1963,7 +1965,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2001,7 +2003,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -2095,7 +2097,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2133,7 +2135,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -2177,7 +2179,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2227,7 +2229,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2283,7 +2285,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2369,7 +2371,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2397,7 +2399,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -2436,7 +2438,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2494,7 +2496,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2580,7 +2582,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2608,7 +2610,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -2705,7 +2707,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2812,7 +2814,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2845,7 +2847,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', @@ -2936,7 +2938,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -3050,7 +3052,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', rudderEventsToFreshmarketerEvents: [ { @@ -3104,7 +3106,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -3132,7 +3134,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', diff --git a/test/integrations/destinations/freshmarketer/router/data.ts b/test/integrations/destinations/freshmarketer/router/data.ts index 03690b6e276..4d88409265c 100644 --- a/test/integrations/destinations/freshmarketer/router/data.ts +++ b/test/integrations/destinations/freshmarketer/router/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'freshmarketer', @@ -12,7 +14,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -58,7 +60,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -103,7 +105,7 @@ export const data = [ }, { destination: { - Config: { apiKey: 'dummyApiKey', domain: 'domain-rudder.myfreshworks.com' }, + Config: { apiKey: secret1, domain: 'domain-rudder.myfreshworks.com' }, }, metadata: { jobId: 3, userId: 'u1' }, message: { @@ -165,7 +167,7 @@ export const data = [ endpoint: 'https://rudderstack-476952domain3105.myfreshworks.com/crm/sales/api/contacts/upsert', headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -195,7 +197,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -208,7 +210,7 @@ export const data = [ endpoint: 'https://rudderstack-476952domain3105.myfreshworks.com/crm/sales/api/contacts/upsert', headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -238,7 +240,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -284,7 +286,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', @@ -293,7 +295,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'dummyApiKey', domain: 'domain-rudder.myfreshworks.com' }, + Config: { apiKey: secret1, domain: 'domain-rudder.myfreshworks.com' }, }, }, ], diff --git a/test/integrations/destinations/freshsales/maskedSecrets.ts b/test/integrations/destinations/freshsales/maskedSecrets.ts new file mode 100644 index 00000000000..30889820e0e --- /dev/null +++ b/test/integrations/destinations/freshsales/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Token token=${secret1}`; diff --git a/test/integrations/destinations/freshsales/processor/data.ts b/test/integrations/destinations/freshsales/processor/data.ts index 7c0eca0926c..f7fc525cddc 100644 --- a/test/integrations/destinations/freshsales/processor/data.ts +++ b/test/integrations/destinations/freshsales/processor/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'freshsales', @@ -76,7 +78,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -116,7 +118,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -202,7 +204,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -227,7 +229,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -313,7 +315,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -338,7 +340,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -403,7 +405,7 @@ export const data = [ endpoint: 'https://rudderstack-476952domain3105.myfreshworks.com/crm/sales/api/contacts/upsert', headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -448,7 +450,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -532,7 +534,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -639,7 +641,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', @@ -663,7 +665,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -751,7 +753,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -838,7 +840,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -926,7 +928,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -993,7 +995,7 @@ export const data = [ endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_accounts/upsert', headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1081,7 +1083,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1184,7 +1186,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1288,7 +1290,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1400,7 +1402,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', rudderEventsToFreshsalesEvents: [ { @@ -1446,7 +1448,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -1536,7 +1538,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1555,7 +1557,7 @@ export const data = [ method: 'POST', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1659,7 +1661,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1766,7 +1768,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1877,7 +1879,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1988,7 +1990,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2099,7 +2101,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2137,7 +2139,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -2231,7 +2233,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2269,7 +2271,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -2313,7 +2315,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2425,7 +2427,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2532,7 +2534,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2565,7 +2567,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', @@ -2656,7 +2658,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, diff --git a/test/integrations/destinations/freshsales/router/data.ts b/test/integrations/destinations/freshsales/router/data.ts index 8548d337b31..7e8f05cc8dd 100644 --- a/test/integrations/destinations/freshsales/router/data.ts +++ b/test/integrations/destinations/freshsales/router/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'freshsales', @@ -68,7 +70,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'hrkjfergeferf', + apiKey: secret1, domain: 'rudderstack-479541159204968909.myfreshworks.com', }, Enabled: true, @@ -97,7 +99,7 @@ export const data = [ endpoint: 'https://rudderstack-479541159204968909.myfreshworks.com/crm/sales/api/contacts/upsert', headers: { - Authorization: 'Token token=hrkjfergeferf', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -158,7 +160,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'hrkjfergeferf', + apiKey: secret1, domain: 'rudderstack-479541159204968909.myfreshworks.com', }, Enabled: true, diff --git a/test/integrations/destinations/fullstory/maskedSecrets.ts b/test/integrations/destinations/fullstory/maskedSecrets.ts new file mode 100644 index 00000000000..aaf5a0cbb37 --- /dev/null +++ b/test/integrations/destinations/fullstory/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${secret1}`; +export const authHeader2 = `Basic ${secret2}`; diff --git a/test/integrations/destinations/fullstory/processor/data.ts b/test/integrations/destinations/fullstory/processor/data.ts index 9c8d29c7e80..6f9e6a425e9 100644 --- a/test/integrations/destinations/fullstory/processor/data.ts +++ b/test/integrations/destinations/fullstory/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader2, secret2 } from '../maskedSecrets'; export const data = [ { name: 'fullstory', @@ -85,7 +86,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyfullstoryAPIKey', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -161,7 +162,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.fullstory.com/v2/events', headers: { - authorization: 'Basic dummyfullstoryAPIKey', + authorization: authHeader1, 'content-type': 'application/json', }, params: {}, @@ -222,7 +223,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyfullstoryAPIKey', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -309,7 +310,7 @@ export const data = [ }, }, Config: { - apiKey: 'fullstoryAPIKey', + apiKey: secret2, }, Enabled: true, Transformations: [], @@ -354,7 +355,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.fullstory.com/v2/users', headers: { - authorization: 'Basic fullstoryAPIKey', + authorization: authHeader2, 'content-type': 'application/json', }, params: {}, @@ -403,7 +404,7 @@ export const data = [ }, }, Config: { - apiKey: 'fullstoryAPIKey', + apiKey: secret2, }, Enabled: true, Transformations: [], @@ -442,7 +443,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.fullstory.com/v2/users', headers: { - authorization: 'Basic fullstoryAPIKey', + authorization: authHeader2, 'content-type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/ga/deleteUsers/data.ts b/test/integrations/destinations/ga/deleteUsers/data.ts index 6cbc5d5cfe4..7ef001382c4 100644 --- a/test/integrations/destinations/ga/deleteUsers/data.ts +++ b/test/integrations/destinations/ga/deleteUsers/data.ts @@ -1,4 +1,5 @@ import { AUTH_STATUS_INACTIVE } from '../../../../../src/adapters/networkhandler/authConstants'; +import { secret1, secret2, secret3 } from '../maskedSecrets'; export const data = [ { @@ -10,7 +11,7 @@ export const data = [ input: { request: { headers: { - 'x-rudder-dest-info': '{"secret": { "access_token": "valid_token" }}', + 'x-rudder-dest-info': JSON.stringify({ secret: { access_token: secret1 } }), }, body: [ { @@ -52,7 +53,7 @@ export const data = [ input: { request: { headers: { - 'x-rudder-dest-info': '{"secret": { "access_token": "expired_token" }}', + 'x-rudder-dest-info': JSON.stringify({ secret: { access_token: secret2 } }), }, body: [ { @@ -95,7 +96,7 @@ export const data = [ input: { request: { headers: { - 'x-rudder-dest-info': '{"secret": { "access_token": "valid_token_1" }}', + 'x-rudder-dest-info': JSON.stringify({ secret: { access_token: secret1 } }), }, body: [ { @@ -147,7 +148,7 @@ export const data = [ input: { request: { headers: { - 'x-rudder-dest-info': '{"secret": { "access_token": "no_permissions_token" }}', + 'x-rudder-dest-info': JSON.stringify({ secret: { access_token: secret3 } }), }, body: [ { diff --git a/test/integrations/destinations/ga/maskedSecrets.ts b/test/integrations/destinations/ga/maskedSecrets.ts new file mode 100644 index 00000000000..3ab9722af98 --- /dev/null +++ b/test/integrations/destinations/ga/maskedSecrets.ts @@ -0,0 +1,8 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; +export const authHeader3 = `Bearer ${secret3}`; diff --git a/test/integrations/destinations/ga/network.ts b/test/integrations/destinations/ga/network.ts index acfe5db4305..7d9f0c326de 100644 --- a/test/integrations/destinations/ga/network.ts +++ b/test/integrations/destinations/ga/network.ts @@ -1,3 +1,5 @@ +import { authHeader1, authHeader2, authHeader3 } from './maskedSecrets'; + const deleteNwData = [ { httpReq: { @@ -12,7 +14,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-5', }, headers: { - Authorization: 'Bearer valid_token', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -44,7 +46,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-5', }, headers: { - Authorization: 'Bearer valid_token', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -76,7 +78,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-6', }, headers: { - Authorization: 'Bearer expired_token', + Authorization: authHeader2, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -107,7 +109,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-6', }, headers: { - Authorization: 'Bearer expired_token', + Authorization: authHeader2, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -138,7 +140,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-7', }, headers: { - Authorization: 'Bearer valid_token_1', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -170,7 +172,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-7', }, headers: { - Authorization: 'Bearer valid_token_1', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -202,7 +204,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-7', }, headers: { - Authorization: 'Bearer valid_token_1', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -238,7 +240,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-7', }, headers: { - Authorization: 'Bearer valid_token_1', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -270,7 +272,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-7', }, headers: { - Authorization: 'Bearer valid_token_1', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -302,7 +304,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-7', }, headers: { - Authorization: 'Bearer no_permissions_token', + Authorization: authHeader3, Accept: 'application/json', 'Content-Type': 'application/json', }, diff --git a/test/integrations/destinations/ga4/dataDelivery/business.ts b/test/integrations/destinations/ga4/dataDelivery/business.ts index 80271abbdbb..2f1f76c60c0 100644 --- a/test/integrations/destinations/ga4/dataDelivery/business.ts +++ b/test/integrations/destinations/ga4/dataDelivery/business.ts @@ -248,7 +248,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: '[GA4 Response Handler] - Request Processed Successfully', response: [ { - error: '{"validationMessages":[]}', + error: JSON.stringify({ validationMessages: [] }), metadata: generateMetadata(1), statusCode: 200, }, diff --git a/test/integrations/destinations/ga4/processor/ecomTestData.ts b/test/integrations/destinations/ga4/processor/ecomTestData.ts index 238e44222b9..3a6f1972700 100644 --- a/test/integrations/destinations/ga4/processor/ecomTestData.ts +++ b/test/integrations/destinations/ga4/processor/ecomTestData.ts @@ -292,6 +292,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -362,6 +363,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -434,6 +436,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -504,6 +507,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -574,6 +578,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -647,6 +652,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -721,6 +727,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -794,6 +801,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -869,6 +877,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -943,6 +952,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1017,6 +1027,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1093,6 +1104,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1170,6 +1182,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1244,6 +1257,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1315,6 +1329,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1385,6 +1400,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1456,6 +1472,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1525,6 +1542,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1591,6 +1609,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1657,6 +1676,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1723,6 +1743,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1800,6 +1821,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1873,6 +1895,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1943,6 +1966,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2014,6 +2038,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2087,6 +2112,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2164,6 +2190,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2247,6 +2274,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2321,6 +2349,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2410,6 +2439,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/ga4/processor/groupTestData.ts b/test/integrations/destinations/ga4/processor/groupTestData.ts index 68daad3a8ec..9e97ac33cd7 100644 --- a/test/integrations/destinations/ga4/processor/groupTestData.ts +++ b/test/integrations/destinations/ga4/processor/groupTestData.ts @@ -113,6 +113,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -184,6 +185,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -265,6 +267,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/ga4/processor/pageTestData.ts b/test/integrations/destinations/ga4/processor/pageTestData.ts index 672f7e8f634..3f5d357e6e2 100644 --- a/test/integrations/destinations/ga4/processor/pageTestData.ts +++ b/test/integrations/destinations/ga4/processor/pageTestData.ts @@ -122,6 +122,7 @@ export const pageTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -191,6 +192,7 @@ export const pageTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -263,6 +265,7 @@ export const pageTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -448,6 +451,7 @@ export const pageTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/ga4/processor/trackTestData.ts b/test/integrations/destinations/ga4/processor/trackTestData.ts index ce991ff8453..d99cc24bdf0 100644 --- a/test/integrations/destinations/ga4/processor/trackTestData.ts +++ b/test/integrations/destinations/ga4/processor/trackTestData.ts @@ -158,6 +158,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -225,6 +226,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -294,6 +296,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -365,6 +368,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -432,6 +436,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -502,6 +507,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -569,6 +575,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -637,6 +644,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -703,6 +711,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -773,6 +782,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -844,6 +854,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -914,6 +925,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -981,6 +993,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1049,6 +1062,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1115,6 +1129,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1185,6 +1200,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1253,6 +1269,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1318,6 +1335,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1383,6 +1401,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1451,6 +1470,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1523,6 +1543,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1598,6 +1619,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1673,6 +1695,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1749,6 +1772,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1815,6 +1839,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1879,6 +1904,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1944,6 +1970,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2010,6 +2037,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2076,6 +2104,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2142,6 +2171,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2215,6 +2245,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2292,6 +2323,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2379,6 +2411,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2458,6 +2491,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2542,6 +2576,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2667,6 +2702,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2752,6 +2788,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2829,6 +2866,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2909,6 +2947,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/ga4/processor/validationTestData.ts b/test/integrations/destinations/ga4/processor/validationTestData.ts index 0030ee178ec..28c71c8e864 100644 --- a/test/integrations/destinations/ga4/processor/validationTestData.ts +++ b/test/integrations/destinations/ga4/processor/validationTestData.ts @@ -1,5 +1,5 @@ import { defaultMockFns } from '../mocks'; -import { Destination } from '../../../../../src/types'; +import { Destination, RudderMessage } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata, generateSimplifiedTrackPayload } from '../../../testUtils'; @@ -136,6 +136,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -194,6 +195,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -250,6 +252,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -301,6 +304,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -352,6 +356,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -402,6 +407,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -452,6 +458,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -497,6 +504,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -542,6 +550,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -594,6 +603,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -647,6 +657,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -700,6 +711,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -746,6 +758,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -796,6 +809,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -834,9 +848,8 @@ export const validationTestData: ProcessorTestData[] = [ destination, message: { type: 'track', - event: { - name: 'promotion_viewed', - }, + // intentional to test event name as number + event: 122 as unknown as string, properties: { products: commonProductInfo, }, @@ -851,6 +864,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -898,6 +912,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -942,6 +957,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/gainsight_px/processor/data.ts b/test/integrations/destinations/gainsight_px/processor/data.ts index 3dfe86aa985..0b2c2bf9b9b 100644 --- a/test/integrations/destinations/gainsight_px/processor/data.ts +++ b/test/integrations/destinations/gainsight_px/processor/data.ts @@ -1068,7 +1068,7 @@ export const data = [ JSON: { attributes: { description: 'Stringify test for object values', - nested: '{"a":[1,2,3],"b":{"c":1}}', + nested: JSON.stringify({ a: [1, 2, 3], b: { c: 1 } }), arr: '[1,2,3]', }, propertyKey: 'AP-XABC-123', @@ -1205,7 +1205,7 @@ export const data = [ JSON: { attributes: { description: 'Stringify test for object values', - nested: '{"a":[1,2,3],"b":{"c":1}}', + nested: JSON.stringify({ a: [1, 2, 3], b: { c: 1 } }), arr: '[1,2,3]', }, propertyKey: 'AP-XABC-123', diff --git a/test/integrations/destinations/gainsight_px/router/data.ts b/test/integrations/destinations/gainsight_px/router/data.ts index 3a5255f7d2c..8ccbc868621 100644 --- a/test/integrations/destinations/gainsight_px/router/data.ts +++ b/test/integrations/destinations/gainsight_px/router/data.ts @@ -448,10 +448,13 @@ export const data = [ date: 1624704082335, attributes: { array: '[1,2,3]', - nested: '{"json":"test"}', + nested: JSON.stringify({ json: 'test' }), status: 'testing', description: 'Example track call', - fullyNested: '[{"a":1,"b":2},{"a":1,"b":[1,2,3]}]', + fullyNested: JSON.stringify([ + { a: 1, b: 2 }, + { a: 1, b: [1, 2, 3] }, + ]), }, url: 'file:///Users/anurajguha/workspace/simple-html-test/index.html', referrer: '$direct', @@ -595,8 +598,12 @@ export const data = [ body: { output: [ { - error: - '{"message":"error while fetching user: \\"403403 Forbidden\\"","destinationResponse":"403403 Forbidden"}', + error: JSON.stringify({ + message: + 'error while fetching user: "403403 Forbidden"', + destinationResponse: + '403403 Forbidden', + }), statTags: { destType: 'GAINSIGHT_PX', destinationId: destination2.ID, diff --git a/test/integrations/destinations/gladly/maskedSecrets.ts b/test/integrations/destinations/gladly/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/gladly/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/gladly/network.ts b/test/integrations/destinations/gladly/network.ts index 8c1c2287387..8507ae1ccc9 100644 --- a/test/integrations/destinations/gladly/network.ts +++ b/test/integrations/destinations/gladly/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; const deleteNwData = [ { httpReq: { @@ -5,7 +6,7 @@ const deleteNwData = [ url: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles?email=test%40rudderlabs.com', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, }, }, httpRes: { @@ -19,7 +20,7 @@ const deleteNwData = [ url: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles?email=test%2B2%40rudderlabs.com', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, }, }, httpRes: { @@ -46,7 +47,7 @@ const deleteNwData = [ url: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles?phoneNumber=%2B91%209999999988', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, }, }, httpRes: { @@ -85,7 +86,7 @@ const deleteNwData = [ url: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles?email=test6%40rudderlabs.com', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, }, }, httpRes: { @@ -99,7 +100,7 @@ const deleteNwData = [ url: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles?email=abc', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, }, }, httpRes: { diff --git a/test/integrations/destinations/gladly/processor/data.ts b/test/integrations/destinations/gladly/processor/data.ts index e81af999fbc..f04e1706538 100644 --- a/test/integrations/destinations/gladly/processor/data.ts +++ b/test/integrations/destinations/gladly/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'gladly', @@ -29,8 +30,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -98,8 +99,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -166,7 +167,7 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -242,8 +243,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -276,7 +277,7 @@ export const data = [ }, endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles', headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, userId: '', @@ -333,8 +334,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -366,7 +367,7 @@ export const data = [ }, endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles/user@2', headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, userId: '', @@ -421,8 +422,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -452,7 +453,7 @@ export const data = [ }, endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles/user@3', headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, userId: '', @@ -500,8 +501,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -581,8 +582,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -619,7 +620,7 @@ export const data = [ }, endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles', headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, userId: '', @@ -673,8 +674,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -704,7 +705,7 @@ export const data = [ }, endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles', headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, userId: '', @@ -758,8 +759,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -789,7 +790,7 @@ export const data = [ }, endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles', headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, userId: '', diff --git a/test/integrations/destinations/gladly/router/data.ts b/test/integrations/destinations/gladly/router/data.ts index 462edd9772b..5af08edb707 100644 --- a/test/integrations/destinations/gladly/router/data.ts +++ b/test/integrations/destinations/gladly/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'gladly', @@ -31,8 +32,8 @@ export const data = [ destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -60,8 +61,8 @@ export const data = [ destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -87,8 +88,8 @@ export const data = [ destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -124,7 +125,7 @@ export const data = [ endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles', files: {}, headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -134,9 +135,9 @@ export const data = [ }, destination: { Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', - userName: 'testUserName', + userName: secret1, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -161,7 +162,7 @@ export const data = [ endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles/user@2', files: {}, headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PATCH', @@ -171,9 +172,9 @@ export const data = [ }, destination: { Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', - userName: 'testUserName', + userName: secret1, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -196,7 +197,7 @@ export const data = [ endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles/user@3', files: {}, headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PATCH', @@ -206,9 +207,9 @@ export const data = [ }, destination: { Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', - userName: 'testUserName', + userName: secret1, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -253,8 +254,8 @@ export const data = [ destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -283,8 +284,8 @@ export const data = [ destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -312,8 +313,8 @@ export const data = [ destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -348,7 +349,7 @@ export const data = [ endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles', files: {}, headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -358,9 +359,9 @@ export const data = [ }, destination: { Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', - userName: 'testUserName', + userName: secret1, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -384,7 +385,7 @@ export const data = [ endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles/user@2', files: {}, headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PATCH', @@ -394,9 +395,9 @@ export const data = [ }, destination: { Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', - userName: 'testUserName', + userName: secret1, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -419,7 +420,7 @@ export const data = [ endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles/user@3', files: {}, headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PATCH', @@ -429,9 +430,9 @@ export const data = [ }, destination: { Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', - userName: 'testUserName', + userName: secret1, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts index d318066e7d4..3a5d3d684b9 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts @@ -1,13 +1,15 @@ +import { authHeader1 } from '../maskedSecrets'; import { generateMetadata, generateProxyV0Payload, generateProxyV1Payload, } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; + +const API_VERSION = 'v18'; const headers = { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -175,8 +177,26 @@ export const testScenariosForV0API = [ message: 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]', }, - message: - '{"code":3,"message":"Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]","details":[{"@type":"type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure","errors":[{"errorCode":{"conversionAdjustmentUploadError":"CONVERSION_ALREADY_ENHANCED"},"message":"Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again.","location":{"fieldPathElements":[{"fieldName":"conversion_adjustments","index":0}]}}]}]}', + message: JSON.stringify({ + code: 3, + message: + 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]', + details: [ + { + '@type': 'type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure', + errors: [ + { + errorCode: { conversionAdjustmentUploadError: 'CONVERSION_ALREADY_ENHANCED' }, + message: + 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again.', + location: { + fieldPathElements: [{ fieldName: 'conversion_adjustments', index: 0 }], + }, + }, + ], + }, + ], + }), statTags: expectedStatTags, status: 400, }, @@ -217,8 +237,22 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '[{"results":[{"adjustmentType":"ENHANCEMENT","conversionAction":"customers/7693729833/conversionActions/874224905","adjustmentDateTime":"2021-01-01 12:32:45-08:00","gclidDateTimePair":{"gclid":"1234","conversionDateTime":"2021-01-01 12:32:45-08:00"},"orderId":"12345"}]}]', + error: JSON.stringify([ + { + results: [ + { + adjustmentType: 'ENHANCEMENT', + conversionAction: 'customers/7693729833/conversionActions/874224905', + adjustmentDateTime: '2021-01-01 12:32:45-08:00', + gclidDateTimePair: { + gclid: '1234', + conversionDateTime: '2021-01-01 12:32:45-08:00', + }, + orderId: '12345', + }, + ], + }, + ]), metadata: generateMetadata(1), statusCode: 200, }, @@ -261,12 +295,51 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ status: 200, body: { output: { - message: - '{"code":3,"message":"Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]","details":[{"@type":"type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure","errors":[{"errorCode":{"conversionAdjustmentUploadError":"CONVERSION_ALREADY_ENHANCED"},"message":"Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again.","location":{"fieldPathElements":[{"fieldName":"conversion_adjustments","index":0}]}}]}]}', + message: JSON.stringify({ + code: 3, + message: + 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]', + details: [ + { + '@type': 'type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure', + errors: [ + { + errorCode: { conversionAdjustmentUploadError: 'CONVERSION_ALREADY_ENHANCED' }, + message: + 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again.', + location: { + fieldPathElements: [{ fieldName: 'conversion_adjustments', index: 0 }], + }, + }, + ], + }, + ], + }), response: [ { - error: - '{"code":3,"message":"Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]","details":[{"@type":"type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure","errors":[{"errorCode":{"conversionAdjustmentUploadError":"CONVERSION_ALREADY_ENHANCED"},"message":"Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again.","location":{"fieldPathElements":[{"fieldName":"conversion_adjustments","index":0}]}}]}]}', + error: JSON.stringify({ + code: 3, + message: + 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]', + details: [ + { + '@type': + 'type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure', + errors: [ + { + errorCode: { + conversionAdjustmentUploadError: 'CONVERSION_ALREADY_ENHANCED', + }, + message: + 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again.', + location: { + fieldPathElements: [{ fieldName: 'conversion_adjustments', index: 0 }], + }, + }, + ], + }, + ], + }), metadata: generateMetadata(1), statusCode: 400, }, diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts index c6e29925dd8..1a8e3a8a096 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts @@ -1,4 +1,6 @@ -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; +import { authHeader1 } from '../maskedSecrets'; +const API_VERSION = 'v18'; + import { generateProxyV1Payload, generateProxyV0Payload, @@ -38,7 +40,7 @@ const requestPayload = { }; const headers = { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/maskedSecrets.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts index 270ec2dc77e..8fb8a9aabbd 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts @@ -1,4 +1,6 @@ -import { API_VERSION } from '../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; +import { authHeader1 } from './maskedSecrets'; +const API_VERSION = 'v18'; + export const networkCallsData = [ { httpReq: { @@ -7,7 +9,7 @@ export const networkCallsData = [ query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'`, }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -36,7 +38,7 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_enhanced_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -95,7 +97,7 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_enhanced_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -130,7 +132,7 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_enhanced_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -191,7 +193,7 @@ export const networkCallsData = [ destination: 'google_adwords_enhanced_conversion', }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -252,7 +254,7 @@ export const networkCallsData = [ destination: 'google_adwords_enhanced_conversion', }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -282,7 +284,7 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_enhanced_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -341,7 +343,7 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_enhanced_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -389,7 +391,7 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_enhanced_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts index 1d20e887e98..5128db634d7 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts @@ -1,4 +1,5 @@ -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; +import { authHeader1, secret1 } from '../maskedSecrets'; +const API_VERSION = 'v18'; export const data = [ { name: 'google_adwords_enhanced_conversions', @@ -12,7 +13,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -131,7 +132,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '1234567890', @@ -189,7 +190,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -212,7 +213,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -326,7 +327,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -359,7 +360,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -465,7 +466,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -498,7 +499,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -618,7 +619,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '11', @@ -672,7 +673,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -695,7 +696,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -808,7 +809,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -840,7 +841,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -902,7 +903,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1072,7 +1073,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1187,7 +1188,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1220,7 +1221,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1329,7 +1330,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '1234567890', @@ -1387,7 +1388,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1410,7 +1411,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1519,7 +1520,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '1234567890', @@ -1573,7 +1574,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1596,7 +1597,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1700,7 +1701,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts index 5ac05b5a530..d96f716f21e 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts @@ -1,8 +1,11 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; +const API_VERSION = 'v18'; + const events = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -94,7 +97,7 @@ const events = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -226,7 +229,7 @@ const events = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -320,7 +323,7 @@ const events = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -414,7 +417,7 @@ const events = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -450,7 +453,7 @@ const events = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -542,11 +545,7 @@ const invalidRtTfCases = [ output: [ { error: 'Invalid event array', - metadata: [ - { - destType: undefined, - }, - ], + metadata: [{}], batched: false, statusCode: 400, }, @@ -575,11 +574,7 @@ const invalidRtTfCases = [ output: [ { error: 'Invalid event array', - metadata: [ - { - destType: undefined, - }, - ], + metadata: [{}], batched: false, statusCode: 400, }, @@ -657,11 +652,10 @@ export const data = [ JSON_ARRAY: {}, XML: {}, }, - endpoint: - 'https://googleads.googleapis.com/v17/customers/1234567890:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, files: {}, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '11', @@ -695,7 +689,7 @@ export const data = [ { jobId: 1, secret: { - access_token: 'abcd1234', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -728,7 +722,7 @@ export const data = [ { jobId: 2, secret: { - access_token: 'abcd1234', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -828,11 +822,10 @@ export const data = [ JSON_ARRAY: {}, XML: {}, }, - endpoint: - 'https://googleads.googleapis.com/v17/customers/1234567890:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, files: {}, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '11', @@ -866,7 +859,7 @@ export const data = [ { jobId: 4, secret: { - access_token: 'abcd1234', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -899,7 +892,7 @@ export const data = [ { jobId: 5, secret: { - access_token: 'abcd1234', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -941,7 +934,7 @@ export const data = [ { jobId: 7, secret: { - access_token: 'abcd1234', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -973,7 +966,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, diff --git a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts index 87aafea0afa..7478355ce15 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts @@ -1,9 +1,12 @@ +import { authHeader1, secret3 } from '../maskedSecrets'; import { generateMetadata, generateProxyV0Payload, generateProxyV1Payload, } from '../../../testUtils'; +const API_VERSION = 'v18'; + const transactionAttribute = { CUSTOM_KEY: 'CUSTOM_VALUE', currency_code: 'INR', @@ -42,15 +45,15 @@ const products = [ const headers = { header1: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, header2: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, }; @@ -234,8 +237,7 @@ export const testScenariosForV0API = [ headers: headers.header1, params: params.param1, JSON: invalidArgumentRequestPayload, - endpoint: - 'https://googleads.googleapis.com/v16/customers/11122233331/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/11122233331/offlineUserDataJobs`, }), method: 'POST', }, @@ -309,7 +311,7 @@ export const testScenariosForV0API = [ headers: headers.header1, params: params.param1, JSON: validRequestPayload1, - endpoint: 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, }), method: 'POST', }, @@ -349,8 +351,7 @@ export const testScenariosForV0API = [ headers: headers.header2, params: params.param2, JSON: validRequestPayload2, - endpoint: - 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, }), method: 'POST', }, @@ -399,8 +400,7 @@ export const testScenariosForV0API = [ headers: headers.header2, params: params.param3, JSON: validRequestPayload2, - endpoint: - 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, }), method: 'POST', }, @@ -452,8 +452,7 @@ export const testScenariosForV1API = [ headers: headers.header1, params: params.param1, JSON: invalidArgumentRequestPayload, - endpoint: - 'https://googleads.googleapis.com/v16/customers/11122233331/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/11122233331/offlineUserDataJobs`, }, metadataArray, ), @@ -499,8 +498,7 @@ export const testScenariosForV1API = [ headers: headers.header1, params: params.param1, JSON: validRequestPayload1, - endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, }, metadataArray, ), @@ -516,7 +514,7 @@ export const testScenariosForV1API = [ '[Google Ads Offline Conversions Response Handler] - Request processed successfully', response: [ { - error: '{"name":"customers/111-222-3333/operations/abcd="}', + error: JSON.stringify({ name: 'customers/111-222-3333/operations/abcd=' }), metadata: generateMetadata(1), statusCode: 200, }, @@ -544,8 +542,7 @@ export const testScenariosForV1API = [ headers: headers.header2, params: params.param2, JSON: validRequestPayload2, - endpoint: - 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, }, metadataArray, ), @@ -561,8 +558,18 @@ export const testScenariosForV1API = [ '[Google Ads Offline Conversions Response Handler] - Request processed successfully', response: [ { - error: - '[{"adjustmentType":"ENHANCEMENT","conversionAction":"customers/1234567891/conversionActions/874224905","adjustmentDateTime":"2021-01-01 12:32:45-08:00","gclidDateTimePair":{"gclid":"1234","conversionDateTime":"2021-01-01 12:32:45-08:00"},"orderId":"12345"}]', + error: JSON.stringify([ + { + adjustmentType: 'ENHANCEMENT', + conversionAction: 'customers/1234567891/conversionActions/874224905', + adjustmentDateTime: '2021-01-01 12:32:45-08:00', + gclidDateTimePair: { + gclid: '1234', + conversionDateTime: '2021-01-01 12:32:45-08:00', + }, + orderId: '12345', + }, + ]), metadata: generateMetadata(1), statusCode: 200, }, @@ -590,8 +597,7 @@ export const testScenariosForV1API = [ headers: headers.header2, params: params.param3, JSON: validRequestPayload2, - endpoint: - 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, }, metadataArray, ), @@ -607,8 +613,18 @@ export const testScenariosForV1API = [ '[Google Ads Offline Conversions Response Handler] - Request processed successfully', response: [ { - error: - '[{"adjustmentType":"ENHANCEMENT","conversionAction":"customers/1234567891/conversionActions/874224905","adjustmentDateTime":"2021-01-01 12:32:45-08:00","gclidDateTimePair":{"gclid":"1234","conversionDateTime":"2021-01-01 12:32:45-08:00"},"orderId":"12345"}]', + error: JSON.stringify([ + { + adjustmentType: 'ENHANCEMENT', + conversionAction: 'customers/1234567891/conversionActions/874224905', + adjustmentDateTime: '2021-01-01 12:32:45-08:00', + gclidDateTimePair: { + gclid: '1234', + conversionDateTime: '2021-01-01 12:32:45-08:00', + }, + orderId: '12345', + }, + ]), metadata: generateMetadata(1), statusCode: 200, }, @@ -636,8 +652,7 @@ export const testScenariosForV1API = [ headers: headers.header2, params: params.param4, JSON: notAllowedToAccessFeatureRequestPayload, - endpoint: - 'https://googleads.googleapis.com/v16/customers/1234567893:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567893:uploadClickConversions`, }, metadataArray, ), diff --git a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts index 4437ebb912c..f71d5c143f6 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts @@ -1,13 +1,17 @@ +import { authHeader1, authHeader2, secret3 } from '../maskedSecrets'; import { generateMetadata, generateProxyV1Payload, generateProxyV0Payload, } from '../../../testUtils'; +import { defaultAccessToken } from '../../../common/secrets'; + +const API_VERSION = 'v18'; const commonHeaders = { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }; @@ -95,7 +99,7 @@ export const v0oauthScenarios = [ request: { body: generateProxyV0Payload({ ...commonRequestParameters, - endpoint: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, }), method: 'POST', }, @@ -138,7 +142,7 @@ export const v0oauthScenarios = [ request: { body: generateProxyV0Payload({ ...commonRequestParameters, - endpoint: 'https://googleads.googleapis.com/v16/customers/1234/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234/offlineUserDataJobs`, }), method: 'POST', }, @@ -183,8 +187,7 @@ export const v1oauthScenarios = [ body: generateProxyV1Payload( { ...commonRequestParameters, - endpoint: - 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, }, metadataArray, ), @@ -230,7 +233,7 @@ export const v1oauthScenarios = [ body: generateProxyV1Payload( { ...commonRequestParameters, - endpoint: 'https://googleads.googleapis.com/v16/customers/1234/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234/offlineUserDataJobs`, }, metadataArray, ), @@ -276,13 +279,12 @@ export const v1oauthScenarios = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer invalidabcd1234', + Authorization: authHeader2, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, - endpoint: - 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, }, metadataArray, ), @@ -307,7 +309,7 @@ export const v1oauthScenarios = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -348,13 +350,12 @@ export const v1oauthScenarios = [ { ...{ ...commonRequestParameters, JSON: { isStoreConversion: false } }, headers: { - Authorization: 'Bearer invalidabcd1234', + Authorization: authHeader2, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, - endpoint: - 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, }, metadataArray, ), @@ -379,7 +380,7 @@ export const v1oauthScenarios = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', diff --git a/test/integrations/destinations/google_adwords_offline_conversions/maskedSecrets.ts b/test/integrations/destinations/google_adwords_offline_conversions/maskedSecrets.ts new file mode 100644 index 00000000000..6b725d44020 --- /dev/null +++ b/test/integrations/destinations/google_adwords_offline_conversions/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/google_adwords_offline_conversions/network.ts b/test/integrations/destinations/google_adwords_offline_conversions/network.ts index 0ab6bef1db7..ad449076eca 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/network.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/network.ts @@ -1,3 +1,6 @@ +import { authHeader1, authHeader2, secret3 } from './maskedSecrets'; +const API_VERSION = 'v18'; + const commonResponse = { status: 401, data: [ @@ -30,7 +33,7 @@ const commonResponse = { export const networkCallsData = [ { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/11122233331/offlineUserDataJobs:create', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/11122233331/offlineUserDataJobs:create`, data: { job: { storeSalesMetadata: { @@ -42,9 +45,9 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -59,15 +62,15 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1112223333/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/googleAds:searchStream`, data: { query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'`, }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -92,7 +95,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/11122233331/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID_FOR_ADD_FAILURE:addOperations', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/11122233331/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID_FOR_ADD_FAILURE:addOperations`, data: { enable_partial_failure: false, enable_warnings: false, @@ -121,9 +124,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -173,7 +176,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs:create', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs:create`, data: { job: { storeSalesMetadata: { @@ -186,9 +189,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -202,7 +205,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:addOperations', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:addOperations`, data: { enable_partial_failure: false, enable_warnings: false, @@ -231,9 +234,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -245,13 +248,13 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:run', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:run`, data: { validate_only: false }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -267,7 +270,7 @@ export const networkCallsData = [ description: 'Mock response from destination depicting a request with invalid authentication credentials', httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs:create', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs:create`, data: { job: { storeSalesMetadata: { @@ -280,9 +283,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -303,7 +306,7 @@ export const networkCallsData = [ description: 'Mock response from destination depicting a request with invalid authentication scopes', httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234/offlineUserDataJobs:create', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234/offlineUserDataJobs:create`, data: { job: { storeSalesMetadata: { @@ -316,9 +319,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -336,14 +339,14 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567890/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890/googleAds:searchStream`, data: { query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'`, }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -364,15 +367,15 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567891/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891/googleAds:searchStream`, data: { query: "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -397,12 +400,12 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567891/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891/googleAds:searchStream`, data: { query: 'SELECT conversion_custom_variable.name FROM conversion_custom_variable' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -431,7 +434,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, data: { conversions: [ { @@ -473,9 +476,9 @@ export const networkCallsData = [ partialFailure: true, }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -498,7 +501,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, data: { conversions: [ { @@ -534,9 +537,9 @@ export const networkCallsData = [ partialFailure: true, }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -559,15 +562,15 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567893/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567893/googleAds:searchStream`, data: { query: "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -592,7 +595,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567893:uploadClickConversions', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567893:uploadClickConversions`, data: { conversions: [ { @@ -628,9 +631,9 @@ export const networkCallsData = [ partialFailure: true, }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -678,7 +681,7 @@ export const networkCallsData = [ description: 'Mock response from destination depicting a request from user who has not enabled 2 factor authentication', httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs:create', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs:create`, data: { job: { storeSalesMetadata: { @@ -691,9 +694,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer invalidabcd1234', + Authorization: authHeader2, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -704,15 +707,15 @@ export const networkCallsData = [ description: 'Mock response from destination depicting a request from user who has not enabled 2 factor authentication', httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1112223333/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/googleAds:searchStream`, data: { query: "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", }, headers: { - Authorization: 'Bearer invalidabcd1234', + Authorization: authHeader2, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', diff --git a/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts b/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts index 3ecae2b92dd..492cc692fd7 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts @@ -1,4 +1,8 @@ +import { authHeader1, secret1, secret3 } from '../maskedSecrets'; import { timestampMock } from '../mocks'; + +const API_VERSION = 'v18'; + export const data = [ { name: 'google_adwords_offline_conversions', @@ -99,9 +103,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -175,12 +179,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Sign-up - click', @@ -278,9 +281,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -390,9 +393,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -466,12 +469,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Sign-up - click', @@ -569,9 +571,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -681,9 +683,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -757,12 +759,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Sign-up - click', @@ -860,9 +861,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -972,9 +973,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -1048,12 +1049,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadCallConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'search', @@ -1126,9 +1126,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -1402,9 +1402,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -1476,9 +1476,9 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 400, @@ -1575,9 +1575,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -1649,9 +1649,9 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 400, @@ -1749,9 +1749,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -1823,9 +1823,9 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 400, @@ -1942,9 +1942,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -2022,12 +2022,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Page view', @@ -2116,9 +2115,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -2128,12 +2127,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadCallConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Page view', @@ -2206,9 +2204,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -2274,9 +2272,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -2352,12 +2350,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': '8617859087', }, params: { @@ -2409,9 +2406,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -2476,9 +2473,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -2552,12 +2549,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadCallConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'search', @@ -2602,9 +2598,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -2712,9 +2708,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -2788,12 +2784,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadCallConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'search', @@ -2865,9 +2860,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -2934,9 +2929,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -3011,12 +3006,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Sign-up - click', @@ -3066,9 +3060,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -3135,9 +3129,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -3210,9 +3204,9 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 400, @@ -3288,9 +3282,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -3363,9 +3357,9 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 400, @@ -3442,9 +3436,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -3519,12 +3513,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': '8617859087', }, params: { @@ -3586,9 +3579,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -3654,9 +3647,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -3729,8 +3722,8 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', - developer_token: 'ijkl91011', + access_token: secret1, + developer_token: secret3, refresh_token: 'efgh5678', }, }, @@ -3762,13 +3755,12 @@ export const data = [ JSON_ARRAY: {}, XML: {}, }, - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, files: {}, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': '8617859087', }, method: 'POST', @@ -3859,9 +3851,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -3936,12 +3928,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': '8617859087', }, params: { @@ -3996,9 +3987,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -4051,9 +4042,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -4128,12 +4119,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -4196,9 +4186,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -4251,9 +4241,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -4325,9 +4315,9 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 400, @@ -4388,9 +4378,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -4465,12 +4455,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -4532,9 +4521,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -4587,9 +4576,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -4664,12 +4653,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -4732,9 +4720,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -4789,9 +4777,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -4866,12 +4854,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -4931,9 +4918,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -4988,9 +4975,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -5030,12 +5017,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -5095,9 +5081,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -5148,9 +5134,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -5190,12 +5176,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -5255,9 +5240,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -5306,9 +5291,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -5348,12 +5333,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -5408,9 +5392,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -5422,7 +5406,7 @@ export const data = [ }, { name: 'google_adwords_offline_conversions', - description: 'Test 26 : store conversion consent mapped from UI config', + description: 'Test 27 : store conversion consent mapped through integrations object', feature: 'processor', module: 'destination', version: 'v0', @@ -5452,177 +5436,55 @@ export const data = [ quantity: 123, }, integrations: { - All: true, - }, - name: 'ApplicationLoaded', - sentAt: '2019-10-14T11:15:53.296Z', - }, - metadata: { - secret: { - access_token: 'abcd1234', - refresh_token: 'efgh5678', - developer_token: 'ijkl91011', - }, - }, - destination: { - Config: { - isCustomerAllowed: false, - customerId: '111-222-3333', - subAccount: true, - loginCustomerId: 'login-customer-id', - userDataConsent: 'GRANTED', - personalizationConsent: 'DENIED', - eventsToOfflineConversionsTypeMapping: [ - { - from: 'Product Clicked', - to: 'store', - }, - ], - eventsToConversionsNamesMapping: [ - { - from: 'Product Clicked', - to: 'Sign-up - click', - }, - ], - hashUserIdentifier: true, - defaultUserIdentifier: 'phone', - validateOnly: false, - rudderAccountId: '2EOknn1JNH7WK1MfNkgr4t3u4fGYKkRK', - }, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', - headers: { - Authorization: 'Bearer abcd1234', - 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', - 'login-customer-id': 'logincustomerid', - }, - params: { - event: 'Sign-up - click', - customerId: '1112223333', - }, - body: { - JSON: { - event: '1112223333', - isStoreConversion: true, - createJobPayload: { - job: { - type: 'STORE_SALES_UPLOAD_FIRST_PARTY', - storeSalesMetadata: { - loyaltyFraction: '1', - transaction_upload_fraction: '1', + GOOGLE_ADWORDS_OFFLINE_CONVERSIONS: { + consents: { + adUserData: 'GRANTED', + adPersonalization: 'DENIED', + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + secret: { + access_token: secret1, + refresh_token: 'efgh5678', + developer_token: secret3, + }, + }, + destination: { + Config: { + isCustomerAllowed: false, + customerId: '111-222-3333', + subAccount: true, + loginCustomerId: 'login-customer-id', + userDataConsent: 'GRANTED', + personalizationConsent: 'DENIED', + eventsToOfflineConversionsTypeMapping: [ + { + from: 'Product Clicked', + to: 'store', }, - }, - }, - addConversionPayload: { - operations: { - create: { - consent: { - adPersonalization: 'DENIED', - adUserData: 'GRANTED', - }, - transaction_attribute: { - store_attribute: { - store_code: 'store code', - }, - transaction_amount_micros: '100000000', - currency_code: 'INR', - transaction_date_time: '2019-10-14 16:45:18+05:30', - }, - userIdentifiers: [{}], + ], + eventsToConversionsNamesMapping: [ + { + from: 'Product Clicked', + to: 'Sign-up - click', }, - }, - enable_partial_failure: false, - enable_warnings: false, - validate_only: false, - }, - executeJobPayload: { - validate_only: false, + ], + hashUserIdentifier: true, + defaultUserIdentifier: 'phone', + validateOnly: false, + rudderAccountId: '2EOknn1JNH7WK1MfNkgr4t3u4fGYKkRK', }, }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, }, - files: {}, - userId: '', }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', - }, - }, - statusCode: 200, - }, - ], - }, - }, - mockFns: timestampMock, - }, - { - name: 'google_adwords_offline_conversions', - description: - 'Test 27 : store conversion consent mapped from UI config even though integration object is present', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - traits: {}, - }, - event: 'Product Clicked', - type: 'track', - messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', - anonymousId: '00000000000000000000000000', - userId: '12345', - properties: { - item_id: 'item id', - merchant_id: 'merchant id', - currency: 'INR', - revenue: '100', - store_code: 'store code', - gclid: 'gclid', - conversionDateTime: '2019-10-14T11:15:18.299Z', - product_id: '123445', - quantity: 123, - }, - integrations: { - google_adwords_offline_conversion: { - consent: { - adUserdata: 'UNSPECIFIED', - adPersonalization: 'GRANTED', - }, - }, - }, - name: 'ApplicationLoaded', - sentAt: '2019-10-14T11:15:53.296Z', - }, - metadata: { - secret: { - access_token: 'abcd1234', - refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -5631,8 +5493,6 @@ export const data = [ customerId: '111-222-3333', subAccount: true, loginCustomerId: 'login-customer-id', - userDataConsent: 'GRANTED', - personalizationConsent: 'DENIED', eventsToOfflineConversionsTypeMapping: [ { from: 'Product Clicked', @@ -5664,12 +5524,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -5724,9 +5583,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -5834,9 +5693,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -5909,8 +5768,116 @@ export const data = [ error: "You can't use both wbraid and gbraid.", metadata: { secret: { - access_token: 'abcd1234', - developer_token: 'ijkl91011', + access_token: secret1, + developer_token: secret3, + refresh_token: 'efgh5678', + }, + }, + statTags: { + destType: 'GOOGLE_ADWORDS_OFFLINE_CONVERSIONS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + mockFns: timestampMock, + }, + { + name: 'google_adwords_offline_conversions', + description: 'Test 29 : store conversion which has value less than 0, should throw error', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + traits: {}, + }, + event: 'Product Clicked', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + item_id: 'item id', + merchant_id: 'merchant id', + currency: 'INR', + revenue: '0', + store_code: 'store code', + gclid: 'gclid', + conversionDateTime: '2019-10-14T11:15:18.299Z', + product_id: '123445', + quantity: 123, + }, + integrations: { + google_adwords_offline_conversion: { + consent: { + adUserdata: 'UNSPECIFIED', + adPersonalization: 'GRANTED', + }, + }, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + secret: { + access_token: secret1, + refresh_token: 'efgh5678', + developer_token: secret3, + }, + }, + destination: { + Config: { + isCustomerAllowed: false, + customerId: '111-222-3333', + subAccount: true, + loginCustomerId: 'login-customer-id', + userDataConsent: 'GRANTED', + personalizationConsent: 'DENIED', + eventsToOfflineConversionsTypeMapping: [ + { + from: 'Product Clicked', + to: 'store', + }, + ], + eventsToConversionsNamesMapping: [ + { + from: 'Product Clicked', + to: 'Sign-up - click', + }, + ], + hashUserIdentifier: true, + defaultUserIdentifier: 'phone', + validateOnly: false, + rudderAccountId: '2EOknn1JNH7WK1MfNkgr4t3u4fGYKkRK', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + "The value '0' does not match the regex pattern, ^([1-9]\\d*(\\.\\d+)?|0\\.\\d+)$", + metadata: { + secret: { + access_token: secret1, + developer_token: secret3, refresh_token: 'efgh5678', }, }, diff --git a/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts b/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts index bcc718485b3..e984ee55784 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts @@ -1,5 +1,8 @@ +import { authHeader1, secret1, secret3 } from '../maskedSecrets'; import { timestampMock } from '../mocks'; +const API_VERSION = 'v18'; + export const data = [ { name: 'google_adwords_offline_conversions', @@ -92,9 +95,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 1, userId: 'u1', @@ -208,9 +211,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 2, userId: 'u1', @@ -272,9 +275,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 3, userId: 'u1', @@ -347,9 +350,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 4, userId: 'u1', @@ -422,9 +425,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 5, userId: 'u1', @@ -483,12 +486,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/7693729833/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Store sales', customerId: '7693729833' }, body: { @@ -565,12 +567,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/7693729833:uploadCallConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833:uploadCallConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Order Completed', @@ -617,18 +618,18 @@ export const data = [ metadata: [ { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 3, userId: 'u1', }, { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 4, userId: 'u1', @@ -680,12 +681,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Sign-up - click', @@ -772,9 +772,9 @@ export const data = [ metadata: [ { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 1, userId: 'u1', @@ -815,12 +815,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadCallConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'search', @@ -887,9 +886,9 @@ export const data = [ metadata: [ { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 2, userId: 'u1', @@ -929,9 +928,9 @@ export const data = [ metadata: [ { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 5, userId: 'u1', @@ -1117,9 +1116,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 1, userId: 'u1', @@ -1169,12 +1168,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v16/customers/1234556775/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234556775/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Store sales', customerId: '1234556775' }, body: { @@ -1228,9 +1226,9 @@ export const data = [ metadata: [ { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 1, userId: 'u1', 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 9fea895a9f9..71cae86521d 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts @@ -1,13 +1,14 @@ +import { authHeader1, secret3 } from '../maskedSecrets'; import { generateGoogleOAuthMetadata, generateProxyV0Payload, generateProxyV1Payload, } from '../../../testUtils'; -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_remarketing_lists/config'; +const API_VERSION = 'v18'; export const commonHeaders = { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }; @@ -414,7 +415,7 @@ export const testScenariosForV1API = [ dontBatch: false, jobId: 1, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', 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 e8a1cfc07e1..297ee8b9cf0 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts @@ -1,6 +1,8 @@ +import { authHeader2, secret2, secret1 } from '../maskedSecrets'; import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { commonHeaders, commonParams, validRequestPayload1 } from './business'; -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_remarketing_lists/config'; + +const API_VERSION = 'v18'; const commonStatTags = { destType: 'GOOGLE_ADWORDS_REMARKETING_LISTS', @@ -31,7 +33,7 @@ export const oauthError = [ params: commonParams, JSON: validRequestPayload1, endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, - accessToken: 'dummy-access', + accessToken: secret1, }), method: 'POST', }, @@ -54,7 +56,7 @@ export const oauthError = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'dummy-access', + accessToken: secret1, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -82,11 +84,11 @@ export const oauthError = [ input: { request: { body: generateProxyV1Payload({ - headers: { ...commonHeaders, Authorization: 'Bearer wrongCustomerID' }, - params: { ...commonParams, customerId: 'wrongCustomerID' }, + headers: { ...commonHeaders, Authorization: authHeader2 }, + params: { ...commonParams, customerId: secret2 }, JSON: validRequestPayload1, endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, - accessToken: 'wrongCustomerID', + accessToken: secret2, }), method: 'POST', }, @@ -103,7 +105,7 @@ export const oauthError = [ { 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' } }, + metadata: { ...generateMetadata(1), secret: { accessToken: secret2 } }, statusCode: 401, }, ], diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/maskedSecrets.ts b/test/integrations/destinations/google_adwords_remarketing_lists/maskedSecrets.ts new file mode 100644 index 00000000000..1ee175e1cb9 --- /dev/null +++ b/test/integrations/destinations/google_adwords_remarketing_lists/maskedSecrets.ts @@ -0,0 +1,10 @@ +import path from 'path'; + +import { defaultAccessToken } from '../../common/secrets'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = defaultAccessToken; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; +export const authHeader3 = `Bearer ${secret3}`; diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/network.ts b/test/integrations/destinations/google_adwords_remarketing_lists/network.ts index a367c18737c..a979bd0b6e0 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/network.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/network.ts @@ -1,4 +1,5 @@ -import { API_VERSION } from '../../../../src/v0/destinations/google_adwords_remarketing_lists/config'; +import { authHeader1, authHeader2, secret2 } from './maskedSecrets'; +const API_VERSION = 'v18'; export const networkCallsData = [ { @@ -14,7 +15,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -58,7 +59,7 @@ export const networkCallsData = [ ], }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -73,7 +74,7 @@ export const networkCallsData = [ httpReq: { url: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs/18025019461:run`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -96,7 +97,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -117,7 +118,7 @@ export const networkCallsData = [ operations: [{ create: { userIdentifiers: [{ hashedEmail: 'abcd@testmail.com' }] } }], }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -196,7 +197,7 @@ export const networkCallsData = [ ], }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -223,7 +224,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -248,7 +249,7 @@ export const networkCallsData = [ job: { type: 'CUSTOMER_MATCH_USER_LIST', customerMatchUserListMetadata: { - userList: 'customers/wrongCustomerID/userLists/709078448', + userList: `customers/${secret2}/userLists/709078448`, consent: { adPersonalization: 'UNSPECIFIED', adUserData: 'UNSPECIFIED', @@ -257,7 +258,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Bearer wrongCustomerID', + Authorization: authHeader2, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -305,7 +306,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts b/test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts index 4398bc14e16..c819e7ef106 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts @@ -1,4 +1,6 @@ -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_remarketing_lists/config'; +import { authHeader1, secret1 } from '../maskedSecrets'; +const API_VERSION = 'v18'; + export const data = [ { name: 'google_adwords_remarketing_lists', @@ -12,7 +14,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -72,7 +74,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -120,7 +122,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -143,7 +145,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -204,7 +206,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', 'login-customer-id': '8704830944', @@ -238,7 +240,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -261,7 +263,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -323,7 +325,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -356,7 +358,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -379,7 +381,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -454,7 +456,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -487,7 +489,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -544,7 +546,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -577,7 +579,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -633,7 +635,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -665,7 +667,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -709,7 +711,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -741,7 +743,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -805,7 +807,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -837,7 +839,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -1424,7 +1426,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -2709,7 +2711,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -2732,7 +2734,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -2818,7 +2820,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -2883,7 +2885,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -2897,7 +2899,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -2962,7 +2964,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -2985,7 +2987,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -4109,7 +4111,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -5394,7 +5396,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -5408,7 +5410,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -6693,7 +6695,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -6716,7 +6718,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -6784,7 +6786,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -6849,7 +6851,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -6872,7 +6874,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -6936,7 +6938,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -6969,7 +6971,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -8093,7 +8095,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -9378,7 +9380,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -9392,7 +9394,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -10677,7 +10679,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -10700,7 +10702,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -10786,7 +10788,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -10851,7 +10853,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -10865,7 +10867,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -10930,7 +10932,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -10953,7 +10955,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11039,7 +11041,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11102,7 +11104,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11116,7 +11118,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11176,7 +11178,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11199,7 +11201,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11259,7 +11261,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11301,7 +11303,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11404,7 +11406,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11464,7 +11466,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11506,7 +11508,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11529,7 +11531,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11602,7 +11604,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11643,7 +11645,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11666,7 +11668,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11739,7 +11741,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11780,7 +11782,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11803,7 +11805,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11878,7 +11880,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11922,7 +11924,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11945,7 +11947,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -12020,7 +12022,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -12061,7 +12063,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts b/test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts index 12d5c65f8f1..0c64eab9513 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts @@ -1,10 +1,12 @@ +import { authHeader3, secret3 } from '../maskedSecrets'; import { rETLAudienceRouterRequest } from './audience'; import { rETLRecordRouterRequest, rETLRecordRouterRequestVDMv2General, rETLRecordRouterRequestVDMv2UserId, } from './record'; -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_remarketing_lists/config'; + +const API_VERSION = 'v18'; export const data = [ { @@ -32,7 +34,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -83,7 +85,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -127,7 +129,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -178,7 +180,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -222,7 +224,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -272,7 +274,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -323,7 +325,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -389,7 +391,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -442,7 +444,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -486,7 +488,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -557,7 +559,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -570,7 +572,7 @@ export const data = [ dontBatch: false, jobId: 3, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -613,7 +615,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -666,7 +668,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -709,7 +711,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -761,7 +763,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -814,7 +816,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -877,7 +879,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -915,7 +917,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', diff --git a/test/integrations/destinations/hs/dataDelivery/business.ts b/test/integrations/destinations/hs/dataDelivery/business.ts index 2239abfb951..44748de0a10 100644 --- a/test/integrations/destinations/hs/dataDelivery/business.ts +++ b/test/integrations/destinations/hs/dataDelivery/business.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2 } from '../maskedSecrets'; import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; const commonStatTags = { @@ -24,11 +25,32 @@ export const businessData = [ { endpoint: 'https://api.hubapi.com/contacts/v1/contact/batch/', JSON_ARRAY: { - batch: - '[{"email":"identify111051@test.com","properties":[{"property":"firstname","value":"John1051"},{"property":"lastname","value":"Sparrow1051"}]},{"email":"identify111052@test.com","properties":[{"property":"firstname","value":"John1052"},{"property":"lastname","value":"Sparrow1052"}]},{"email":"identify111053@test.com","properties":[{"property":"firstname","value":"John1053"},{"property":"lastname","value":"Sparrow1053"}]}]', + batch: JSON.stringify([ + { + email: 'identify111051@test.com', + properties: [ + { property: 'firstname', value: 'John1051' }, + { property: 'lastname', value: 'Sparrow1051' }, + ], + }, + { + email: 'identify111052@test.com', + properties: [ + { property: 'firstname', value: 'John1052' }, + { property: 'lastname', value: 'Sparrow1052' }, + ], + }, + { + email: 'identify111053@test.com', + properties: [ + { property: 'firstname', value: 'John1053' }, + { property: 'lastname', value: 'Sparrow1053' }, + ], + }, + ]), }, headers: { - Authorization: 'Bearer validApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, }, @@ -76,11 +98,32 @@ export const businessData = [ { endpoint: 'https://api.hubapi.com/contacts/v1/contact/batch/', JSON_ARRAY: { - batch: - '[{"email":"identify111051@test.com","properties":[{"property":"firstname","value":"John1051"},{"property":"lastname","value":"Sparrow1051"}]},{"email":"identify111052@test.con","properties":[{"property":"firstname","value":"John1052"},{"property":"lastname","value":"Sparrow1052"}]},{"email":"identify111053@test.com","properties":[{"property":"firstname","value":"John1053"},{"property":"lastname","value":"Sparrow1053"}]}]', + batch: JSON.stringify([ + { + email: 'identify111051@test.com', + properties: [ + { property: 'firstname', value: 'John1051' }, + { property: 'lastname', value: 'Sparrow1051' }, + ], + }, + { + email: 'identify111052@test.con', + properties: [ + { property: 'firstname', value: 'John1052' }, + { property: 'lastname', value: 'Sparrow1052' }, + ], + }, + { + email: 'identify111053@test.com', + properties: [ + { property: 'firstname', value: 'John1053' }, + { property: 'lastname', value: 'Sparrow1053' }, + ], + }, + ]), }, headers: { - Authorization: 'Bearer inValidApiKey', + Authorization: authHeader2, 'Content-Type': 'application/json', }, }, @@ -181,7 +224,7 @@ export const businessData = [ { headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer validAccessToken', + Authorization: authHeader1, }, method: 'POST', endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', @@ -460,7 +503,7 @@ export const businessData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, JSON: { email: 'osvaldocostaferreira98@gmail.com', @@ -508,7 +551,7 @@ export const businessData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer invalid-dummy-access-token', + Authorization: authHeader2, }, JSON: { email: 'osvaldocostaferreira98@gmail.com', @@ -560,7 +603,7 @@ export const businessData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, JSON: { inputs: [{ to: { id: 1 }, from: { id: 9405415215 }, type: 'contact_to_company' }], diff --git a/test/integrations/destinations/hs/dataDelivery/other.ts b/test/integrations/destinations/hs/dataDelivery/other.ts index 202b665a51e..0aab89465d6 100644 --- a/test/integrations/destinations/hs/dataDelivery/other.ts +++ b/test/integrations/destinations/hs/dataDelivery/other.ts @@ -1,4 +1,5 @@ import { generateMetadata } from '../../../testUtils'; +import { authHeader1 } from '../maskedSecrets'; const commonStatTags = { destType: 'HS', @@ -17,7 +18,7 @@ const commonBody = { method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, params: {}, files: {}, @@ -188,7 +189,7 @@ export const otherData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, params: {}, files: {}, diff --git a/test/integrations/destinations/hs/maskedSecrets.ts b/test/integrations/destinations/hs/maskedSecrets.ts new file mode 100644 index 00000000000..935d0e6d37e --- /dev/null +++ b/test/integrations/destinations/hs/maskedSecrets.ts @@ -0,0 +1,10 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; +export const authHeader3 = `Bearer ${secret3}`; +export const authHeader4 = `Bearer ${secret4}`; diff --git a/test/integrations/destinations/hs/network.ts b/test/integrations/destinations/hs/network.ts index 9d8658ff6b0..1b3658dc254 100644 --- a/test/integrations/destinations/hs/network.ts +++ b/test/integrations/destinations/hs/network.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2, authHeader3, authHeader4 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { @@ -424,7 +425,7 @@ export const networkCallsData = [ url: 'https://api.hubapi.com/crm/v3/objects/contacts/search', method: 'POST', headers: { - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, }, httpRes: { @@ -436,7 +437,7 @@ export const networkCallsData = [ url: 'https://api.hubapi.com/crm/v3/objects/contacts/search', method: 'POST', headers: { - Authorization: 'Bearer dummy-access-tokensuccess', + Authorization: authHeader2, }, }, httpRes: { @@ -466,7 +467,7 @@ export const networkCallsData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token-hs-additonal-email', + Authorization: authHeader3, }, }, httpRes: { @@ -496,7 +497,7 @@ export const networkCallsData = [ url: 'https://api.hubapi.com/crm/v3/objects/contacts/search', method: 'POST', headers: { - Authorization: 'Bearer dummy-access-tokenmultiple', + Authorization: authHeader4, }, }, httpRes: { @@ -865,7 +866,7 @@ export const networkCallsData = [ url: 'https://api.hubapi.com/crm/v3/objects/contacts/search', method: 'POST', headers: { - Authorization: 'Bearer dontbatchtrueaccesstoken', + Authorization: authHeader1, }, }, httpRes: { @@ -883,7 +884,7 @@ export const networkCallsData = [ headers: { 'User-Agent': 'RudderLabs', 'Content-Type': 'application/json', - Authorization: 'Bearer validApiKey', + Authorization: authHeader1, }, }, httpRes: { @@ -897,7 +898,7 @@ export const networkCallsData = [ headers: { 'User-Agent': 'RudderLabs', 'Content-Type': 'application/json', - Authorization: 'Bearer inValidApiKey', + Authorization: authHeader2, }, }, httpRes: { @@ -942,7 +943,7 @@ export const networkCallsData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer validAccessToken', + Authorization: authHeader1, }, }, httpRes: { @@ -1010,7 +1011,7 @@ export const networkCallsData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, }, httpRes: { @@ -1024,7 +1025,7 @@ export const networkCallsData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer invalid-dummy-access-token', + Authorization: authHeader2, }, }, httpRes: { @@ -1044,7 +1045,7 @@ export const networkCallsData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, }, httpRes: { diff --git a/test/integrations/destinations/hs/processor/data.ts b/test/integrations/destinations/hs/processor/data.ts index f503ae92acc..b80a81ad5c4 100644 --- a/test/integrations/destinations/hs/processor/data.ts +++ b/test/integrations/destinations/hs/processor/data.ts @@ -1,15 +1,16 @@ +import { authHeader1, secret1, authHeader2, secret2, secret3, secret4 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { generateMetadata, generateSimplifiedIdentifyPayload } from '../../../testUtils'; const commonOutputHeaders = { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }; const destination: Destination = { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1356,7 +1357,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [], @@ -1392,7 +1393,7 @@ export const data = [ source: 'rETL', operation: 'createObject', headers: { - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1488,7 +1489,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [], @@ -1524,7 +1525,7 @@ export const data = [ source: 'rETL', operation: 'updateObject', headers: { - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1917,7 +1918,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: 'dummy-hubId', apiKey: 'dummy-apikey', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'legacyApi', lookupField: '', blacklistedEvents: [ @@ -1951,7 +1952,7 @@ export const data = [ 'https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -2042,7 +2043,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-tokensuccess', + accessToken: secret2, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -2075,11 +2076,11 @@ export const data = [ version: '1', type: 'REST', userId: '', - method: 'POST', + method: 'PATCH', endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/103604', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-tokensuccess', + Authorization: authHeader2, }, params: {}, operation: 'updateContacts', @@ -2165,7 +2166,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -2202,7 +2203,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, operation: 'createContacts', @@ -2287,7 +2288,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-tokenmultiple', + accessToken: secret4, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -2391,7 +2392,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '1', apiKey: '1', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -2455,7 +2456,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -2814,7 +2815,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -2913,7 +2914,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -2977,7 +2978,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3030,7 +3031,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -3094,7 +3095,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3142,7 +3143,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -3247,7 +3248,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -3310,7 +3311,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3887,7 +3888,7 @@ export const data = [ destination: { Config: { authorizationType: 'legacyApiKey', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikeysuccess', apiVersion: 'newApi', @@ -3980,7 +3981,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -4180,7 +4181,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -4533,7 +4534,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'legacyApi', lookupField: 'lookupField', hubspotEvents: [ @@ -4663,7 +4664,7 @@ export const data = [ apiKey: 'dummy-apikey', hubID: 'dummy-hubId', authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'legacyApi', }, Enabled: true, @@ -4685,7 +4686,7 @@ export const data = [ endpoint: 'https://track.hubspot.com/v1/event', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: { _a: 'dummy-hubId', @@ -5269,7 +5270,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', eventFilteringOption: 'disable', @@ -5425,4 +5426,86 @@ export const data = [ }, }, }, + { + name: 'hs', + description: + '[HS] (New API v3) - throw error if invalid email is provided in traits for identify call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: + '[HS] (New API v3) - throw error if invalid email is provided in traits for identify call', + message: { + channel: 'web', + context: { + traits: { + email: 'incorrect-email', + firstname: 'Test Hubspot', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + }, + type: 'identify', + messageId: 'e8585d9a-7137-4223-b295-68ab1b17dad7', + originalTimestamp: '2025-01-01T09:35:31.289Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: '', + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: secret1, + apiVersion: 'newApi', + lookupField: 'lookupField', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Email "incorrect-email" is invalid', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/hs/router/config.ts b/test/integrations/destinations/hs/router/config.ts index 89a0c13d1a8..6d14fd80e32 100644 --- a/test/integrations/destinations/hs/router/config.ts +++ b/test/integrations/destinations/hs/router/config.ts @@ -1,6 +1,7 @@ +import { secret1 } from '../maskedSecrets'; export const destination = { Config: { - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', authorizationType: 'newPrivateAppApi', apiVersion: 'newApi', diff --git a/test/integrations/destinations/hs/router/data.ts b/test/integrations/destinations/hs/router/data.ts index 2f0879528bf..c72393de790 100644 --- a/test/integrations/destinations/hs/router/data.ts +++ b/test/integrations/destinations/hs/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader2, authHeader3, secret3, secret2 } from '../maskedSecrets'; import { destination } from './config'; export const data = [ { @@ -15,7 +16,7 @@ export const data = [ ID: '123', Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'pat-123', + accessToken: secret1, apiVersion: 'newApi', }, }, @@ -74,7 +75,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.hubapi.com/crm/v3/associations/companies/contacts/batch/create', - headers: { 'Content-Type': 'application/json', Authorization: 'Bearer pat-123' }, + headers: { 'Content-Type': 'application/json', Authorization: authHeader1 }, params: {}, body: { JSON: { inputs: [{ to: { id: 1 }, from: { id: 9405415215 }, type: 'engineer' }] }, @@ -91,7 +92,7 @@ export const data = [ ID: '123', Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'pat-123', + accessToken: secret1, apiVersion: 'newApi', }, }, @@ -572,8 +573,12 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testhubspot1@email.com","properties":[{"property":"firstname","value":"Test Hubspot1"}]}]', + batch: JSON.stringify([ + { + email: 'testhubspot1@email.com', + properties: [{ property: 'firstname', value: 'Test Hubspot1' }], + }, + ]), }, XML: {}, FORM: {}, @@ -657,8 +662,12 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testhubspot3@email.com","properties":[{"property":"firstname","value":"Test Hubspot3"}]}]', + batch: JSON.stringify([ + { + email: 'testhubspot3@email.com', + properties: [{ property: 'firstname', value: 'Test Hubspot3' }], + }, + ]), }, XML: {}, FORM: {}, @@ -701,8 +710,12 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testhubspot4@email.com","properties":[{"property":"firstname","value":"Test Hubspot4"}]}]', + batch: JSON.stringify([ + { + email: 'testhubspot4@email.com', + properties: [{ property: 'firstname', value: 'Test Hubspot4' }], + }, + ]), }, XML: {}, FORM: {}, @@ -778,7 +791,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -855,7 +868,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -943,7 +956,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1010,7 +1023,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/lead/batch/create', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -1052,7 +1065,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1107,7 +1120,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/lead/batch/update', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -1135,7 +1148,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1233,7 +1246,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1316,7 +1329,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1399,7 +1412,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1482,7 +1495,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1549,7 +1562,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1615,7 +1628,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -1644,7 +1657,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1699,7 +1712,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -1720,7 +1733,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1811,7 +1824,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token-hs-additonal-email', + accessToken: secret3, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1857,7 +1870,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/update', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token-hs-additonal-email', + Authorization: authHeader3, }, params: {}, body: { @@ -1881,7 +1894,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token-hs-additonal-email', + accessToken: secret3, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1961,7 +1974,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2037,7 +2050,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2111,7 +2124,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2186,7 +2199,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2269,7 +2282,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', files: {}, headers: { - Authorization: 'Bearer dontbatchtrueaccesstoken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -2279,7 +2292,7 @@ export const data = [ }, destination: { Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2358,7 +2371,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', files: {}, headers: { - Authorization: 'Bearer dontbatchtrueaccesstoken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -2368,7 +2381,7 @@ export const data = [ }, destination: { Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2438,7 +2451,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', files: {}, headers: { - Authorization: 'Bearer dontbatchtrueaccesstoken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -2448,7 +2461,7 @@ export const data = [ }, destination: { Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2552,7 +2565,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2627,7 +2640,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2710,7 +2723,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', files: {}, headers: { - Authorization: 'Bearer dontbatchtrueaccesstoken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -2720,7 +2733,7 @@ export const data = [ }, destination: { Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -3056,7 +3069,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3104,7 +3117,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3137,7 +3150,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3170,7 +3183,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3203,7 +3216,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3236,7 +3249,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3269,7 +3282,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3480,8 +3493,23 @@ export const data = [ updatedAt: '2021-02-03T16:22:31.374Z', workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', }, - error: - '{"message":"Failed to get hubspot properties: {\\"status\\":\\"error\\",\\"message\\":\\"The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/\\",\\"correlationId\\":\\"4d39ff11-e121-4514-bcd8-132a9dd1ff50\\",\\"category\\":\\"INVALID_AUTHENTICATION\\",\\"links\\":{\\"api key\\":\\"https://app.hubspot.com/l/api-key/\\"}}","destinationResponse":{"response":{"status":"error","message":"The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/","correlationId":"4d39ff11-e121-4514-bcd8-132a9dd1ff50","category":"INVALID_AUTHENTICATION","links":{"api key":"https://app.hubspot.com/l/api-key/"}},"status":401}}', + error: JSON.stringify({ + message: + 'Failed to get hubspot properties: {"status":"error","message":"The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/","correlationId":"4d39ff11-e121-4514-bcd8-132a9dd1ff50","category":"INVALID_AUTHENTICATION","links":{"api key":"https://app.hubspot.com/l/api-key/"}}', + destinationResponse: { + response: { + status: 'error', + message: + 'The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/', + correlationId: '4d39ff11-e121-4514-bcd8-132a9dd1ff50', + category: 'INVALID_AUTHENTICATION', + links: { + 'api key': 'https://app.hubspot.com/l/api-key/', + }, + }, + status: 401, + }, + }), metadata: [ { jobId: 2, @@ -3524,8 +3552,23 @@ export const data = [ updatedAt: '2021-02-03T16:22:31.374Z', workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', }, - error: - '{"message":"Failed to get hubspot properties: {\\"status\\":\\"error\\",\\"message\\":\\"The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/\\",\\"correlationId\\":\\"4d39ff11-e121-4514-bcd8-132a9dd1ff50\\",\\"category\\":\\"INVALID_AUTHENTICATION\\",\\"links\\":{\\"api key\\":\\"https://app.hubspot.com/l/api-key/\\"}}","destinationResponse":{"response":{"status":"error","message":"The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/","correlationId":"4d39ff11-e121-4514-bcd8-132a9dd1ff50","category":"INVALID_AUTHENTICATION","links":{"api key":"https://app.hubspot.com/l/api-key/"}},"status":401}}', + error: JSON.stringify({ + message: + 'Failed to get hubspot properties: {"status":"error","message":"The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/","correlationId":"4d39ff11-e121-4514-bcd8-132a9dd1ff50","category":"INVALID_AUTHENTICATION","links":{"api key":"https://app.hubspot.com/l/api-key/"}}', + destinationResponse: { + response: { + status: 'error', + message: + 'The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/', + correlationId: '4d39ff11-e121-4514-bcd8-132a9dd1ff50', + category: 'INVALID_AUTHENTICATION', + links: { + 'api key': 'https://app.hubspot.com/l/api-key/', + }, + }, + status: 401, + }, + }), metadata: [ { jobId: 3, @@ -3547,4 +3590,321 @@ export const data = [ }, }, }, + { + name: 'hs', + description: 'test when email is of wrong format', + feature: 'router', + module: 'destination', + id: 'emailfailsValidation', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + channel: 'web', + context: { + traits: { + email: 'incorrect-email', + firstname: 'Test Hubspot', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + }, + type: 'identify', + messageId: 'e8585d9a-7137-4223-b295-68ab1b17dad7', + originalTimestamp: '2025-01-01T09:35:31.289Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: '', + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: secret1, + apiVersion: 'newApi', + lookupField: 'lookupField', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + metadata: { jobId: 3, userId: 'u1' }, + }, + ], + destType: 'hs', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + destination: { + Config: { + accessToken: secret1, + apiKey: '', + apiVersion: 'newApi', + authorizationType: 'newPrivateAppApi', + blacklistedEvents: [ + { + eventName: '', + }, + ], + eventFilteringOption: 'disable', + hubID: '', + lookupField: 'lookupField', + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + error: 'Email "incorrect-email" is invalid', + metadata: [ + { + jobId: 3, + userId: 'u1', + }, + ], + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + }, + { + name: 'hs', + description: 'if dontBatch is true we should use patch request method for update for retl flow', + feature: 'router', + module: 'destination', + version: 'v0', + scenario: 'buisness', + id: 'dontbatchtrueid', + successCriteria: + 'should not create a batch with the events if that events contains dontBatch true', + input: { + request: { + body: { + input: [ + { + message: { + type: 'identify', + sentAt: '2024-05-23T16:49:57.461+05:30', + userId: 'identify425@test.com', + channel: 'mobile', + context: { + traits: { + age: '30', + name: 'John Sparrow', + email: 'identify425@test.com', + phone: '9112340425', + lastname: 'Sparrow', + firstname: 'John', + }, + context: { + sources: { + job_id: '2qY238MjR41Cn1pnO5kSK0Metno', + version: 'v1.60.8', + job_run_id: 'cus0gkdes5sukm8iqqh0', + task_run_id: 'cus0gkdes5sukm8iqqig', + }, + externalId: [ + { + id: 'identify425@test.com', + type: 'HS-contacts', + identifierType: 'email', + }, + ], + mappedToDestination: 'true', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + timestamp: '2024-05-23T16:49:57.070+05:30', + receivedAt: '2024-05-23T16:49:57.071+05:30', + anonymousId: '8d872292709c6fbe', + }, + metadata: { + jobId: 1, + sourceId: '2RnN36pc7p5lzoApxZnDfRnYFx0', + destinationId: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', + transformAt: 'router', + workspaceId: '2QapBTEvZYwuf6O9KB5AEvvBt8j', + dontBatch: true, + }, + destination: { + ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', + Name: 'hs-1', + Config: { + accessToken: secret2, + apiKey: '', + apiVersion: 'newApi', + authorizationType: 'newPrivateAppApi', + blacklistedEvents: [], + connectionMode: 'cloud', + doAssociation: false, + eventDelivery: false, + eventDeliveryTS: 1687884567403, + eventFilteringOption: 'disable', + hubID: '25092171', + hubspotEvents: [ + { + eventProperties: [ + { + from: 'first_name', + to: 'first_name', + }, + { + from: 'last_name', + to: 'last_name', + }, + ], + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + rsEventName: 'Order Complete', + }, + ], + lookupField: 'email', + useNativeSDK: false, + whitelistedEvents: [], + }, + Enabled: true, + WorkspaceID: '2QapBTEvZYwuf6O9KB5AEvvBt8j', + Transformations: [], + IsProcessorEnabled: true, + RevisionID: '2gqf7Mc7WEwqQtQy3G105O22s3D', + }, + request: { + query: {}, + }, + }, + ], + destType: 'hs', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: { + body: { + FORM: {}, + JSON: { + properties: { + email: 'identify425@test.com', + firstname: 'John', + lastname: 'Sparrow', + phone: '9112340425', + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/103604', + files: {}, + headers: { + Authorization: authHeader2, + 'Content-Type': 'application/json', + }, + method: 'PATCH', + params: {}, + type: 'REST', + version: '1', + }, + destination: { + Config: { + accessToken: secret2, + apiKey: '', + apiVersion: 'newApi', + authorizationType: 'newPrivateAppApi', + blacklistedEvents: [], + connectionMode: 'cloud', + doAssociation: false, + eventDelivery: false, + eventDeliveryTS: 1687884567403, + eventFilteringOption: 'disable', + hubID: '25092171', + hubspotEvents: [ + { + eventProperties: [ + { + from: 'first_name', + to: 'first_name', + }, + { + from: 'last_name', + to: 'last_name', + }, + ], + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + rsEventName: 'Order Complete', + }, + ], + lookupField: 'email', + useNativeSDK: false, + whitelistedEvents: [], + }, + Enabled: true, + ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', + IsProcessorEnabled: true, + Name: 'hs-1', + RevisionID: '2gqf7Mc7WEwqQtQy3G105O22s3D', + Transformations: [], + WorkspaceID: '2QapBTEvZYwuf6O9KB5AEvvBt8j', + }, + metadata: [ + { + destinationId: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', + dontBatch: true, + jobId: 1, + sourceId: '2RnN36pc7p5lzoApxZnDfRnYFx0', + transformAt: 'router', + workspaceId: '2QapBTEvZYwuf6O9KB5AEvvBt8j', + }, + ], + statusCode: 200, + }, + ], + }, + }, + }, + }, ]; diff --git a/test/integrations/destinations/http/common.ts b/test/integrations/destinations/http/common.ts index f0c8bc8a337..914704d6c2a 100644 --- a/test/integrations/destinations/http/common.ts +++ b/test/integrations/destinations/http/common.ts @@ -1,3 +1,4 @@ +import { secret1, secret2 } from './maskedSecrets'; import { Destination } from '../../../../src/types'; const destType = 'http'; @@ -43,7 +44,7 @@ const destinations: Destination[] = [ Config: { apiUrl: 'http://abc.com/contacts', auth: 'basicAuth', - username: 'test-user', + username: secret1, password: '', method: 'GET', format: 'JSON', @@ -92,13 +93,18 @@ const destinations: Destination[] = [ }, { Config: { - apiUrl: 'http://abc.com/contacts/{{$.traits.email}}/', + apiUrl: 'http://abc.com/contacts/', auth: 'apiKeyAuth', apiKeyName: 'x-api-key', apiKeyValue: 'test-api-key', method: 'DELETE', isBatchingEnabled: true, maxBatchSize: 4, + pathParams: [ + { + path: '$.traits.email', + }, + ], }, DestinationDefinition: { DisplayName: displayName, @@ -114,13 +120,18 @@ const destinations: Destination[] = [ }, { Config: { - apiUrl: 'http://abc.com/contacts/{{$.traits.email}}/', + apiUrl: 'http://abc.com/contacts/', auth: 'apiKeyAuth', apiKeyName: 'x-api-key', apiKeyValue: 'test-api-key', method: 'GET', isBatchingEnabled: true, maxBatchSize: 4, + pathParams: [ + { + path: '$.traits.email', + }, + ], }, DestinationDefinition: { DisplayName: displayName, @@ -138,9 +149,10 @@ const destinations: Destination[] = [ Config: { apiUrl: 'http://abc.com/events', auth: 'bearerTokenAuth', - bearerToken: 'test-token', + bearerToken: secret2, method: 'POST', format: 'XML', + xmlRootKey: 'body', headers: [ { to: '$.h1', @@ -249,7 +261,7 @@ const destinations: Destination[] = [ }, { Config: { - apiUrl: 'http://abc.com/contacts/{{$.traits.phone}}', + apiUrl: 'http://abc.com/contacts/', auth: 'noAuth', method: 'POST', format: 'JSON', @@ -262,9 +274,366 @@ const destinations: Destination[] = [ }, { to: '$.key', - from: '.traits.key', + from: '$.traits.key', + }, + ], + pathParams: [ + { + path: '$.traits.phone', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, + { + Config: { + apiUrl: 'http://abc.com/contacts', + auth: 'basicAuth', + username: secret1, + password: '', + method: 'GET', + format: 'JSON', + isBatchingEnabled: true, + maxBatchSize: 2, + headers: [ + { + to: '$.h1', + from: "'val1'", + }, + { + to: '$.h2', + from: '2', + }, + { + to: "$.'content-type'", + from: "'application/json'", + }, + { + to: '$.h3', + from: '$.traits.firstName', + }, + ], + queryParams: [ + { + to: "$['q1']", + from: "'val1'", + }, + { + to: '$.q2', + from: '$.traits.email', + }, + ], + pathParams: [ + { + path: '$.userId', + }, + { + path: 'c1', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, + { + Config: { + apiUrl: 'http://abc.com/contacts', + auth: 'basicAuth', + username: secret1, + password: '', + method: 'GET', + format: 'JSON', + isBatchingEnabled: true, + maxBatchSize: 2, + headers: [ + { + to: '$.h1', + from: "'val1'", + }, + { + to: '$.h2', + from: '2', + }, + { + to: "$.'content-type'", + from: "'application/json'", + }, + { + to: '$.h3', + from: '$.traits.firstName', }, ], + queryParams: [ + { + to: 'user name', + from: "'val1'", + }, + { + to: '$.q2', + from: '$.traits.email', + }, + ], + pathParams: [ + { + path: '$.userId', + }, + { + path: 'c1', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, + { + Config: { + apiUrl: 'http://abc.com/events', + auth: 'bearerTokenAuth', + bearerToken: secret2, + method: 'POST', + format: 'XML', + headers: [ + { + to: '$.h1', + from: "'val1'", + }, + { + to: '$.h2', + from: '$.key1', + }, + { + to: "$.'content-type'", + from: "'application/json'", + }, + ], + propertiesMapping: [ + { + from: '$.properties', + to: '$', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, + { + Config: { + apiUrl: 'http://abc.com/events', + auth: 'bearerTokenAuth', + bearerToken: secret2, + method: 'POST', + format: 'FORM', + headers: [ + { + to: '$.h1', + from: "'val1'", + }, + { + to: '$.h2', + from: '$.key1', + }, + { + to: "$.'content-type'", + from: "'application/json'", + }, + ], + propertiesMapping: [ + { + from: '$.event', + to: '$.event', + }, + { + from: '$.properties.currency', + to: '$.currency', + }, + { + from: '$.userId', + to: '$.userId', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, + { + Config: { + apiUrl: 'http://abc.com/events', + auth: 'bearerTokenAuth', + bearerToken: secret2, + method: 'POST', + format: 'FORM', + headers: [ + { + to: '$.h1', + from: "'val1'", + }, + { + to: '$.h2', + from: '$.key1', + }, + ], + propertiesMapping: [ + { + from: '$.event', + to: '$.event', + }, + { + from: '$.properties.currency', + to: '$.currency', + }, + { + from: '$.userId', + to: '$.userId', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, + { + Config: { + apiUrl: 'http://abc.com/events', + auth: 'bearerTokenAuth', + bearerToken: secret2, + method: 'POST', + format: 'FORM', + headers: [ + { + to: '$.h1', + from: "'val1'", + }, + { + to: '$.h2', + from: '$.key1', + }, + ], + propertiesMapping: [ + { + from: '$.event', + to: '$.event', + }, + { + from: '$.properties.currency', + to: '$.currency', + }, + { + from: '$.userId', + to: '$.userId', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, + { + Config: { + apiUrl: 'http://abc.com/contacts', + auth: 'noAuth', + method: 'POST', + format: 'FORM', + isBatchingEnabled: true, + maxBatchSize: '2', + propertiesMapping: [ + { + from: '$.traits.firstName', + to: '$.contacts.first_name', + }, + { + from: '$.traits.email', + to: '$.contacts.email', + }, + { + from: '$.traits.address.pinCode', + to: '$.contacts.address.pin_code', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, + { + Config: { + apiUrl: 'http://abc.com/contacts', + auth: 'noAuth', + method: 'POST', + format: 'JSON', + isBatchingEnabled: true, + maxBatchSize: '2', + isDefaultMapping: true, + propertiesMapping: [], }, DestinationDefinition: { DisplayName: displayName, @@ -329,7 +698,7 @@ const properties = { const processorInstrumentationErrorStatTags = { destType: destTypeInUpperCase, errorCategory: 'dataValidation', - errorType: 'instrumentation', + errorType: 'configuration', feature: 'processor', implementation: 'cdkV2', module: 'destination', diff --git a/test/integrations/destinations/http/maskedSecrets.ts b/test/integrations/destinations/http/maskedSecrets.ts new file mode 100644 index 00000000000..1e9bca66163 --- /dev/null +++ b/test/integrations/destinations/http/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + '')}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/http/processor/configuration.ts b/test/integrations/destinations/http/processor/configuration.ts index b493a236ee0..9baa64bd75c 100644 --- a/test/integrations/destinations/http/processor/configuration.ts +++ b/test/integrations/destinations/http/processor/configuration.ts @@ -1,6 +1,13 @@ +import { authHeader1, authHeader2 } from '../maskedSecrets'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata, transformResultBuilder } from '../../../testUtils'; -import { destType, destinations, properties, traits } from '../common'; +import { + destType, + destinations, + properties, + traits, + processorInstrumentationErrorStatTags, +} from '../common'; export const configuration: ProcessorTestData[] = [ { @@ -26,6 +33,7 @@ export const configuration: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -37,6 +45,9 @@ export const configuration: ProcessorTestData[] = [ method: 'POST', userId: '', endpoint: destinations[0].Config.apiUrl, + headers: { + 'Content-Type': 'application/json', + }, JSON: { contacts: { first_name: 'John', @@ -77,6 +88,7 @@ export const configuration: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -87,8 +99,9 @@ export const configuration: ProcessorTestData[] = [ output: transformResultBuilder({ method: 'DELETE', userId: '', - endpoint: 'http://abc.com/contacts/john.doe@example.com/', + endpoint: 'http://abc.com/contacts/john.doe%40example.com', headers: { + 'Content-Type': 'application/json', 'x-api-key': 'test-api-key', }, }), @@ -122,6 +135,7 @@ export const configuration: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -134,9 +148,10 @@ export const configuration: ProcessorTestData[] = [ userId: '', endpoint: destinations[1].Config.apiUrl, headers: { - Authorization: 'Basic dGVzdC11c2VyOg==', + 'Content-Type': 'application/json', + Authorization: authHeader1, h1: 'val1', - h2: 2, + h2: '2', 'content-type': 'application/json', }, params: { @@ -175,6 +190,7 @@ export const configuration: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -187,13 +203,378 @@ export const configuration: ProcessorTestData[] = [ userId: '', endpoint: destinations[4].Config.apiUrl, headers: { - Authorization: 'Bearer test-token', + 'Content-Type': 'application/xml', + Authorization: authHeader2, h1: 'val1', 'content-type': 'application/json', }, XML: { payload: - 'Order CompletedUSDuserId123622c6f5d5cf86a4c77358033Cones of Dunshire40577c6f5d5cf86a4c7735ba03Five Crowns5', + 'Order CompletedUSDuserId123622c6f5d5cf86a4c77358033Cones of Dunshire40577c6f5d5cf86a4c7735ba03Five Crowns5', + }, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-5', + name: destType, + description: 'Track call with pathParams mapping', + scenario: 'Business', + successCriteria: 'Response should have the give paths added in the endpoint', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: destinations[7], + message: { + type: 'track', + userId: 'userId123', + event: 'Order Completed', + properties, + }, + metadata: generateMetadata(1), + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'GET', + userId: '', + endpoint: 'http://abc.com/contacts/userId123/c1', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + h1: 'val1', + h2: '2', + 'content-type': 'application/json', + }, + params: { + q1: 'val1', + }, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-6', + name: destType, + description: 'Track call with query params keys containing space', + scenario: 'Business', + successCriteria: 'Response should contain query params with URI encoded keys', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: destinations[8], + message: { + type: 'track', + userId: 'userId123', + event: 'Order Completed', + properties, + }, + metadata: generateMetadata(1), + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'GET', + userId: '', + endpoint: 'http://abc.com/contacts/userId123/c1', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + h1: 'val1', + h2: '2', + 'content-type': 'application/json', + }, + params: { + 'user%20name': 'val1', + }, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-7', + name: destType, + description: 'Identify call with properties mapping and form format with nested objects', + scenario: 'Business', + successCriteria: 'Response should be in form format with nested objects stringified', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: destinations[13], + message: { + type: 'identify', + userId: 'userId123', + anonymousId: 'anonId123', + traits, + }, + metadata: generateMetadata(1), + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + userId: '', + endpoint: destinations[13].Config.apiUrl, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + FORM: { + contacts: JSON.stringify({ + first_name: 'John', + email: 'john.doe@example.com', + address: { pin_code: '123456' }, + }), + }, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-8', + name: destType, + description: + 'Track call with bearer token, form format, post method, additional headers and properties mapping', + scenario: 'Business', + successCriteria: + 'Response should be in form format with post method, headers and properties mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + destination: destinations[10], + message: { + type: 'track', + userId: 'userId123', + event: 'Order Completed', + properties, + }, + metadata: generateMetadata(1), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + userId: '', + endpoint: destinations[10].Config.apiUrl, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: authHeader2, + h1: 'val1', + 'content-type': 'application/json', + }, + FORM: { + currency: 'USD', + event: 'Order Completed', + userId: 'userId123', + }, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-9', + name: destType, + description: 'Track call with bearer token, form url encoded format', + scenario: 'Business', + successCriteria: + 'Response should be in form format with post method, headers and properties mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + destination: destinations[11], + message: { + type: 'track', + userId: 'userId123', + event: 'Order Completed', + properties, + }, + metadata: generateMetadata(1), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + userId: '', + endpoint: destinations[11].Config.apiUrl, + headers: { + Authorization: authHeader2, + h1: 'val1', + 'Content-Type': 'application/x-www-form-urlencoded', + }, + FORM: { + currency: 'USD', + event: 'Order Completed', + userId: 'userId123', + }, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-10', + name: destType, + description: 'empty body', + scenario: 'Business', + successCriteria: + 'Response should be in form format with post method, headers and properties mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + destination: destinations[12], + message: {}, + metadata: generateMetadata(1), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + userId: '', + endpoint: destinations[12].Config.apiUrl, + headers: { + Authorization: authHeader2, + h1: 'val1', + 'Content-Type': 'application/x-www-form-urlencoded', + }, + FORM: {}, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-11', + name: destType, + description: 'Identify call with default properties mapping', + scenario: 'Business', + successCriteria: 'Response should be in json format with default properties mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: destinations[14], + message: { + type: 'identify', + userId: 'userId123', + anonymousId: 'anonId123', + }, + metadata: generateMetadata(1), + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + userId: '', + endpoint: destinations[14].Config.apiUrl, + headers: { + 'Content-Type': 'application/json', + }, + JSON: { + type: 'identify', + userId: 'userId123', + anonymousId: 'anonId123', }, }), statusCode: 200, diff --git a/test/integrations/destinations/http/router/data.ts b/test/integrations/destinations/http/router/data.ts index ea14ec73418..1a762e84f13 100644 --- a/test/integrations/destinations/http/router/data.ts +++ b/test/integrations/destinations/http/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { generateMetadata } from '../../../testUtils'; import { destType, destinations, traits, properties } from '../common'; @@ -182,9 +183,10 @@ export const data = [ version: '1', type: 'REST', method: 'GET', - endpoint: 'http://abc.com/contacts/john.doe@example.com/', + endpoint: 'http://abc.com/contacts/john.doe%40example.com', headers: { 'x-api-key': 'test-api-key', + 'Content-Type': 'application/json', }, params: {}, body: { @@ -233,15 +235,16 @@ export const data = [ method: 'GET', endpoint: 'http://abc.com/contacts', headers: { - Authorization: 'Basic dGVzdC11c2VyOg==', + 'Content-Type': 'application/json', + Authorization: authHeader1, 'content-type': 'application/json', h1: 'val1', - h2: 2, + h2: '2', h3: 'John', }, params: { q1: 'val1', - q2: 'john.doe@example.com', + q2: 'john.doe%40example.com', }, body: { JSON: {}, @@ -265,15 +268,16 @@ export const data = [ method: 'GET', endpoint: 'http://abc.com/contacts', headers: { - Authorization: 'Basic dGVzdC11c2VyOg==', + 'Content-Type': 'application/json', + Authorization: authHeader1, 'content-type': 'application/json', h1: 'val1', - h2: 2, + h2: '2', h3: 'John', }, params: { q1: 'val1', - q2: 'john.doe@example.com', + q2: 'john.doe%40example.com', }, body: { JSON: {}, @@ -297,15 +301,16 @@ export const data = [ method: 'GET', endpoint: 'http://abc.com/contacts', headers: { - Authorization: 'Basic dGVzdC11c2VyOg==', + 'Content-Type': 'application/json', + Authorization: authHeader1, 'content-type': 'application/json', h1: 'val1', - h2: 2, + h2: '2', h3: 'Alex', }, params: { q1: 'val1', - q2: 'alex.t@example.com', + q2: 'alex.t%40example.com', }, body: { JSON: {}, @@ -355,13 +360,45 @@ export const data = [ endpoint: 'http://abc.com/events', params: {}, headers: { + 'Content-Type': 'application/json', 'content-type': 'application/json', }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Product Viewed","userId":"userId1","properties":{"items":[]}},{"event":"Order Completed","currency":"USD","userId":"userId2","properties":{"items":[{"item_id":"622c6f5d5cf86a4c77358033","name":"Cones of Dunshire","price":40},{"item_id":"577c6f5d5cf86a4c7735ba03","name":"Five Crowns","price":5}]}},{"event":"Product Added","currency":"USD","userId":"userId3","properties":{"items":[{"item_id":"622c6f5d5cf86a4c77358033","name":"Cones of Dunshire","price":40},{"item_id":"577c6f5d5cf86a4c7735ba03","name":"Five Crowns","price":5}]}}]', + batch: JSON.stringify([ + { event: 'Product Viewed', userId: 'userId1', properties: { items: [] } }, + { + event: 'Order Completed', + currency: 'USD', + userId: 'userId2', + properties: { + items: [ + { + item_id: '622c6f5d5cf86a4c77358033', + name: 'Cones of Dunshire', + price: 40, + }, + { item_id: '577c6f5d5cf86a4c7735ba03', name: 'Five Crowns', price: 5 }, + ], + }, + }, + { + event: 'Product Added', + currency: 'USD', + userId: 'userId3', + properties: { + items: [ + { + item_id: '622c6f5d5cf86a4c77358033', + name: 'Cones of Dunshire', + price: 40, + }, + { item_id: '577c6f5d5cf86a4c7735ba03', name: 'Five Crowns', price: 5 }, + ], + }, + }, + ]), }, XML: {}, FORM: {}, @@ -409,6 +446,7 @@ export const data = [ method: 'POST', endpoint: 'http://abc.com/contacts/1234567890', headers: { + 'Content-Type': 'application/json', 'content-type': 'application/json', key: 'value1', }, @@ -433,6 +471,7 @@ export const data = [ method: 'POST', endpoint: 'http://abc.com/contacts/1234567890', headers: { + 'Content-Type': 'application/json', 'content-type': 'application/json', }, params: {}, @@ -456,6 +495,7 @@ export const data = [ method: 'POST', endpoint: 'http://abc.com/contacts/2234567890', headers: { + 'Content-Type': 'application/json', 'content-type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/impact/maskedSecrets.ts b/test/integrations/destinations/impact/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/impact/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/impact/processor/data.ts b/test/integrations/destinations/impact/processor/data.ts index 0841f44c623..a33f38e4792 100644 --- a/test/integrations/destinations/impact/processor/data.ts +++ b/test/integrations/destinations/impact/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'impact', @@ -50,8 +51,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -122,7 +123,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', endpoint: 'https://trkapi.impact.com/PageLoad', @@ -185,8 +186,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -294,7 +295,7 @@ export const data = [ destination: { Config: { accountSID: '', - apiKey: 'fghsdfgegvcergfvfdfsag', + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -627,8 +628,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -704,10 +705,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -777,8 +778,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -850,10 +851,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -925,8 +926,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1008,10 +1009,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -1083,8 +1084,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1162,10 +1163,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -1240,8 +1241,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1323,10 +1324,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -1401,8 +1402,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1484,10 +1485,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -1547,8 +1548,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1619,7 +1620,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', endpoint: 'https://trkapi.impact.com/PageLoad', @@ -1682,8 +1683,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1754,7 +1755,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', endpoint: 'https://trkapi.impact.com/PageLoad', @@ -1827,8 +1828,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1945,8 +1946,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -2059,8 +2060,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -2138,10 +2139,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -2216,8 +2217,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -2298,10 +2299,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -2348,10 +2349,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, diff --git a/test/integrations/destinations/impact/router/data.ts b/test/integrations/destinations/impact/router/data.ts index e9120ae03dd..894c62f4f30 100644 --- a/test/integrations/destinations/impact/router/data.ts +++ b/test/integrations/destinations/impact/router/data.ts @@ -1,6 +1,7 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { - name: 'fb', + name: 'impact', description: 'Test 0', feature: 'router', module: 'destination', @@ -12,8 +13,8 @@ export const data = [ { destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -99,8 +100,8 @@ export const data = [ metadata: { jobId: 2, userId: 'u1' }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -156,8 +157,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', endpoint: 'https://trkapi.impact.com/PageLoad', @@ -167,8 +167,8 @@ export const data = [ statusCode: 200, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -220,11 +220,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, }, ], metadata: [{ jobId: 2, userId: 'u1' }], @@ -232,8 +231,8 @@ export const data = [ statusCode: 200, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', diff --git a/test/integrations/destinations/intercom/dataDelivery/business.ts b/test/integrations/destinations/intercom/dataDelivery/business.ts index 05ac63147d1..8a4591ca776 100644 --- a/test/integrations/destinations/intercom/dataDelivery/business.ts +++ b/test/integrations/destinations/intercom/dataDelivery/business.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2 } from '../maskedSecrets'; import { generateMetadata, generateProxyV0Payload, @@ -6,7 +7,7 @@ import { const commonHeaders = { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -14,7 +15,7 @@ const commonHeaders = { const unauthorizedResponseHeaders = { 'Content-Type': 'application/json', - Authorization: 'Bearer invalidApiKey', + Authorization: authHeader2, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -387,8 +388,11 @@ export const testScenariosForV1API = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request123","errors":[{"code":"unauthorized","message":"Access Token Invalid"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request123', + errors: [{ code: 'unauthorized', message: 'Access Token Invalid' }], + }), metadata: generateMetadata(1), statusCode: 401, }, @@ -471,8 +475,11 @@ export const testScenariosForV1API = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request124","errors":[{"code":"api_plan_restricted","message":"Active subscription needed."}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request124', + errors: [{ code: 'api_plan_restricted', message: 'Active subscription needed.' }], + }), metadata: generateMetadata(1), statusCode: 403, }, @@ -512,8 +519,16 @@ export const testScenariosForV1API = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request125","errors":[{"code":"rate_limit_exceeded","message":"The rate limit for the App has been exceeded"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request125', + errors: [ + { + code: 'rate_limit_exceeded', + message: 'The rate limit for the App has been exceeded', + }, + ], + }), metadata: generateMetadata(1), statusCode: 429, }, @@ -557,8 +572,16 @@ export const testScenariosForV1API = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request126","errors":[{"code":"conflict","message":"A contact matching those details already exists with id=test1"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request126', + errors: [ + { + code: 'conflict', + message: 'A contact matching those details already exists with id=test1', + }, + ], + }), metadata: generateMetadata(1), statusCode: 409, }, @@ -602,8 +625,15 @@ export const testScenariosForV1API = [ message: 'Request Processed Successfully', response: [ { - error: - '{"errors":[{"code":"media_type_not_acceptable","message":"The Accept header should send a media type of application/json"}],"type":"error.list"}', + error: JSON.stringify({ + errors: [ + { + code: 'media_type_not_acceptable', + message: 'The Accept header should send a media type of application/json', + }, + ], + type: 'error.list', + }), metadata: generateMetadata(1), statusCode: 406, }, diff --git a/test/integrations/destinations/intercom/dataDelivery/other.ts b/test/integrations/destinations/intercom/dataDelivery/other.ts index 47690776278..4c77bd0ce30 100644 --- a/test/integrations/destinations/intercom/dataDelivery/other.ts +++ b/test/integrations/destinations/intercom/dataDelivery/other.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { ProxyV1TestData } from '../../../testTypes'; import { generateMetadata, @@ -7,7 +8,7 @@ import { const commonHeaders = { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -245,8 +246,16 @@ export const otherScenariosV1: ProxyV1TestData[] = [ '[Intercom Response Handler] Request failed for destination intercom with status: 408', response: [ { - error: - '{"type":"error.list","request_id":"000on04msi4jpk7d3u60","errors":[{"code":"Request Timeout","message":"The server would not wait any longer for the client"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: '000on04msi4jpk7d3u60', + errors: [ + { + code: 'Request Timeout', + message: 'The server would not wait any longer for the client', + }, + ], + }), metadata: generateMetadata(1), statusCode: 500, }, @@ -288,8 +297,16 @@ export const otherScenariosV1: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request127","errors":[{"code":"service_unavailable","message":"Sorry, the API service is temporarily unavailable"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request127', + errors: [ + { + code: 'service_unavailable', + message: 'Sorry, the API service is temporarily unavailable', + }, + ], + }), metadata: generateMetadata(1), statusCode: 503, }, @@ -329,8 +346,11 @@ export const otherScenariosV1: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request128","errors":[{"code":"client_error","message":"Unknown server error"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request128', + errors: [{ code: 'client_error', message: 'Unknown server error' }], + }), metadata: generateMetadata(1), statusCode: 500, }, @@ -370,8 +390,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request129","errors":[{"code":"server_timeout","message":"Server timed out when making request"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request129', + errors: [ + { code: 'server_timeout', message: 'Server timed out when making request' }, + ], + }), metadata: generateMetadata(1), statusCode: 504, }, diff --git a/test/integrations/destinations/intercom/deleteUsers/data.ts b/test/integrations/destinations/intercom/deleteUsers/data.ts index 58285ee683e..2fe1c785dd5 100644 --- a/test/integrations/destinations/intercom/deleteUsers/data.ts +++ b/test/integrations/destinations/intercom/deleteUsers/data.ts @@ -1,3 +1,4 @@ +import { secret1 } from '../maskedSecrets'; export const data = [ { name: 'intercom', @@ -19,7 +20,7 @@ export const data = [ }, ], config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, ], @@ -57,7 +58,7 @@ export const data = [ }, ], config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, ], diff --git a/test/integrations/destinations/intercom/maskedSecrets.ts b/test/integrations/destinations/intercom/maskedSecrets.ts new file mode 100644 index 00000000000..935d0e6d37e --- /dev/null +++ b/test/integrations/destinations/intercom/maskedSecrets.ts @@ -0,0 +1,10 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; +export const authHeader3 = `Bearer ${secret3}`; +export const authHeader4 = `Bearer ${secret4}`; diff --git a/test/integrations/destinations/intercom/network.ts b/test/integrations/destinations/intercom/network.ts index 0a86ce3c897..c2e6ae80f2d 100644 --- a/test/integrations/destinations/intercom/network.ts +++ b/test/integrations/destinations/intercom/network.ts @@ -1,12 +1,13 @@ +import { authHeader1, authHeader2, authHeader3 } from './maskedSecrets'; const commonHeaders = { Accept: 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const v0VersionHeaders = { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -14,7 +15,7 @@ const v0VersionHeaders = { const v1VersionHeaders = { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '2.10', 'User-Agent': 'RudderStack', @@ -45,7 +46,7 @@ const companyPayload = { const v1Headers = { 'Content-Type': 'application/json', - Authorization: 'Bearer abcd=', + Authorization: authHeader3, Accept: 'application/json', 'Intercom-Version': '1.4', }; @@ -434,7 +435,7 @@ const deliveryCallsData = [ }, headers: { Accept: 'application/json', - Authorization: 'Bearer invalidApiKey', + Authorization: authHeader2, 'Content-Type': 'application/json', }, }, @@ -529,7 +530,7 @@ const deliveryCallsData = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer invalidApiKey', + Authorization: authHeader2, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', diff --git a/test/integrations/destinations/intercom/processor/groupTestData.ts b/test/integrations/destinations/intercom/processor/groupTestData.ts index f87da349650..dd282a14cda 100644 --- a/test/integrations/destinations/intercom/processor/groupTestData.ts +++ b/test/integrations/destinations/intercom/processor/groupTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader3, secret3 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { generateMetadata, @@ -6,14 +7,14 @@ import { } from '../../../testUtils'; const v1Config = { - apiKey: 'abcd=', + apiKey: secret3, appId: 'asdasdasd', apiVersion: 'v1', collectContext: false, }; const v2Config = { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v2', apiServer: 'standard', sendAnonymousId: false, @@ -21,7 +22,7 @@ const v2Config = { const v1Headers = { 'Content-Type': 'application/json', - Authorization: 'Bearer abcd=', + Authorization: authHeader3, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -29,7 +30,7 @@ const v1Headers = { const v2Headers = { Accept: 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', 'Intercom-Version': '2.10', 'User-Agent': 'RudderStack', diff --git a/test/integrations/destinations/intercom/processor/identifyTestData.ts b/test/integrations/destinations/intercom/processor/identifyTestData.ts index f078536b30a..24666b42a19 100644 --- a/test/integrations/destinations/intercom/processor/identifyTestData.ts +++ b/test/integrations/destinations/intercom/processor/identifyTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader4, secret4 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { generateMetadata, @@ -6,14 +7,14 @@ import { } from '../../../testUtils'; const v1Config = { - apiKey: 'intercomApiKey', + apiKey: secret4, apiVersion: 'v1', appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0', collectContext: false, }; const v2Config = { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v2', apiServer: 'standard', sendAnonymousId: false, @@ -21,7 +22,7 @@ const v2Config = { const v2Headers = { Accept: 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', 'Intercom-Version': '2.10', 'User-Agent': 'RudderStack', @@ -29,7 +30,7 @@ const v2Headers = { const v1Headers = { 'Content-Type': 'application/json', - Authorization: 'Bearer intercomApiKey', + Authorization: authHeader4, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -234,7 +235,7 @@ const expectedUser6Traits = { company_id: 'company_id', custom_attributes: { key1: 'value1', - key2: '{"a":"a"}', + key2: JSON.stringify({ a: 'a' }), key3: '[1,2,3]', }, }, @@ -711,8 +712,8 @@ export const identifyTestData = [ ...expectedUser6Traits.companies[0], custom_attributes: { key1: 'value1', - key3: '["value1","value2"]', - key4: '{"foo":"bar"}', + key3: JSON.stringify(['value1', 'value2']), + key4: JSON.stringify({ foo: 'bar' }), }, company_id: 'c0277b5c814453e5135f515f943d085a', }, diff --git a/test/integrations/destinations/intercom/processor/trackTestData.ts b/test/integrations/destinations/intercom/processor/trackTestData.ts index b0878cc79d5..639a551c8ac 100644 --- a/test/integrations/destinations/intercom/processor/trackTestData.ts +++ b/test/integrations/destinations/intercom/processor/trackTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader4, secret4 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { generateMetadata, @@ -6,14 +7,14 @@ import { } from '../../../testUtils'; const v1Config = { - apiKey: 'intercomApiKey', + apiKey: secret4, apiVersion: 'v1', appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0', collectContext: false, }; const v2Config = { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v2', apiServer: 'standard', sendAnonymousId: false, @@ -21,7 +22,7 @@ const v2Config = { const v1Headers = { 'Content-Type': 'application/json', - Authorization: 'Bearer intercomApiKey', + Authorization: authHeader4, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -29,7 +30,7 @@ const v1Headers = { const v2Headers = { Accept: 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', 'Intercom-Version': '2.10', 'User-Agent': 'RudderStack', diff --git a/test/integrations/destinations/intercom/processor/validationTestData.ts b/test/integrations/destinations/intercom/processor/validationTestData.ts index 45fe3c1b9ec..573b04dfce7 100644 --- a/test/integrations/destinations/intercom/processor/validationTestData.ts +++ b/test/integrations/destinations/intercom/processor/validationTestData.ts @@ -1,16 +1,17 @@ +import { secret1, secret2, secret4 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; const v1Config = { - apiKey: 'intercomApiKey', + apiKey: secret4, apiVersion: 'v1', appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0', collectContext: false, }; const v2Config = { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v2', apiServer: 'standard', sendAnonymousId: false, @@ -28,7 +29,7 @@ const destination: Destination = { }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v2', apiServer: 'standard', sendAnonymousId: false, @@ -108,6 +109,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -151,6 +153,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -197,6 +200,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -245,6 +249,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -293,6 +298,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -327,7 +333,7 @@ export const validationTestData: ProcessorTestData[] = [ { destination: { ...v2Destination, - Config: { ...v2Destination.Config, apiKey: 'invalidApiKey' }, + Config: { ...v2Destination.Config, apiKey: secret2 }, }, message: { userId: 'user@3', @@ -353,6 +359,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -360,8 +367,38 @@ export const validationTestData: ProcessorTestData[] = [ status: 200, body: [ { - error: - '{"message":"{\\"message\\":\\"Unable to search contact due to : [{\\\\\\"code\\\\\\":\\\\\\"unauthorized\\\\\\",\\\\\\"message\\\\\\":\\\\\\"Access Token Invalid\\\\\\"}]: Workflow: procWorkflow, Step: searchContact, ChildStep: undefined, OriginalError: Unable to search contact due to : [{\\\\\\"code\\\\\\":\\\\\\"unauthorized\\\\\\",\\\\\\"message\\\\\\":\\\\\\"Access Token Invalid\\\\\\"}]\\",\\"destinationResponse\\":{\\"response\\":{\\"type\\":\\"error.list\\",\\"request_id\\":\\"request_1\\",\\"errors\\":[{\\"code\\":\\"unauthorized\\",\\"message\\":\\"Access Token Invalid\\"}]},\\"status\\":401}}","destinationResponse":{"response":{"type":"error.list","request_id":"request_1","errors":[{"code":"unauthorized","message":"Access Token Invalid"}]},"status":401}}', + error: JSON.stringify({ + message: JSON.stringify({ + message: + 'Unable to search contact due to : [{"code":"unauthorized","message":"Access Token Invalid"}]: Workflow: procWorkflow, Step: searchContact, ChildStep: undefined, OriginalError: Unable to search contact due to : [{"code":"unauthorized","message":"Access Token Invalid"}]', + destinationResponse: { + response: { + type: 'error.list', + request_id: 'request_1', + errors: [ + { + code: 'unauthorized', + message: 'Access Token Invalid', + }, + ], + }, + status: 401, + }, + }), + destinationResponse: { + response: { + type: 'error.list', + request_id: 'request_1', + errors: [ + { + code: 'unauthorized', + message: 'Access Token Invalid', + }, + ], + }, + status: 401, + }, + }), statTags: { ...expectedStatTags, errorCategory: 'network', errorType: 'aborted' }, statusCode: 401, metadata: generateMetadata(1), @@ -397,6 +434,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -447,6 +485,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -490,6 +529,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -534,6 +574,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/intercom/router/data.ts b/test/integrations/destinations/intercom/router/data.ts index cc89d3f1e2d..e5bc766c76d 100644 --- a/test/integrations/destinations/intercom/router/data.ts +++ b/test/integrations/destinations/intercom/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination, RouterTransformationRequest } from '../../../../../src/types'; import { RouterTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; @@ -14,7 +15,7 @@ const destination1: Destination = { }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiServer: 'standard', apiVersion: 'v2', sendAnonymousId: false, @@ -37,7 +38,7 @@ const destination2: Destination = { }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiServer: 'standard', apiVersion: 'v2', sendAnonymousId: false, @@ -60,7 +61,7 @@ const destination3: Destination = { }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v2', apiServer: 'eu', sendAnonymousId: false, @@ -82,7 +83,7 @@ const destination4: Destination = { }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v1', sendAnonymousId: false, updateLastRequestAt: false, @@ -105,7 +106,7 @@ const destination5: Destination = { }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v1', sendAnonymousId: false, collectContext: false, @@ -125,7 +126,7 @@ const destination6: Destination = { Config: {}, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v1', sendAnonymousId: false, updateLastRequestAt: false, @@ -146,7 +147,7 @@ const destination7: Destination = { Config: {}, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v1', sendAnonymousId: false, collectContext: false, @@ -812,6 +813,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest1, + method: 'POST', }, }, output: { @@ -841,7 +843,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.intercom.io/contacts', files: {}, headers: { - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', 'Intercom-Version': '2.10', @@ -884,7 +886,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.intercom.io/events', files: {}, headers: { - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', 'Intercom-Version': '2.10', @@ -913,7 +915,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.eu.intercom.io/contacts/70701240741e45d040/companies', files: {}, headers: { - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', 'Intercom-Version': '2.10', @@ -942,7 +944,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.eu.intercom.io/contacts/70701240741e45d040/companies', files: {}, headers: { - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', 'Intercom-Version': '2.10', @@ -993,6 +995,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest2, + method: 'POST', }, }, output: { @@ -1008,7 +1011,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.intercom.io/users', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -1048,7 +1051,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.intercom.io/users', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -1100,7 +1103,7 @@ export const data: RouterTestData[] = [ files: {}, headers: { Accept: 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -1130,7 +1133,7 @@ export const data: RouterTestData[] = [ files: {}, headers: { Accept: 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -1153,7 +1156,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.intercom.io/users', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -1212,6 +1215,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest4, + method: 'POST', }, }, output: { @@ -1241,7 +1245,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.eu.intercom.io/contacts/70701240741e45d040', files: {}, headers: { - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', 'Intercom-Version': '2.10', diff --git a/test/integrations/destinations/intercom_v2/common.ts b/test/integrations/destinations/intercom_v2/common.ts index 60c7e02b330..e396d381e47 100644 --- a/test/integrations/destinations/intercom_v2/common.ts +++ b/test/integrations/destinations/intercom_v2/common.ts @@ -1,4 +1,6 @@ +import { authHeader1 } from './maskedSecrets'; import { Destination } from '../../../../src/types'; +import { defaultAccessToken } from '../../common/secrets'; const destTypeInUpperCase = 'INTERCOM_V2'; const channel = 'web'; @@ -103,7 +105,7 @@ const properties = { }; const headers = { - Authorization: 'Bearer default-accessToken', + Authorization: `Bearer ${defaultAccessToken}`, Accept: 'application/json', 'Content-Type': 'application/json', 'Intercom-Version': '2.10', @@ -111,7 +113,7 @@ const headers = { const headersWithRevokedAccessToken = { ...headers, - Authorization: 'Bearer revoked-accessToken', + Authorization: authHeader1, }; const RouterInstrumentationErrorStatTags = { diff --git a/test/integrations/destinations/intercom_v2/dataDelivery/business.ts b/test/integrations/destinations/intercom_v2/dataDelivery/business.ts index c75993bc7a7..0870839e9d9 100644 --- a/test/integrations/destinations/intercom_v2/dataDelivery/business.ts +++ b/test/integrations/destinations/intercom_v2/dataDelivery/business.ts @@ -360,8 +360,16 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"errors":[{"code":"rate_limit_exceeded","message":"The rate limit for the App has been exceeded"}],"request_id":"request125","type":"error.list"}', + error: JSON.stringify({ + errors: [ + { + code: 'rate_limit_exceeded', + message: 'The rate limit for the App has been exceeded', + }, + ], + request_id: 'request125', + type: 'error.list', + }), statusCode: 429, metadata: generateMetadata(1), }, @@ -404,8 +412,16 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"errors":[{"code":"conflict","message":"A contact matching those details already exists with id=test"}],"request_id":"request126","type":"error.list"}', + error: JSON.stringify({ + errors: [ + { + code: 'conflict', + message: 'A contact matching those details already exists with id=test', + }, + ], + request_id: 'request126', + type: 'error.list', + }), statusCode: 409, metadata: generateMetadata(1), }, @@ -452,8 +468,15 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"errors":[{"code":"media_type_not_acceptable","message":"The Accept header should send a media type of application/json"}],"type":"error.list"}', + error: JSON.stringify({ + errors: [ + { + code: 'media_type_not_acceptable', + message: 'The Accept header should send a media type of application/json', + }, + ], + type: 'error.list', + }), statusCode: 406, metadata: generateMetadata(1), }, @@ -501,8 +524,16 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ '[Intercom V2 Response Handler] Request failed for destination intercom_v2 with status: 408', response: [ { - error: - '{"type":"error.list","request_id":"req-123","errors":[{"code":"Request Timeout","message":"The server would not wait any longer for the client"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'req-123', + errors: [ + { + code: 'Request Timeout', + message: 'The server would not wait any longer for the client', + }, + ], + }), metadata: generateMetadata(1), statusCode: 500, }, diff --git a/test/integrations/destinations/intercom_v2/dataDelivery/oauth.ts b/test/integrations/destinations/intercom_v2/dataDelivery/oauth.ts index 8f36a4bd55f..963d2d061d8 100644 --- a/test/integrations/destinations/intercom_v2/dataDelivery/oauth.ts +++ b/test/integrations/destinations/intercom_v2/dataDelivery/oauth.ts @@ -1,3 +1,4 @@ +import { secret1 } from '../maskedSecrets'; import { ProxyV1TestData } from '../../../testTypes'; import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { headers, headersWithRevokedAccessToken, RouterNetworkErrorStatTags } from '../common'; @@ -38,7 +39,7 @@ export const oauthScenariosV0 = [ body: generateProxyV1Payload({ ...commonRequestParameters, headers: headersWithRevokedAccessToken, - accessToken: 'revoked-accessToken', + accessToken: secret1, }), method: 'POST', }, @@ -122,7 +123,7 @@ export const oauthScenariosV1: ProxyV1TestData[] = [ body: generateProxyV1Payload({ ...commonRequestParameters, headers: headersWithRevokedAccessToken, - accessToken: 'revoked-accessToken', + accessToken: secret1, }), method: 'POST', }, @@ -134,12 +135,15 @@ export const oauthScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"type":"error.list","request_id":"request_id-1","errors":[{"code":"unauthorized","message":"Access Token Invalid"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request_id-1', + errors: [{ code: 'unauthorized', message: 'Access Token Invalid' }], + }), statusCode: 400, metadata: { ...generateMetadata(1), - secret: { accessToken: 'revoked-accessToken' }, + secret: { accessToken: secret1 }, }, }, ], diff --git a/test/integrations/destinations/intercom_v2/maskedSecrets.ts b/test/integrations/destinations/intercom_v2/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/intercom_v2/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/intercom_v2/router/data.ts b/test/integrations/destinations/intercom_v2/router/data.ts index 75f5ba6ae7b..3a871ca1588 100644 --- a/test/integrations/destinations/intercom_v2/router/data.ts +++ b/test/integrations/destinations/intercom_v2/router/data.ts @@ -1,4 +1,5 @@ -import { RouterTransformationRequest } from '../../../../../src/types'; +import { secret1 } from '../maskedSecrets'; +import { MessageType, RouterTransformationRequest, RudderMessage } from '../../../../../src/types'; import { generateMetadata } from '../../../testUtils'; import { anonymousId, @@ -112,7 +113,7 @@ const routerRequest1: RouterTransformationRequest = { metadata: { ...generateMetadata(5), secret: { - accessToken: 'revoked-accessToken', + accessToken: secret1, }, }, }, @@ -399,7 +400,7 @@ const routerRequest5: RouterTransformationRequest = { ...companyTraits, }, }, - type: 'dummyGroupType', + type: 'dummyGroupType' as MessageType, integrations: { All: true }, originalTimestamp, timestamp, @@ -424,6 +425,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest1, + method: 'POST', }, }, output: { @@ -542,8 +544,19 @@ export const data: RouterTestData[] = [ }, { batched: false, - error: - '{"message":"Unable to search contact due to","destinationResponse":"{\\"type\\":\\"error.list\\",\\"request_id\\":\\"request_id-1\\",\\"errors\\":[{\\"code\\":\\"unauthorized\\",\\"message\\":\\"Access Token Invalid\\"}]}"}', + error: JSON.stringify({ + message: 'Unable to search contact due to', + destinationResponse: JSON.stringify({ + type: 'error.list', + request_id: 'request_id-1', + errors: [ + { + code: 'unauthorized', + message: 'Access Token Invalid', + }, + ], + }), + }), statTags: { ...RouterNetworkErrorStatTags, errorType: 'retryable', @@ -554,7 +567,7 @@ export const data: RouterTestData[] = [ { ...generateMetadata(5), secret: { - accessToken: 'revoked-accessToken', + accessToken: secret1, }, }, ], @@ -589,6 +602,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest2, + method: 'POST', }, }, output: { @@ -682,6 +696,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest3, + method: 'POST', }, }, output: { @@ -807,6 +822,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest4, + method: 'POST', }, }, output: { @@ -881,6 +897,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest5, + method: 'POST', }, }, output: { @@ -945,6 +962,7 @@ export const data: RouterTestData[] = [ input: { request: { body: rETLRecordV2RouterRequest, + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/iterable/dataDelivery/business.ts b/test/integrations/destinations/iterable/dataDelivery/business.ts new file mode 100644 index 00000000000..5e62b164fc4 --- /dev/null +++ b/test/integrations/destinations/iterable/dataDelivery/business.ts @@ -0,0 +1,838 @@ +import { ProxyV1TestData } from '../../../testTypes'; +import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; +import { + correctIdentifyData, + correctTrackData, + headerBlockWithCorrectAccessToken, + partiallyCorrectIdentifyData, + partiallyCorrectTrackData, + wrongIdentifyData, + wrongTrackData, +} from './network'; +import { defaultAccessToken } from '../../../common/secrets'; + +export const statTags = { + destType: 'ITERABLE', + errorCategory: 'network', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', +}; + +export const metadata = [generateMetadata(1), generateMetadata(2)]; + +export const singleMetadata = [ + { + jobId: 1, + attemptNum: 1, + userId: 'default-userId', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + sourceId: 'default-sourceId', + secret: { + accessToken: defaultAccessToken, + }, + dontBatch: false, + }, +]; + +export const singleTrackPayload = { + email: 'sayan@gmail.com', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + id: '1234', + createdAt: 1598631966468, + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + campaignId: 0, + templateId: 0, + createNewFields: true, +}; + +export const updateEmailData = { + currentEmail: 'sayan', + currentUserId: 'abcdeeeeeeeexxxx102', + newEmail: 'sayan@gmail.com', +}; + +export const testScenariosForV1API: ProxyV1TestData[] = [ + { + id: 'ITERABLE_v1_other_scenario_1', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test correct Payload Response Handling from Destination', + successCriteria: 'Should return 200 status code with success', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: correctTrackData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/events/trackBulk', + }, + metadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse: { + status: 200, + response: { + createdFields: [], + disallowedEventNames: [], + failCount: 0, + failedUpdates: { + forgottenEmails: [], + forgottenUserIds: [], + invalidEmails: [], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + }, + filteredOutFields: [], + invalidEmails: [], + invalidUserIds: [], + successCount: 2, + }, + }, + response: [ + { + statusCode: 200, + metadata: generateMetadata(1), + error: 'success', + }, + { + statusCode: 200, + metadata: generateMetadata(2), + error: 'success', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_2', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test Malformed Payload Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: wrongTrackData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/events/trackBulk', + }, + metadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 400, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. {"obj.events[1].createdAt":"Number value expected"}', + response: [ + { + statusCode: 400, + metadata: generateMetadata(1), + error: JSON.stringify({ + msg: '[/api/events/trackBulk] Invalid JSON body', + code: 'BadJsonBody', + params: { 'obj.events[1].createdAt': 'Number value expected' }, + }), + }, + { + statusCode: 400, + metadata: generateMetadata(2), + error: JSON.stringify({ + msg: '[/api/events/trackBulk] Invalid JSON body', + code: 'BadJsonBody', + params: { 'obj.events[1].createdAt': 'Number value expected' }, + }), + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_3', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test partially successful Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: partiallyCorrectTrackData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/events/trackBulk', + }, + metadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse: { + status: 200, + response: { + successCount: 1, + failCount: 1, + invalidEmails: ['sayan'], + invalidUserIds: [], + disallowedEventNames: [], + filteredOutFields: [], + createdFields: [], + failedUpdates: { + invalidEmails: ['sayan'], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + }, + + status: 200, + }, + }, + response: [ + { + statusCode: 400, + metadata: generateMetadata(1), + error: 'email error:"sayan" in "invalidEmails,failedUpdates.invalidEmails".', + }, + { + statusCode: 200, + metadata: generateMetadata(2), + error: 'success', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_4', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test correct identify Payload Response Handling from Destination', + successCriteria: 'Should return 200 status code with success', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: correctIdentifyData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/users/bulkUpdate', + }, + metadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse: { + status: 200, + response: { + createdFields: [], + noOpEmails: [], + noOpUserIds: [], + failCount: 0, + failedUpdates: { + conflictEmails: [], + conflictUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + invalidEmails: [], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + invalidDataEmails: [], + invalidDataUserIds: [], + }, + filteredOutFields: [], + invalidEmails: [], + invalidUserIds: [], + successCount: 2, + }, + }, + response: [ + { + statusCode: 200, + metadata: generateMetadata(1), + error: 'success', + }, + { + statusCode: 200, + metadata: generateMetadata(2), + error: 'success', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_5', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test Malformed identify Payload Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: wrongIdentifyData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/users/bulkUpdate', + }, + metadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 400, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. {"obj.users[1].preferUserId":"Boolean value expected"}', + response: [ + { + statusCode: 400, + metadata: generateMetadata(1), + error: JSON.stringify({ + msg: '[/api/users/bulkUpdate] Invalid JSON body', + code: 'BadJsonBody', + params: { 'obj.users[1].preferUserId': 'Boolean value expected' }, + }), + }, + { + statusCode: 400, + metadata: generateMetadata(2), + error: JSON.stringify({ + msg: '[/api/users/bulkUpdate] Invalid JSON body', + code: 'BadJsonBody', + params: { 'obj.users[1].preferUserId': 'Boolean value expected' }, + }), + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_6', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test partially successful identify Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: partiallyCorrectIdentifyData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/users/bulkUpdate', + }, + metadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse: { + status: 200, + response: { + successCount: 1, + failCount: 1, + invalidEmails: ['shrouti'], + invalidUserIds: [], + noOpEmails: [], + noOpUserIds: [], + filteredOutFields: [], + createdFields: [], + failedUpdates: { + invalidEmails: ['shrouti'], + conflictEmails: [], + conflictUserIds: [], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + invalidDataEmails: [], + invalidDataUserIds: [], + }, + }, + }, + response: [ + { + statusCode: 200, + metadata: generateMetadata(1), + error: 'success', + }, + { + statusCode: 400, + metadata: generateMetadata(2), + error: 'email error:"shrouti" in "invalidEmails,failedUpdates.invalidEmails".', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_7', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test partially unsuccessful updateEmail Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: updateEmailData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/users/updateEmail', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 400, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. "Invalid currentEmail sayan"', + response: [ + { + statusCode: 400, + metadata: generateMetadata(1), + error: JSON.stringify({ + msg: 'Invalid currentEmail sayan', + code: 'InvalidEmailAddressError', + params: null, + }), + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_8', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test single track correct Payload Response Handling from Destination', + successCriteria: 'Should return 200 status code with success', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: singleTrackPayload, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/events/track', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse: { + status: 200, + response: { + msg: 'Event with id: 1234 tracked.', + code: 'Success', + params: { + id: '1234', + }, + }, + }, + response: [ + { + statusCode: 200, + metadata: generateMetadata(1), + error: 'success', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_9', + name: 'iterable', + description: + '[Proxy API] :: Scenario to wrong sinle track event Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: { ...singleTrackPayload, email: 'sayan' }, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/events/track', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 400, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. "Invalid email: sayan"', + response: [ + { + statusCode: 400, + metadata: generateMetadata(1), + error: JSON.stringify({ + msg: 'Invalid email: sayan', + code: 'InvalidEmailAddressError', + params: null, + }), + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_10', + name: 'iterable', + description: + '[Proxy API] :: Scenario to wrong single track event for catalogs Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: { + documents: { + Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, + ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + }, + replaceUploadedFieldsOnly: true, + }, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/catalogs/rudder-test/items', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 404, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. "Catalog not found: rudder-test"', + response: [ + { + statusCode: 404, + metadata: generateMetadata(1), + error: JSON.stringify({ + error: 'NotFound', + message: 'Catalog not found: rudder-test', + code: 'error.catalogs.notFound', + data: { args: ['rudder-test'] }, + }), + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_11', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test catalog track correct Payload Response Handling from Destination', + successCriteria: 'Should return 200 status code with success', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: { + documents: { + Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, + ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + }, + replaceUploadedFieldsOnly: true, + }, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/catalogs/test-ruchira/items', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse: { + status: 200, + response: { + code: 'Success', + msg: 'Request to bulk-upload documents into test-ruchira processed successfully', + params: null, + }, + }, + response: [ + { + statusCode: 200, + metadata: generateMetadata(1), + error: 'success', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_12', + name: 'iterable', + description: + '[Proxy API] :: Scenario to correct device token registration event Response Handling from Destination with wrong permission', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: { + email: 'sayan@gmail.com', + device: { + token: '1234', + platform: 'APNS', + applicationName: 'rudder', + dataFields: {}, + }, + userId: 'abcdeeeeeeeexxxx102', + preferUserId: true, + }, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/users/registerDeviceToken', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 401, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. {"ip":"103.189.130.133","endpoint":"/api/users/registerDeviceToken","apiKeyIdentifier":"af831922","apiKeyType":"ServerSide"}', + response: [ + { + statusCode: 401, + metadata: generateMetadata(1), + error: JSON.stringify({ + msg: 'Disabled API key or insufficient privileges', + code: 'BadApiKey', + params: { + ip: '103.189.130.133', + endpoint: '/api/users/registerDeviceToken', + apiKeyIdentifier: 'af831922', + apiKeyType: 'ServerSide', + }, + }), + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_13', + name: 'iterable', + description: + '[Proxy API] :: Scenario to correct browser token registration event Response Handling from Destination with wrong permission', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: { + email: 'sayan@gmail.com', + browserToken: '1234567', + userId: 'abcdeeeeeeeexxxx102', + }, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/users/registerBrowserToken', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 401, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. {"ip":"103.189.130.129","endpoint":"/api/users/registerBrowserToken","apiKeyIdentifier":"af831922","apiKeyType":"ServerSide"}', + response: [ + { + statusCode: 401, + metadata: generateMetadata(1), + error: JSON.stringify({ + msg: 'Disabled API key or insufficient privileges', + code: 'BadApiKey', + params: { + ip: '103.189.130.129', + endpoint: '/api/users/registerBrowserToken', + apiKeyIdentifier: 'af831922', + apiKeyType: 'ServerSide', + }, + }), + }, + ], + }, + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/iterable/dataDelivery/data.ts b/test/integrations/destinations/iterable/dataDelivery/data.ts new file mode 100644 index 00000000000..fc969bb8e1a --- /dev/null +++ b/test/integrations/destinations/iterable/dataDelivery/data.ts @@ -0,0 +1,3 @@ +import { testScenariosForV1API } from './business'; + +export const data = [...testScenariosForV1API]; diff --git a/test/integrations/destinations/iterable/dataDelivery/network.ts b/test/integrations/destinations/iterable/dataDelivery/network.ts new file mode 100644 index 00000000000..72189581be9 --- /dev/null +++ b/test/integrations/destinations/iterable/dataDelivery/network.ts @@ -0,0 +1,575 @@ +export const headerBlockWithCorrectAccessToken = { + 'Content-Type': 'application/json', + api_key: 'DUMMY_API_KEY', +}; + +export const headerBlockWithWrongAccessToken = { + 'Content-Type': 'application/json', + api_key: 'DUMMY_WRONG_API_KEY', +}; +export const correctTrackData = { + events: [ + { + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + email: 'sayan@gmail.com', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + createdAt: 1598631966468, + }, + { + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'pradip@gmail.com', + }, + email: 'pradip@gmail.com', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + createdAt: 1598631966468, + }, + ], +}; + +export const wrongTrackData = { + events: [ + { + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + email: 'sayan', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + createdAt: 'abc', + }, + { + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'pradip@gmail.com', + }, + email: 'pradip@gmail.com', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + createdAt: 1598631966468, + }, + ], +}; + +export const partiallyCorrectTrackData = { + events: [ + { + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + email: 'sayan', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + createdAt: 1598631966468, + }, + { + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'pradip@gmail.com', + }, + email: 'pradip@gmail.com', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + createdAt: 1598631966468, + }, + ], +}; + +export const correctIdentifyData = { + users: [ + { + email: 'manashi@website.com', + dataFields: { + city: 'Bangalore', + name: 'manashi', + email: 'manashi@website.com', + country: 'India', + }, + userId: 'abcdeeeeeeeexxxx102', + preferUserId: true, + mergeNestedObjects: true, + }, + { + email: 'shrouti@website.com', + dataFields: { + city: 'Bangalore', + name: 'shrouti', + email: 'shrouti@website.com', + country: 'India', + }, + userId: 'abcdeeeegggggxxxx102', + preferUserId: true, + mergeNestedObjects: true, + }, + ], +}; + +export const wrongIdentifyData = { + users: [ + { + email: 'manashi@website.com', + dataFields: { + city: 'Bangalore', + name: 'manashi', + email: 'manashi@website.com', + country: 'India', + }, + userId: 'abcdeeeeeeeexxxx102', + preferUserId: true, + mergeNestedObjects: true, + }, + { + email: 'shrouti@website.com', + dataFields: { + city: 'Bangalore', + name: 'shrouti', + email: 'shrouti@website.com', + country: 'India', + }, + userId: 'abcdeeeegggggxxxx102', + preferUserId: 'abc', + mergeNestedObjects: true, + }, + ], +}; + +export const partiallyCorrectIdentifyData = { + users: [ + { + email: 'manashi@website.com', + dataFields: { + city: 'Bangalore', + name: 'manashi', + email: 'manashi@website.com', + country: 'India', + }, + userId: 'abcdeeeeeeeexxxx102', + preferUserId: true, + mergeNestedObjects: true, + }, + { + email: 'shrouti', + dataFields: { + city: 'Bangalore', + name: 'shrouti', + email: 'shrouti@website.com', + country: 'India', + }, + userId: 'abcdeeeegggggxxxx102', + preferUserId: true, + mergeNestedObjects: true, + }, + ], +}; + +// MOCK DATA +const businessMockData = [ + { + description: 'Mock response from destination depicting request with a correct track payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/events/trackBulk', + headers: headerBlockWithCorrectAccessToken, + data: correctTrackData, + }, + httpRes: { + data: { + successCount: 2, + failCount: 0, + invalidEmails: [], + invalidUserIds: [], + disallowedEventNames: [], + filteredOutFields: [], + createdFields: [], + failedUpdates: { + invalidEmails: [], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + }, + }, + status: 200, + statusText: 'OK', + }, + }, + { + description: + 'Mock response from destination depicting request with a partially wrong track payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/events/trackBulk', + headers: headerBlockWithCorrectAccessToken, + data: partiallyCorrectTrackData, + }, + httpRes: { + data: { + successCount: 1, + failCount: 1, + invalidEmails: ['sayan'], + invalidUserIds: [], + disallowedEventNames: [], + filteredOutFields: [], + createdFields: [], + failedUpdates: { + invalidEmails: ['sayan'], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + }, + + status: 200, + }, + status: 200, + statusText: 'OK', + }, + }, + { + description: 'Mock response from destination depicting request with a wrong data', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/events/trackBulk', + headers: headerBlockWithCorrectAccessToken, + data: wrongTrackData, + }, + httpRes: { + data: { + msg: '[/api/events/trackBulk] Invalid JSON body', + code: 'BadJsonBody', + params: { + 'obj.events[1].createdAt': 'Number value expected', + }, + }, + status: 400, + }, + }, + { + description: + 'Mock response from destination depicting request with a correct track payload but wrong API key', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/events/trackBulk', + headers: { ...headerBlockWithCorrectAccessToken, api_key: 'WRONG_API_KEY' }, + data: correctTrackData, + }, + httpRes: { + data: { + msg: 'Invalid API key', + code: 'BadApiKey', + params: { + ip: '152.58.182.124', + endpoint: '/api/events/trackBulk', + }, + }, + status: 401, + }, + }, + { + description: 'Mock response from destination depicting request with a correct Identify payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/users/bulkUpdate', + headers: headerBlockWithCorrectAccessToken, + data: correctIdentifyData, + }, + httpRes: { + data: { + successCount: 2, + failCount: 0, + invalidEmails: [], + invalidUserIds: [], + filteredOutFields: [], + createdFields: [], + noOpEmails: [], + noOpUserIds: [], + failedUpdates: { + invalidEmails: [], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + invalidDataEmails: [], + invalidDataUserIds: [], + conflictEmails: [], + conflictUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + }, + }, + status: 200, + statusText: 'OK', + }, + }, + { + description: + 'Mock response from destination depicting identify request with a partially wrong track payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/users/bulkUpdate', + headers: headerBlockWithCorrectAccessToken, + data: partiallyCorrectIdentifyData, + }, + httpRes: { + data: { + successCount: 1, + failCount: 1, + invalidEmails: ['shrouti'], + invalidUserIds: [], + filteredOutFields: [], + createdFields: [], + noOpEmails: [], + noOpUserIds: [], + failedUpdates: { + invalidEmails: ['shrouti'], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + invalidDataEmails: [], + invalidDataUserIds: [], + conflictEmails: [], + conflictUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + }, + }, + status: 200, + statusText: 'OK', + }, + }, + { + description: 'Mock response from destination depicting identify request with a wrong data', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/users/bulkUpdate', + headers: headerBlockWithCorrectAccessToken, + data: wrongIdentifyData, + }, + httpRes: { + data: { + msg: '[/api/users/bulkUpdate] Invalid JSON body', + code: 'BadJsonBody', + params: { + 'obj.users[1].preferUserId': 'Boolean value expected', + }, + }, + status: 400, + }, + }, + { + description: 'Mock response from destination depicting update email request with a wrong data', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/users/updateEmail', + headers: headerBlockWithCorrectAccessToken, + data: { + currentEmail: 'sayan', + currentUserId: 'abcdeeeeeeeexxxx102', + newEmail: 'sayan@gmail.com', + }, + }, + httpRes: { + data: { + msg: 'Invalid currentEmail sayan', + code: 'InvalidEmailAddressError', + params: null, + }, + status: 400, + }, + }, + { + description: + 'Mock response from destination depicting request with a correct single track payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/events/track', + headers: headerBlockWithCorrectAccessToken, + data: { + email: 'sayan@gmail.com', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + id: '1234', + createdAt: 1598631966468, + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + campaignId: 0, + templateId: 0, + createNewFields: true, + }, + }, + httpRes: { + data: { + msg: 'Event with id: 1234 tracked.', + code: 'Success', + params: { + id: '1234', + }, + }, + status: 200, + statusText: 'OK', + }, + }, + { + description: + 'Mock response from destination depicting request with a wrong email single track payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/events/track', + headers: headerBlockWithCorrectAccessToken, + data: { + email: 'sayan', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + id: '1234', + createdAt: 1598631966468, + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + campaignId: 0, + templateId: 0, + createNewFields: true, + }, + }, + httpRes: { + data: { + msg: 'Invalid email: sayan', + code: 'InvalidEmailAddressError', + params: null, + }, + status: 400, + }, + }, + { + description: + 'Mock response from destination depicting request with a correct catalog bulk payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/catalogs/rudder-test/items', + headers: headerBlockWithCorrectAccessToken, + data: { + documents: { + Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, + ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + }, + replaceUploadedFieldsOnly: true, + }, + }, + httpRes: { + data: { + error: 'NotFound', + message: 'Catalog not found: rudder-test', + code: 'error.catalogs.notFound', + data: { + args: ['rudder-test'], + }, + }, + status: 404, + }, + }, + { + description: + 'Mock response from destination depicting request with a correct catalog track payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/catalogs/test-ruchira/items', + headers: headerBlockWithCorrectAccessToken, + data: { + documents: { + Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, + ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + }, + replaceUploadedFieldsOnly: true, + }, + }, + httpRes: { + data: { + msg: 'Request to bulk-upload documents into test-ruchira processed successfully', + code: 'Success', + params: null, + }, + status: 200, + statusText: 'OK', + }, + }, + { + description: + 'Mock response from destination depicting request with a correct register device token payload with insufficient permission', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/users/registerDeviceToken', + headers: headerBlockWithCorrectAccessToken, + data: { + email: 'sayan@gmail.com', + device: { + token: '1234', + platform: 'APNS', + applicationName: 'rudder', + dataFields: {}, + }, + userId: 'abcdeeeeeeeexxxx102', + preferUserId: true, + }, + }, + httpRes: { + data: { + msg: 'Disabled API key or insufficient privileges', + code: 'BadApiKey', + params: { + ip: '103.189.130.133', + endpoint: '/api/users/registerDeviceToken', + apiKeyIdentifier: 'af831922', + apiKeyType: 'ServerSide', + }, + }, + status: 401, + }, + }, + { + description: + 'Mock response from destination depicting request with a correct registerbrowswer token payload with insufficient permission', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/users/registerBrowserToken', + headers: headerBlockWithCorrectAccessToken, + data: { + email: 'sayan@gmail.com', + browserToken: '1234567', + userId: 'abcdeeeeeeeexxxx102', + }, + }, + httpRes: { + data: { + msg: 'Disabled API key or insufficient privileges', + code: 'BadApiKey', + params: { + ip: '103.189.130.129', + endpoint: '/api/users/registerBrowserToken', + apiKeyIdentifier: 'af831922', + apiKeyType: 'ServerSide', + }, + }, + status: 401, + }, + }, +]; + +export const networkCallsData = [...businessMockData]; diff --git a/test/integrations/destinations/iterable/deleteUsers/data.ts b/test/integrations/destinations/iterable/deleteUsers/data.ts index 9e7eab1ee13..b20708134d8 100644 --- a/test/integrations/destinations/iterable/deleteUsers/data.ts +++ b/test/integrations/destinations/iterable/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + const destType = 'iterable'; export const data = [ @@ -50,7 +52,7 @@ export const data = [ }, ], config: { - apiToken: 'dummyApiKey', + apiToken: defaultApiKey, }, }, ], @@ -88,7 +90,7 @@ export const data = [ }, ], config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, ], @@ -165,7 +167,7 @@ export const data = [ }, ], config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, ], @@ -200,7 +202,7 @@ export const data = [ }, ], config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, dataCenter: 'EUDC', }, }, diff --git a/test/integrations/destinations/iterable/network.ts b/test/integrations/destinations/iterable/network.ts index 1cf26dfd4f4..06f7167ee27 100644 --- a/test/integrations/destinations/iterable/network.ts +++ b/test/integrations/destinations/iterable/network.ts @@ -1,10 +1,12 @@ +import { defaultApiKey } from '../../common/secrets'; + const deleteNwData = [ { httpReq: { method: 'delete', url: 'https://api.iterable.com/api/users/byUserId/rudder1', headers: { - api_key: 'dummyApiKey', + api_key: defaultApiKey, }, }, httpRes: { @@ -21,7 +23,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.iterable.com/api/users/byUserId/rudder2', headers: { - api_key: 'dummyApiKey', + api_key: defaultApiKey, }, }, httpRes: { @@ -76,7 +78,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.iterable.com/api/users/byUserId/rudder5', headers: { - api_key: 'dummyApiKey', + api_key: defaultApiKey, }, }, httpRes: { @@ -93,7 +95,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.iterable.com/api/users/byUserId/rudder6', headers: { - api_key: 'dummyApiKey', + api_key: defaultApiKey, }, }, httpRes: { @@ -110,7 +112,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.eu.iterable.com/api/users/byUserId/rudder7', headers: { - api_key: 'dummyApiKey', + api_key: defaultApiKey, }, }, httpRes: { diff --git a/test/integrations/destinations/iterable/processor/aliasTestData.ts b/test/integrations/destinations/iterable/processor/aliasTestData.ts index 1ee41348596..e99870adea7 100644 --- a/test/integrations/destinations/iterable/processor/aliasTestData.ts +++ b/test/integrations/destinations/iterable/processor/aliasTestData.ts @@ -1,10 +1,40 @@ -import { - generateMetadata, - overrideDestination, - transformResultBuilder, -} from './../../../testUtils'; -import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { Destination, Metadata } from '../../../../../src/types'; +import { overrideDestination } from '../../../testUtils'; + +const baseMetadata: Partial = { + sourceId: 'default-sourceId', + workspaceId: 'default-workspaceId', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destinationId', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2025-01-06T04:12:38.713Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, +}; const destination: Destination = { ID: '123', @@ -29,23 +59,6 @@ const destination: Destination = { Enabled: true, }; -const headers = { - api_key: 'testApiKey', - 'Content-Type': 'application/json', -}; - -const properties = { - path: '/abc', - referrer: '', - search: '', - title: '', - url: '', - category: 'test-category', -}; - -const sentAt = '2020-08-28T16:26:16.473Z'; -const originalTimestamp = '2020-08-28T16:26:06.468Z'; - export const aliasTestData: ProcessorTestData[] = [ { id: 'iterable-alias-test-1', @@ -59,21 +72,29 @@ export const aliasTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { anonymousId: 'anonId', userId: 'new@email.com', previousId: 'old@email.com', name: 'ApplicationLoaded', context: {}, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'alias', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination, }, ], }, @@ -83,17 +104,30 @@ export const aliasTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, + method: 'POST', endpoint: 'https://api.iterable.com/api/users/updateEmail', - JSON: { - currentEmail: 'old@email.com', - newEmail: 'new@email.com', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + currentEmail: 'old@email.com', + newEmail: 'new@email.com', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -111,21 +145,29 @@ export const aliasTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: overrideDestination(destination, { dataCenter: 'EUDC' }), message: { anonymousId: 'anonId', userId: 'new@email.com', previousId: 'old@email.com', name: 'ApplicationLoaded', context: {}, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'alias', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination: overrideDestination(destination, { dataCenter: 'EUDC' }), }, ], }, @@ -135,17 +177,30 @@ export const aliasTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, + method: 'POST', endpoint: 'https://api.eu.iterable.com/api/users/updateEmail', - JSON: { - currentEmail: 'old@email.com', - newEmail: 'new@email.com', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', }, - }), + params: {}, + body: { + JSON: { + currentEmail: 'old@email.com', + newEmail: 'new@email.com', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/iterable/processor/identifyTestData.ts b/test/integrations/destinations/iterable/processor/identifyTestData.ts index 21d294e2322..078df56c5ee 100644 --- a/test/integrations/destinations/iterable/processor/identifyTestData.ts +++ b/test/integrations/destinations/iterable/processor/identifyTestData.ts @@ -1,65 +1,415 @@ -import { - generateMetadata, - transformResultBuilder, - generateIndentifyPayload, - overrideDestination, -} from './../../../testUtils'; -import { Destination } from '../../../../../src/types'; +import { Metadata } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; -const destination: Destination = { - ID: '123', - Name: 'iterable', - DestinationDefinition: { - ID: '123', - Name: 'iterable', - DisplayName: 'Iterable', - Config: {}, - }, - WorkspaceID: '123', - Transformations: [], - Config: { - apiKey: 'testApiKey', - dataCenter: 'USDC', - preferUserId: false, - trackAllPages: true, - trackNamedPages: false, - mapToSingleEvent: false, - trackCategorisedPages: false, - }, - Enabled: true, -}; - -const headers = { - api_key: 'testApiKey', - 'Content-Type': 'application/json', -}; - -const user1Traits = { - name: 'manashi', - country: 'India', - city: 'Bangalore', - email: 'manashi@website.com', -}; - -const user2Traits = { - am_pm: 'AM', - pPower: 'AM', - boolean: true, - userId: 'Jacqueline', - firstname: 'Jacqueline', - administrative_unit: 'Minnesota', +const baseMetadata: Partial = { + sourceId: 'default-sourceId', + workspaceId: 'default-workspaceId', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destinationId', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2025-01-06T03:57:13.523Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, }; -const userId = 'userId'; -const anonymousId = 'anonId'; -const sentAt = '2020-08-28T16:26:16.473Z'; -const originalTimestamp = '2020-08-28T16:26:06.468Z'; - -const updateUserEndpoint = 'https://api.iterable.com/api/users/update'; -const updateUserEndpointEUDC = 'https://api.eu.iterable.com/api/users/update'; - export const identifyTestData: ProcessorTestData[] = [ + { + id: 'iterable-identify-test-has-multiple-responses', + name: 'iterable', + description: 'Indentify call to verify hasMultipleResponses', + scenario: 'Business', + successCriteria: + 'Response should contain status code 200 and it should contain update user payload with new email sent in payload', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + type: 'identify', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', + context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '62amo6xzksaeyupr4y0pfaucwj0upzs6g7yx', + messageId: 'hk02avz2xijdkid4i0mvncbm478g9lybdpgc', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + registerDeviceOrBrowserApiKey: 'randomApiKey', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + email: 'ruchira@rudderlabs.com', + userId: 'userId', + dataFields: { + email: 'ruchira@rudderlabs.com', + }, + preferUserId: false, + mergeNestedObjects: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, + statusCode: 200, + }, + { + output: { + body: { + FORM: {}, + JSON: { + device: { + platform: 'APNS', + token: 'token', + }, + email: 'ruchira@rudderlabs.com', + preferUserId: false, + userId: 'userId', + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.iterable.com/api/users/registerDeviceToken', + files: {}, + headers: { + 'Content-Type': 'application/json', + api_key: 'randomApiKey', + }, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + { + id: 'iterable-identify-test-has-multiple-responses', + name: 'iterable', + description: 'Indentify call to verify hasMultipleResponses', + scenario: 'Business', + successCriteria: + 'Response should contain status code 200 and it should contain update user payload with new email sent in payload', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + type: 'identify', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', + context: { + os: { + name: '', + version: '1.12.3', + token: 'randomBrowserToken', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + locale: 'en-US', + device: { + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '62amo6xzksaeyupr4y0pfaucwj0upzs6g7yx', + messageId: 'hk02avz2xijdkid4i0mvncbm478g9lybdpgc', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + registerDeviceOrBrowserApiKey: 'randomApiKey', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + destinationDefinitionId: 'default-dest-def', + destinationId: 'default-destinationId', + destinationType: 'default-destination-type', + dontBatch: false, + eventName: 'default-event', + eventType: 'default-type', + instanceId: 'default-instance', + jobId: 1, + jobRunId: 'default-job-run', + mergedTpConfig: {}, + messageId: 'default-message-id', + messageIds: ['default-message-id'], + namespace: 'default-namespace', + oauthAccessToken: 'default-token', + receivedAt: '2025-01-06T03:57:13.523Z', + recordId: {}, + rudderId: 'default-rudder-id', + sourceBatchId: 'default-batch', + sourceCategory: 'default-category', + sourceDefinitionId: 'default-source-def', + sourceId: 'default-sourceId', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + sourceTpConfig: {}, + sourceType: 'default-source-type', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + transformationId: 'default-transform', + workspaceId: 'default-workspaceId', + }, + output: { + body: { + FORM: {}, + JSON: { + dataFields: { + email: 'ruchira@rudderlabs.com', + }, + email: 'ruchira@rudderlabs.com', + mergeNestedObjects: true, + preferUserId: false, + userId: 'userId', + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.iterable.com/api/users/update', + files: {}, + headers: { + 'Content-Type': 'application/json', + api_key: 'testApiKey', + }, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + { + metadata: { + destinationDefinitionId: 'default-dest-def', + destinationId: 'default-destinationId', + destinationType: 'default-destination-type', + dontBatch: false, + eventName: 'default-event', + eventType: 'default-type', + instanceId: 'default-instance', + jobId: 1, + jobRunId: 'default-job-run', + mergedTpConfig: {}, + messageId: 'default-message-id', + messageIds: ['default-message-id'], + namespace: 'default-namespace', + oauthAccessToken: 'default-token', + receivedAt: '2025-01-06T03:57:13.523Z', + recordId: {}, + rudderId: 'default-rudder-id', + sourceBatchId: 'default-batch', + sourceCategory: 'default-category', + sourceDefinitionId: 'default-source-def', + sourceId: 'default-sourceId', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + sourceTpConfig: {}, + sourceType: 'default-source-type', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + transformationId: 'default-transform', + workspaceId: 'default-workspaceId', + }, + output: { + body: { + FORM: {}, + JSON: { + browserToken: 'randomBrowserToken', + email: 'ruchira@rudderlabs.com', + userId: 'userId', + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.iterable.com/api/users/registerBrowserToken', + files: {}, + headers: { + 'Content-Type': 'application/json', + api_key: 'randomApiKey', + }, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + ], + }, + }, + }, { id: 'iterable-identify-test-1', name: 'iterable', @@ -72,20 +422,55 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { - anonymousId, + anonymousId: 'anonId', context: { - traits: user1Traits, + traits: { + name: 'manashi', + country: 'India', + city: 'Bangalore', + email: 'manashi@website.com', + }, + }, + traits: { + name: 'manashi', + country: 'India', + city: 'Bangalore', + email: 'manashi@website.com', }, - traits: user1Traits, type: 'identify', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -95,20 +480,38 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpoint, - JSON: { - email: user1Traits.email, - userId: anonymousId, - dataFields: user1Traits, - preferUserId: false, - mergeNestedObjects: true, + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + email: 'manashi@website.com', + userId: 'anonId', + dataFields: { + name: 'manashi', + country: 'India', + city: 'Bangalore', + email: 'manashi@website.com', + }, + preferUserId: false, + mergeNestedObjects: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -126,20 +529,76 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateIndentifyPayload({ - userId, - anonymousId, + message: { + type: 'identify', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { - traits: { email: 'ruchira@rudderlabs.com' }, + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, - type: 'identify', - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + rudderId: '62amo6xzksaeyupr4y0pfaucwj0upzs6g7yx', + messageId: 'hk02avz2xijdkid4i0mvncbm478g9lybdpgc', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], }, @@ -149,22 +608,35 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpoint, - JSON: { - email: 'ruchira@rudderlabs.com', - userId, - dataFields: { + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { email: 'ruchira@rudderlabs.com', + userId: 'userId', + dataFields: { + email: 'ruchira@rudderlabs.com', + }, + preferUserId: false, + mergeNestedObjects: true, }, - preferUserId: false, - mergeNestedObjects: true, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -182,20 +654,76 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { ...destination, Config: { ...destination.Config, preferUserId: true } }, - message: generateIndentifyPayload({ - userId, - anonymousId, + message: { + type: 'identify', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { - traits: { email: 'ruchira@rudderlabs.com' }, + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, - type: 'identify', - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + rudderId: '1bbuv14fd7e8ogmsx7prcmw6ob37aq1zj6mo', + messageId: '1y56axyob5fp3lg3b1y1pij50kp15pyc2ubj', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: true, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], }, @@ -205,22 +733,35 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpoint, - JSON: { - email: 'ruchira@rudderlabs.com', - userId, - dataFields: { + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { email: 'ruchira@rudderlabs.com', + userId: 'userId', + dataFields: { + email: 'ruchira@rudderlabs.com', + }, + preferUserId: true, + mergeNestedObjects: true, }, - preferUserId: true, - mergeNestedObjects: true, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -239,21 +780,77 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { ...destination, Config: { ...destination.Config, preferUserId: true } }, - message: generateIndentifyPayload({ - userId, - anonymousId, + message: { + type: 'identify', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: {}, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, - traits: { email: 'ruchira@rudderlabs.com' }, - type: 'identify', - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + traits: { + email: 'ruchira@rudderlabs.com', + }, + rudderId: 'iakido48935yw0kmw2swvjldsqoaophjzlhe', + messageId: 'hzycemnjaxr9cuqyyh003x9zlwfqnvbgzv4n', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: true, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], }, @@ -263,22 +860,35 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpoint, - JSON: { - email: 'ruchira@rudderlabs.com', - userId, - dataFields: { + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { email: 'ruchira@rudderlabs.com', + userId: 'userId', + dataFields: { + email: 'ruchira@rudderlabs.com', + }, + preferUserId: true, + mergeNestedObjects: true, }, - preferUserId: true, - mergeNestedObjects: true, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -296,12 +906,12 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { ...destination, Config: { ...destination.Config, preferUserId: true } }, message: { - userId, - anonymousId, + userId: 'userId', + anonymousId: 'anonId', context: { externalId: [ { @@ -312,12 +922,44 @@ export const identifyTestData: ProcessorTestData[] = [ ], mappedToDestination: 'true', }, - traits: user2Traits, + traits: { + am_pm: 'AM', + pPower: 'AM', + boolean: true, + userId: 'Jacqueline', + firstname: 'Jacqueline', + administrative_unit: 'Minnesota', + }, type: 'identify', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: true, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -327,20 +969,41 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpoint, - JSON: { - email: 'lynnanderson@smith.net', - userId, - dataFields: { ...user2Traits, email: 'lynnanderson@smith.net' }, - preferUserId: true, - mergeNestedObjects: true, + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', }, - }), + params: {}, + body: { + JSON: { + email: 'lynnanderson@smith.net', + userId: 'userId', + dataFields: { + am_pm: 'AM', + pPower: 'AM', + boolean: true, + userId: 'Jacqueline', + firstname: 'Jacqueline', + administrative_unit: 'Minnesota', + email: 'lynnanderson@smith.net', + }, + preferUserId: true, + mergeNestedObjects: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -358,12 +1021,12 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { userId: 'Matthew', - anonymousId, + anonymousId: 'anonId', context: { externalId: [ { @@ -374,12 +1037,44 @@ export const identifyTestData: ProcessorTestData[] = [ ], mappedToDestination: 'true', }, - traits: user2Traits, + traits: { + am_pm: 'AM', + pPower: 'AM', + boolean: true, + userId: 'Jacqueline', + firstname: 'Jacqueline', + administrative_unit: 'Minnesota', + }, type: 'identify', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -389,19 +1084,39 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpoint, - JSON: { - userId: 'Matthew', - dataFields: { ...user2Traits, userId: 'Matthew' }, - preferUserId: false, - mergeNestedObjects: true, + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', }, - }), + params: {}, + body: { + JSON: { + userId: 'Matthew', + dataFields: { + am_pm: 'AM', + pPower: 'AM', + boolean: true, + userId: 'Matthew', + firstname: 'Jacqueline', + administrative_unit: 'Minnesota', + }, + preferUserId: false, + mergeNestedObjects: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -419,20 +1134,55 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: overrideDestination(destination, { dataCenter: 'EUDC' }), message: { - anonymousId, + anonymousId: 'anonId', context: { - traits: user1Traits, + traits: { + name: 'manashi', + country: 'India', + city: 'Bangalore', + email: 'manashi@website.com', + }, + }, + traits: { + name: 'manashi', + country: 'India', + city: 'Bangalore', + email: 'manashi@website.com', }, - traits: user1Traits, type: 'identify', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'EUDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -442,20 +1192,38 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpointEUDC, - JSON: { - email: user1Traits.email, - userId: anonymousId, - dataFields: user1Traits, - preferUserId: false, - mergeNestedObjects: true, + method: 'POST', + endpoint: 'https://api.eu.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', }, - }), + params: {}, + body: { + JSON: { + email: 'manashi@website.com', + userId: 'anonId', + dataFields: { + name: 'manashi', + country: 'India', + city: 'Bangalore', + email: 'manashi@website.com', + }, + preferUserId: false, + mergeNestedObjects: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/iterable/processor/pageScreenTestData.ts b/test/integrations/destinations/iterable/processor/pageScreenTestData.ts index a27cf9fe3b8..6bf6465068c 100644 --- a/test/integrations/destinations/iterable/processor/pageScreenTestData.ts +++ b/test/integrations/destinations/iterable/processor/pageScreenTestData.ts @@ -1,55 +1,40 @@ -import { - generateMetadata, - overrideDestination, - transformResultBuilder, -} from './../../../testUtils'; -import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { Metadata } from '../../../../../src/types'; -const destination: Destination = { - ID: '123', - Name: 'iterable', - DestinationDefinition: { - ID: '123', - Name: 'iterable', - DisplayName: 'Iterable', - Config: {}, - }, - WorkspaceID: '123', - Transformations: [], - Config: { - apiKey: 'testApiKey', - dataCenter: 'USDC', - preferUserId: false, - trackAllPages: true, - trackNamedPages: false, - mapToSingleEvent: false, - trackCategorisedPages: false, - }, - Enabled: true, -}; - -const headers = { - api_key: 'testApiKey', - 'Content-Type': 'application/json', -}; - -const properties = { - path: '/abc', - referrer: '', - search: '', - title: '', - url: '', - category: 'test-category', +const baseMetadata: Partial = { + sourceId: 'default-sourceId', + workspaceId: 'default-workspaceId', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destinationId', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2025-01-06T04:03:53.932Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, }; -const anonymousId = 'anonId'; -const sentAt = '2020-08-28T16:26:16.473Z'; -const originalTimestamp = '2020-08-28T16:26:06.468Z'; - -const pageEndpoint = 'https://api.iterable.com/api/events/track'; -const pageEndpointEUDC = 'https://api.eu.iterable.com/api/events/track'; - export const pageScreenTestData: ProcessorTestData[] = [ { id: 'iterable-page-test-1', @@ -63,23 +48,55 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'page', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -89,20 +106,40 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpoint, - JSON: { - userId: anonymousId, - dataFields: properties, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'ApplicationLoaded page', - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'ApplicationLoaded page', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -120,26 +157,57 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - ...destination, - Config: { ...destination.Config, mapToSingleEvent: true }, - }, message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties: { ...properties, campaignId: '123456', templateId: '1213458' }, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + campaignId: '123456', + templateId: '1213458', + }, type: 'page', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: true, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -149,22 +217,44 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpoint, - JSON: { - campaignId: 123456, - templateId: 1213458, - userId: anonymousId, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'Loaded a Page', - dataFields: { ...properties, campaignId: '123456', templateId: '1213458' }, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + campaignId: 123456, + templateId: 1213458, + userId: 'anonId', + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'Loaded a Page', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + campaignId: '123456', + templateId: '1213458', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -182,26 +272,55 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - ...destination, - Config: { ...destination.Config, trackNamedPages: true, trackAllPages: false }, - }, message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'page', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: false, + trackNamedPages: true, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -211,20 +330,40 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpoint, - JSON: { - userId: anonymousId, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'ApplicationLoaded page', - dataFields: properties, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'ApplicationLoaded page', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -242,26 +381,55 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - ...destination, - Config: { ...destination.Config, trackCategorisedPages: true, trackAllPages: false }, - }, message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'screen', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: false, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: true, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -271,20 +439,40 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpoint, - JSON: { - userId: anonymousId, - dataFields: properties, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'ApplicationLoaded screen', - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'ApplicationLoaded screen', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -302,26 +490,57 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - ...destination, - Config: { ...destination.Config, mapToSingleEvent: true }, - }, message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties: { ...properties, campaignId: '123456', templateId: '1213458' }, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + campaignId: '123456', + templateId: '1213458', + }, type: 'screen', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: true, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -331,22 +550,44 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpoint, - JSON: { - campaignId: 123456, - templateId: 1213458, - userId: anonymousId, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'Loaded a Screen', - dataFields: { ...properties, campaignId: '123456', templateId: '1213458' }, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + campaignId: 123456, + templateId: 1213458, + userId: 'anonId', + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'Loaded a Screen', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + campaignId: '123456', + templateId: '1213458', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -364,26 +605,55 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - ...destination, - Config: { ...destination.Config, trackNamedPages: true, trackAllPages: false }, - }, message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'screen', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: false, + trackNamedPages: true, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -393,20 +663,40 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpoint, - JSON: { - userId: anonymousId, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'ApplicationLoaded screen', - dataFields: properties, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'ApplicationLoaded screen', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -424,23 +714,55 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: overrideDestination(destination, { dataCenter: 'EUDC' }), message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'page', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'EUDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -450,20 +772,40 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpointEUDC, - JSON: { - userId: anonymousId, - dataFields: properties, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'ApplicationLoaded page', - }, - }), + method: 'POST', + endpoint: 'https://api.eu.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'ApplicationLoaded page', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/iterable/processor/trackTestData.ts b/test/integrations/destinations/iterable/processor/trackTestData.ts index 2b7d2a9c47a..1945d2c7a9a 100644 --- a/test/integrations/destinations/iterable/processor/trackTestData.ts +++ b/test/integrations/destinations/iterable/processor/trackTestData.ts @@ -1,137 +1,40 @@ -import { - generateMetadata, - generateTrackPayload, - overrideDestination, - transformResultBuilder, -} from './../../../testUtils'; -import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { Metadata } from '../../../../../src/types'; -const destination: Destination = { - ID: '123', - Name: 'iterable', - DestinationDefinition: { - ID: '123', - Name: 'iterable', - DisplayName: 'Iterable', - Config: {}, - }, - WorkspaceID: '123', - Transformations: [], - Config: { - apiKey: 'testApiKey', - dataCenter: 'USDC', - preferUserId: false, - trackAllPages: true, - trackNamedPages: false, - mapToSingleEvent: false, - trackCategorisedPages: false, - }, - Enabled: true, -}; - -const headers = { - api_key: 'testApiKey', - 'Content-Type': 'application/json', -}; - -const properties = { - subject: 'resume validate', - sendtime: '2020-01-01', - sendlocation: 'akashdeep@gmail.com', -}; - -const customEventProperties = { - campaignId: '1', - templateId: '0', - user_actual_id: 12345, - category: 'test-category', - email: 'ruchira@rudderlabs.com', - user_actual_role: 'system_admin, system_user', -}; - -const productInfo = { - price: 797, - variant: 'Oak', - quantity: 1, - quickship: true, - full_price: 1328, - product_id: 10606, - non_interaction: 1, - sku: 'JB24691400-W05', - name: 'Vira Console Cabinet', - cart_id: 'bd9b8dbf4ef8ee01d4206b04fe2ee6ae', +const baseMetadata: Partial = { + sourceId: 'default-sourceId', + workspaceId: 'default-workspaceId', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destinationId', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2025-01-06T04:00:49.698Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, }; -const orderCompletedProductInfo = { - price: 45, - quantity: 1, - total: '1000', - name: 'Shoes', - orderId: 10000, - product_id: 1234, - campaignId: '123456', - templateId: '1213458', -}; - -const products = [ - { - product_id: '507f1f77bcf86cd799439011', - sku: '45790-32', - name: 'Monopoly: 3rd Edition', - price: '19', - position: '1', - category: 'cars', - url: 'https://www.example.com/product/path', - image_url: 'https://www.example.com/product/path.jpg', - quantity: '2', - }, - { - product_id: '507f1f77bcf86cd7994390112', - sku: '45790-322', - name: 'Monopoly: 3rd Edition2', - price: '192', - quantity: 22, - position: '12', - category: 'Cars2', - url: 'https://www.example.com/product/path2', - image_url: 'https://www.example.com/product/path.jpg2', - }, -]; - -const items = [ - { - id: '507f1f77bcf86cd799439011', - sku: '45790-32', - name: 'Monopoly: 3rd Edition', - categories: ['cars'], - price: 19, - quantity: 2, - imageUrl: 'https://www.example.com/product/path.jpg', - url: 'https://www.example.com/product/path', - }, - { - id: '507f1f77bcf86cd7994390112', - sku: '45790-322', - name: 'Monopoly: 3rd Edition2', - categories: ['Cars2'], - price: 192, - quantity: 22, - imageUrl: 'https://www.example.com/product/path.jpg2', - url: 'https://www.example.com/product/path2', - }, -]; - -const userId = 'userId'; -const anonymousId = 'anonId'; -const sentAt = '2020-08-28T16:26:16.473Z'; -const originalTimestamp = '2020-08-28T16:26:06.468Z'; - -const endpoint = 'https://api.iterable.com/api/events/track'; -const endpointEUDC = 'https://api.eu.iterable.com/api/events/track'; -const updateCartEndpoint = 'https://api.iterable.com/api/commerce/updateCart'; -const trackPurchaseEndpoint = 'https://api.iterable.com/api/commerce/trackPurchase'; - export const trackTestData: ProcessorTestData[] = [ { id: 'iterable-track-test-1', @@ -145,19 +48,48 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { - anonymousId, + anonymousId: 'anonId', event: 'Email Opened', type: 'track', context: {}, - properties, - sentAt, - originalTimestamp, + properties: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -167,19 +99,36 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint, - JSON: { - userId: 'anonId', - createdAt: 1598631966468, - eventName: 'Email Opened', - dataFields: properties, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + createdAt: 1598631966468, + eventName: 'Email Opened', + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -197,29 +146,107 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateTrackPayload({ - userId, - anonymousId, - event: 'product added', + message: { + type: 'track', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: { email: 'sayan@gmail.com', }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, + rudderId: '227egb53wnacyz7f5hopt3jwriuwwk8n2y8i', + messageId: '40q64xrajd4kqt5174iy8889da8kjij55u85', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + event: 'product added', properties: { campaignId: '1', templateId: '0', orderId: 10000, total: 1000, - products, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, }, - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], }, @@ -229,25 +256,59 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateCartEndpoint, - JSON: { - user: { - email: 'sayan@gmail.com', - dataFields: { + method: 'POST', + endpoint: 'https://api.iterable.com/api/commerce/updateCart', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + user: { email: 'sayan@gmail.com', + dataFields: { + email: 'sayan@gmail.com', + }, + userId: 'userId', + preferUserId: false, + mergeNestedObjects: true, }, - userId, - preferUserId: false, - mergeNestedObjects: true, + items: [ + { + id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + categories: ['cars'], + price: 19, + quantity: 2, + imageUrl: 'https://www.example.com/product/path.jpg', + url: 'https://www.example.com/product/path', + }, + { + id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + categories: ['Cars2'], + price: 192, + quantity: 22, + imageUrl: 'https://www.example.com/product/path.jpg2', + url: 'https://www.example.com/product/path2', + }, + ], }, - items, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -265,29 +326,107 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateTrackPayload({ - userId, - anonymousId, - event: 'order completed', + message: { + type: 'track', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: { email: 'sayan@gmail.com', }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, + rudderId: 'npe99e7yc7apntgd9roobt2n8i7262rsg6vr', + messageId: '68ygodw5mj88lmjm5sm765tatvscrucqo6kx', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + event: 'order completed', properties: { orderId: 10000, total: '1000', campaignId: '123456', templateId: '1213458', - products, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], }, - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], }, @@ -297,37 +436,94 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: trackPurchaseEndpoint, - JSON: { - dataFields: { - orderId: 10000, - total: '1000', - campaignId: '123456', - templateId: '1213458', - products, - }, - id: '10000', - createdAt: 1598631966468, - campaignId: 123456, - templateId: 1213458, - total: 1000, - user: { - email: 'sayan@gmail.com', + method: 'POST', + endpoint: 'https://api.iterable.com/api/commerce/trackPurchase', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { dataFields: { + orderId: 10000, + total: '1000', + campaignId: '123456', + templateId: '1213458', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + id: '10000', + createdAt: 1598631966468, + campaignId: 123456, + templateId: 1213458, + total: 1000, + user: { email: 'sayan@gmail.com', + dataFields: { + email: 'sayan@gmail.com', + }, + userId: 'userId', + preferUserId: false, + mergeNestedObjects: true, }, - userId, - preferUserId: false, - mergeNestedObjects: true, + items: [ + { + id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + categories: ['cars'], + price: 19, + quantity: 2, + imageUrl: 'https://www.example.com/product/path.jpg', + url: 'https://www.example.com/product/path', + }, + { + id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + categories: ['Cars2'], + price: 192, + quantity: 22, + imageUrl: 'https://www.example.com/product/path.jpg2', + url: 'https://www.example.com/product/path2', + }, + ], }, - items, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -345,23 +541,85 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateTrackPayload({ - userId, - anonymousId, - event: 'test track event GA3', + message: { + type: 'track', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: { email: 'sayan@gmail.com', }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: 'id2nbnto38rw1v5wiqyc81xe61c7t420zpjb', + messageId: '28pdlaljhp7i1woa7b0fhj47rlz3g4z2pvdw', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + event: 'test track event GA3', + properties: { + campaignId: '1', + templateId: '0', + user_actual_id: 12345, + category: 'test-category', + email: 'ruchira@rudderlabs.com', + user_actual_role: 'system_admin, system_user', + }, + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, }, - properties: customEventProperties, - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], }, @@ -371,22 +629,42 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint, - JSON: { - email: 'ruchira@rudderlabs.com', - dataFields: customEventProperties, - userId, - eventName: 'test track event GA3', - createdAt: 1598631966468, - campaignId: 1, - templateId: 0, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + email: 'ruchira@rudderlabs.com', + dataFields: { + campaignId: '1', + templateId: '0', + user_actual_id: 12345, + category: 'test-category', + email: 'ruchira@rudderlabs.com', + user_actual_role: 'system_admin, system_user', + }, + userId: 'userId', + eventName: 'test track event GA3', + createdAt: 1598631966468, + campaignId: 1, + templateId: 0, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -404,23 +682,89 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateTrackPayload({ - userId, - anonymousId, - event: 'product added', + message: { + type: 'track', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: { email: 'jessica@jlpdesign.net', }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: 'gm8wm4385x4kfzl464h7tjtob474i17anotc', + messageId: 'jslc0490479rziix9h0ya6z6qpn2taqmryro', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + event: 'product added', + properties: { + price: 797, + variant: 'Oak', + quantity: 1, + quickship: true, + full_price: 1328, + product_id: 10606, + non_interaction: 1, + sku: 'JB24691400-W05', + name: 'Vira Console Cabinet', + cart_id: 'bd9b8dbf4ef8ee01d4206b04fe2ee6ae', }, - properties: productInfo, - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], }, @@ -430,33 +774,46 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateCartEndpoint, - JSON: { - user: { - email: 'jessica@jlpdesign.net', - dataFields: { + method: 'POST', + endpoint: 'https://api.iterable.com/api/commerce/updateCart', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + user: { email: 'jessica@jlpdesign.net', + dataFields: { + email: 'jessica@jlpdesign.net', + }, + userId: 'userId', + preferUserId: false, + mergeNestedObjects: true, }, - userId, - preferUserId: false, - mergeNestedObjects: true, + items: [ + { + id: 10606, + sku: 'JB24691400-W05', + name: 'Vira Console Cabinet', + price: 797, + quantity: 1, + }, + ], }, - items: [ - { - id: productInfo.product_id, - sku: productInfo.sku, - name: productInfo.name, - price: productInfo.price, - quantity: productInfo.quantity, - }, - ], + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -474,29 +831,92 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateTrackPayload({ - userId, - anonymousId, - event: 'product added', + message: { + type: 'track', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: { email: 'jessica@jlpdesign.net', }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, + rudderId: '4osg2zcrsrh2accmbijxm0zqixtxyrsun8uc', + messageId: 'x901bx7paxtr7ktja5mhd1mi8q4lr5vlrl2x', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + event: 'product added', properties: { campaignId: '1', templateId: '0', orderId: 10000, total: 1000, - ...products[1], + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', }, - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], }, @@ -506,36 +926,49 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateCartEndpoint, - JSON: { - user: { - email: 'jessica@jlpdesign.net', - dataFields: { + method: 'POST', + endpoint: 'https://api.iterable.com/api/commerce/updateCart', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + user: { email: 'jessica@jlpdesign.net', + dataFields: { + email: 'jessica@jlpdesign.net', + }, + userId: 'userId', + preferUserId: false, + mergeNestedObjects: true, }, - userId, - preferUserId: false, - mergeNestedObjects: true, + items: [ + { + price: 192, + url: 'https://www.example.com/product/path2', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + id: '507f1f77bcf86cd7994390112', + quantity: 22, + imageUrl: 'https://www.example.com/product/path.jpg2', + categories: ['Cars2'], + }, + ], }, - items: [ - { - price: 192, - url: products[1].url, - sku: products[1].sku, - name: products[1].name, - id: products[1].product_id, - quantity: products[1].quantity, - imageUrl: products[1].image_url, - categories: [products[1].category], - }, - ], + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -553,23 +986,87 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateTrackPayload({ - userId, - anonymousId, - event: 'order completed', + message: { + type: 'track', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: { email: 'jessica@jlpdesign.net', }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, - properties: orderCompletedProductInfo, - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + rudderId: '9ovlz4kuew0wjcbwymj3vlhkngzixp9evf19', + messageId: 'ev0qyvsclinoh4z4e1uz4d8pdhrnf17q0rjd', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + event: 'order completed', + properties: { + price: 45, + quantity: 1, + total: '1000', + name: 'Shoes', + orderId: 10000, + product_id: 1234, + campaignId: '123456', + templateId: '1213458', + }, + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], }, @@ -579,38 +1076,60 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: trackPurchaseEndpoint, - JSON: { - dataFields: orderCompletedProductInfo, - user: { - email: 'jessica@jlpdesign.net', + method: 'POST', + endpoint: 'https://api.iterable.com/api/commerce/trackPurchase', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { dataFields: { + price: 45, + quantity: 1, + total: '1000', + name: 'Shoes', + orderId: 10000, + product_id: 1234, + campaignId: '123456', + templateId: '1213458', + }, + user: { email: 'jessica@jlpdesign.net', + dataFields: { + email: 'jessica@jlpdesign.net', + }, + userId: 'userId', + preferUserId: false, + mergeNestedObjects: true, }, - userId, - preferUserId: false, - mergeNestedObjects: true, + id: '10000', + total: 1000, + campaignId: 123456, + templateId: 1213458, + createdAt: 1598631966468, + items: [ + { + id: 1234, + name: 'Shoes', + price: 45, + quantity: 1, + }, + ], }, - id: '10000', - total: 1000, - campaignId: 123456, - templateId: 1213458, - createdAt: 1598631966468, - items: [ - { - id: orderCompletedProductInfo.product_id, - name: orderCompletedProductInfo.name, - price: orderCompletedProductInfo.price, - quantity: orderCompletedProductInfo.quantity, - }, - ], + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -628,18 +1147,47 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { - anonymousId, + anonymousId: 'anonId', type: 'track', context: {}, - properties, - sentAt, - originalTimestamp, + properties: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -649,18 +1197,35 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint, - JSON: { - userId: anonymousId, - createdAt: 1598631966468, - dataFields: properties, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + createdAt: 1598631966468, + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -678,19 +1243,48 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { - userId, - anonymousId, + userId: 'userId', + anonymousId: 'anonId', type: 'track', context: {}, - properties, - sentAt, - originalTimestamp, + properties: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -700,18 +1294,35 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint, - JSON: { - userId, - createdAt: 1598631966468, - dataFields: properties, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'userId', + createdAt: 1598631966468, + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -729,19 +1340,48 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: overrideDestination(destination, { dataCenter: 'EUDC' }), message: { - anonymousId, + anonymousId: 'anonId', event: 'Email Opened', type: 'track', context: {}, - properties, - sentAt, - originalTimestamp, + properties: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'EUDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], }, @@ -751,19 +1391,36 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: endpointEUDC, - JSON: { - userId: 'anonId', - createdAt: 1598631966468, - eventName: 'Email Opened', - dataFields: properties, - }, - }), + method: 'POST', + endpoint: 'https://api.eu.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + createdAt: 1598631966468, + eventName: 'Email Opened', + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/iterable/processor/validationTestData.ts b/test/integrations/destinations/iterable/processor/validationTestData.ts index 86728a868b6..8251982b56f 100644 --- a/test/integrations/destinations/iterable/processor/validationTestData.ts +++ b/test/integrations/destinations/iterable/processor/validationTestData.ts @@ -1,8 +1,41 @@ -import { generateMetadata } from './../../../testUtils'; -import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { Metadata, Destination, RudderMessage } from '../../../../../src/types'; -const destination: Destination = { +const baseMetadata: Partial = { + sourceId: 'default-sourceId', + workspaceId: 'default-workspaceId', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destinationId', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2025-01-06T04:14:40.785Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, +}; + +const baseDestination: Destination = { ID: '123', Name: 'iterable', DestinationDefinition: { @@ -11,8 +44,6 @@ const destination: Destination = { DisplayName: 'Iterable', Config: {}, }, - WorkspaceID: '123', - Transformations: [], Config: { apiKey: 'testApiKey', mapToSingleEvent: false, @@ -21,26 +52,11 @@ const destination: Destination = { trackNamedPages: false, }, Enabled: true, -}; - -const properties = { - url: 'https://dominos.com', - title: 'Pizza', - referrer: 'https://google.com', -}; - -const sentAt = '2020-08-28T16:26:16.473Z'; -const originalTimestamp = '2020-08-28T16:26:06.468Z'; - -const expectedStatTags = { - destType: 'ITERABLE', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - destinationId: 'default-destinationId', - workspaceId: 'default-workspaceId', + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }; export const validationTestData: ProcessorTestData[] = [ @@ -56,9 +72,9 @@ export const validationTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { userId: 'sajal12', anonymousId: 'abcdeeeeeeeexxxx102', @@ -67,12 +83,17 @@ export const validationTestData: ProcessorTestData[] = [ email: 'abc@example.com', }, }, - properties, + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, type: 'page', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination: baseDestination, }, ], }, @@ -82,10 +103,19 @@ export const validationTestData: ProcessorTestData[] = [ status: 200, body: [ { + metadata: baseMetadata, statusCode: 400, error: 'Invalid page call', - statTags: { ...expectedStatTags, errorType: 'configuration' }, - metadata: generateMetadata(1), + statTags: { + destType: 'ITERABLE', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, }, ], }, @@ -103,16 +133,17 @@ export const validationTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { context: {}, type: 'identify', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination: baseDestination, }, ], }, @@ -122,10 +153,19 @@ export const validationTestData: ProcessorTestData[] = [ status: 200, body: [ { + metadata: baseMetadata, statusCode: 400, error: 'userId or email is mandatory for this request', - statTags: expectedStatTags, - metadata: generateMetadata(1), + statTags: { + destType: 'ITERABLE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, }, ], }, @@ -143,16 +183,17 @@ export const validationTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { context: {}, type: 'group', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination: baseDestination, }, ], }, @@ -162,10 +203,19 @@ export const validationTestData: ProcessorTestData[] = [ status: 200, body: [ { + metadata: baseMetadata, statusCode: 400, error: 'Message type group not supported', - statTags: expectedStatTags, - metadata: generateMetadata(1), + statTags: { + destType: 'ITERABLE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, }, ], }, @@ -183,17 +233,22 @@ export const validationTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { context: {}, type: 'alias', - properties, - sentAt, - originalTimestamp, + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination: baseDestination, }, ], }, @@ -203,10 +258,19 @@ export const validationTestData: ProcessorTestData[] = [ status: 200, body: [ { + metadata: baseMetadata, statusCode: 400, error: 'Missing required value from "previousId"', - statTags: expectedStatTags, - metadata: generateMetadata(1), + statTags: { + destType: 'ITERABLE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, }, ], }, @@ -224,19 +288,24 @@ export const validationTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { context: {}, type: 'alias', previousId: 'old@email.com', anonymousId: 'anonId', - properties, - sentAt, - originalTimestamp, + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination: baseDestination, }, ], }, @@ -246,10 +315,74 @@ export const validationTestData: ProcessorTestData[] = [ status: 200, body: [ { + metadata: baseMetadata, statusCode: 400, error: 'Missing required value from "userId"', - statTags: expectedStatTags, - metadata: generateMetadata(1), + statTags: { + destType: 'ITERABLE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, + }, + ], + }, + }, + }, + { + id: 'iterable-validation-test-6', + name: 'iterable', + description: '[Error]: Missing message type', + scenario: 'Framework', + successCriteria: + 'Response should contain status code 400 and it should throw instrumentation error with respective message type', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + context: {}, + event: 'testEvent', + properties: { + url: 'https://nodominoes.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: baseDestination, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: 'Event type is required', + statTags: { + destType: 'ITERABLE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, }, ], }, diff --git a/test/integrations/destinations/iterable/router/data.ts b/test/integrations/destinations/iterable/router/data.ts index 1917c078ebd..4d0385d99a8 100644 --- a/test/integrations/destinations/iterable/router/data.ts +++ b/test/integrations/destinations/iterable/router/data.ts @@ -1,7 +1,14 @@ -export const data = [ +import { RouterTestData } from '../../../testTypes'; +import { MessageType, RudderMessage } from '../../../../../src/types'; +import { generateMetadata } from '../../../testUtils'; + +export const data: RouterTestData[] = [ { + id: 'router-1736135082961', name: 'iterable', description: 'Test 0', + scenario: 'Default router scenario', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -15,7 +22,10 @@ export const data = [ sentAt: '2022-09-27T11:13:03.777Z', messageId: '9ad41366-8060-4c9f-b181-f6bea67d5469', originalTimestamp: '2022-09-27T11:13:03.777Z', - traits: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, + traits: { + ruchira: 'donaldbaker@ellis.com', + new_field2: 'GB', + }, channel: 'sources', rudderId: '3d51640c-ab09-42c1-b7b2-db6ab433b35e', context: { @@ -29,7 +39,11 @@ export const data = [ }, mappedToDestination: 'true', externalId: [ - { id: 'Tiffany', type: 'ITERABLE-test-ruchira', identifierType: 'itemId' }, + { + id: 'Tiffany', + type: 'ITERABLE-test-ruchira', + identifierType: 'itemId', + }, ], }, timestamp: '2022-09-27T11:12:59.079Z', @@ -38,10 +52,26 @@ export const data = [ recordId: '10', request_ip: '10.1.86.248', }, - metadata: { jobId: 2, userId: 'u1' }, + metadata: generateMetadata(1), destination: { - Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', hubID: '22066036' }, + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', + hubID: '22066036', + }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { @@ -50,7 +80,10 @@ export const data = [ sentAt: '2022-09-27T11:13:03.777Z', messageId: '9ad41366-8060-4c9f-b181-f6bea67d5469', originalTimestamp: '2022-09-27T11:13:03.777Z', - traits: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + traits: { + ruchira: 'abc@ellis.com', + new_field2: 'GB1', + }, channel: 'sources', rudderId: '3d51640c-ab09-42c1-b7b2-db6ab433b35e', context: { @@ -64,7 +97,11 @@ export const data = [ }, mappedToDestination: 'true', externalId: [ - { id: 'ABC', type: 'ITERABLE-test-ruchira', identifierType: 'itemId' }, + { + id: 'ABC', + type: 'ITERABLE-test-ruchira', + identifierType: 'itemId', + }, ], }, timestamp: '2022-09-27T11:12:59.079Z', @@ -73,15 +110,32 @@ export const data = [ recordId: '10', request_ip: '10.1.86.248', }, - metadata: { jobId: 2, userId: 'u1' }, + metadata: generateMetadata(2), destination: { - Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', hubID: '22066036' }, + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', + hubID: '22066036', + }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, ], destType: 'iterable', }, + method: 'POST', }, }, output: { @@ -103,8 +157,14 @@ export const data = [ body: { JSON: { documents: { - Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, - ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + Tiffany: { + ruchira: 'donaldbaker@ellis.com', + new_field2: 'GB', + }, + ABC: { + ruchira: 'abc@ellis.com', + new_field2: 'GB1', + }, }, replaceUploadedFieldsOnly: true, }, @@ -114,16 +174,29 @@ export const data = [ }, files: {}, }, - metadata: [ - { jobId: 2, userId: 'u1' }, - { jobId: 2, userId: 'u1' }, - ], - batched: true, + metadata: [generateMetadata(1), generateMetadata(2)], statusCode: 200, destination: { - Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', hubID: '22066036' }, + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', + hubID: '22066036', + }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, ], }, @@ -131,8 +204,11 @@ export const data = [ }, }, { + id: 'router-1736135082962', name: 'iterable', description: 'routerTest 1', + scenario: 'Default router scenario', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -145,8 +221,15 @@ export const data = [ type: 'track', event: 'Email Opened', sentAt: '2020-08-28T16:26:16.473Z', - context: { library: { name: 'analytics-node', version: '0.0.3' } }, - _metadata: { nodeVersion: '10.22.0' }, + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + _metadata: { + nodeVersion: '10.22.0', + }, messageId: 'node-570110489d3e99b234b18af9a9eca9d4-6009779e-82d7-469d-aaeb-5ccf162b0453', properties: { @@ -157,8 +240,16 @@ export const data = [ anonymousId: 'abcdeeeeeeeexxxx102', originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: { jobId: 2, userId: 'u1' }, + metadata: generateMetadata(2), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', mapToSingleEvent: false, @@ -167,6 +258,11 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { @@ -187,16 +283,29 @@ export const data = [ email: 'manashi@website.com', country: 'India', }, - library: { name: 'analytics-node', version: '0.0.3' }, + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + _metadata: { + nodeVersion: '10.22.0', }, - _metadata: { nodeVersion: '10.22.0' }, messageId: 'node-cc3ef811f686139ee527b806ee0129ef-163a3a88-266f-447e-8cce-34a8f42f8dcd', anonymousId: 'abcdeeeeeeeexxxx102', originalTimestamp: '2020-08-28T16:26:06.462Z', }, - metadata: { jobId: 3, userId: 'u1' }, + metadata: generateMetadata(3), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', mapToSingleEvent: false, @@ -205,6 +314,11 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { @@ -217,14 +331,24 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - traits: { email: 'sayan@gmail.com' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + traits: { + email: 'sayan@gmail.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, type: 'page', messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', @@ -239,12 +363,22 @@ export const data = [ url: '', category: 'test-category', }, - integrations: { All: true }, + integrations: { + All: true, + }, name: 'ApplicationLoaded', sentAt: '2019-10-14T11:15:53.296Z', }, - metadata: { jobId: 4, userId: 'u1' }, + metadata: generateMetadata(4), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '12345', dataCenter: 'USDC', @@ -254,6 +388,11 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { @@ -276,7 +415,9 @@ export const data = [ task_run_id: 'c5tar6cqgmgmcjvupdi0', version: 'release.v1.6.8', }, - device: { token: 54321 }, + device: { + token: 54321, + }, }, messageId: '2f052f7c-f694-4849-a7ed-a432f7ffa0a4', originalTimestamp: '2021-10-28T14:03:50.503Z', @@ -297,7 +438,7 @@ export const data = [ type: 'identify', userId: 'lynnanderson@smith.net', }, - metadata: { jobId: 5, userId: 'u1' }, + metadata: generateMetadata(5), destination: { ID: '1zia9wKshXt80YksLmUdJnr7IHI', Name: 'test_iterable', @@ -337,7 +478,6 @@ export const data = [ transformAt: 'processor', transformAtV1: 'processor', }, - ResponseRules: null, }, Config: { apiKey: '12345', @@ -348,11 +488,12 @@ export const data = [ trackNamedPages: true, }, Enabled: true, + WorkspaceID: 'default-workspace', Transformations: [], + RevisionID: 'default-revision', IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - libraries: [], - request: { query: {} }, }, { message: { @@ -364,14 +505,24 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - traits: { email: 'sayan@gmail.com' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + traits: { + email: 'sayan@gmail.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, event: 'product added', type: 'track', @@ -409,12 +560,22 @@ export const data = [ }, ], }, - integrations: { All: true }, + integrations: { + All: true, + }, name: 'ApplicationLoaded', sentAt: '2019-10-14T11:15:53.296Z', }, - metadata: { jobId: 6, userId: 'u1' }, + metadata: generateMetadata(6), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', dataCenter: 'USDC', @@ -424,14 +585,26 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { message: { type: 'page', sentAt: '2020-08-28T16:26:16.473Z', - context: { library: { name: 'analytics-node', version: '0.0.3' } }, - _metadata: { nodeVersion: '10.22.0' }, + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + _metadata: { + nodeVersion: '10.22.0', + }, messageId: 'node-6f62b91e789a636929ca38aed01c5f6e-103c720d-81bd-4742-98d6-d45a65aed23e', properties: { @@ -442,8 +615,16 @@ export const data = [ anonymousId: 'abcdeeeeeeeexxxx102', originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: { jobId: 7, userId: 'u1' }, + metadata: generateMetadata(7), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', dataCenter: 'USDC', @@ -453,14 +634,26 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { message: { type: 'alias', sentAt: '2020-08-28T16:26:16.473Z', - context: { library: { name: 'analytics-node', version: '0.0.3' } }, - _metadata: { nodeVersion: '10.22.0' }, + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + _metadata: { + nodeVersion: '10.22.0', + }, messageId: 'node-6f62b91e789a636929ca38aed01c5f6e-103c720d-81bd-4742-98d6-d45a65aed23e', properties: { @@ -473,8 +666,16 @@ export const data = [ anonymousId: 'abcdeeeeeeeexxxx102', originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: { jobId: 8, userId: 'u1' }, + metadata: generateMetadata(8), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', dataCenter: 'USDC', @@ -484,11 +685,17 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, ], destType: 'iterable', }, + method: 'POST', }, }, output: { @@ -528,10 +735,17 @@ export const data = [ }, files: {}, }, - metadata: [{ jobId: 2, userId: 'u1' }], - batched: true, + metadata: [generateMetadata(2)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', mapToSingleEvent: false, @@ -540,7 +754,13 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, { batchedRequest: { @@ -576,10 +796,17 @@ export const data = [ }, files: {}, }, - metadata: [{ jobId: 3, userId: 'u1' }], - batched: true, + metadata: [generateMetadata(3)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', mapToSingleEvent: false, @@ -588,7 +815,13 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, { batchedRequest: { @@ -596,7 +829,10 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.iterable.com/api/events/trackBulk', - headers: { 'Content-Type': 'application/json', api_key: '12345' }, + headers: { + 'Content-Type': 'application/json', + api_key: '12345', + }, params: {}, body: { JSON: { @@ -623,10 +859,17 @@ export const data = [ }, files: {}, }, - metadata: [{ jobId: 4, userId: 'u1' }], - batched: true, + metadata: [generateMetadata(4)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '12345', dataCenter: 'USDC', @@ -636,7 +879,13 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, { batchedRequest: { @@ -653,7 +902,9 @@ export const data = [ JSON: { user: { email: 'sayan@gmail.com', - dataFields: { email: 'sayan@gmail.com' }, + dataFields: { + email: 'sayan@gmail.com', + }, userId: '12345', preferUserId: true, mergeNestedObjects: true, @@ -687,10 +938,17 @@ export const data = [ }, files: {}, }, - metadata: [{ jobId: 6, userId: 'u1' }], - batched: false, + metadata: [generateMetadata(6)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', dataCenter: 'USDC', @@ -700,7 +958,13 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: false, }, { batchedRequest: { @@ -734,10 +998,17 @@ export const data = [ }, files: {}, }, - metadata: [{ jobId: 7, userId: 'u1' }], - batched: true, + metadata: [generateMetadata(7)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', dataCenter: 'USDC', @@ -747,7 +1018,13 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, { batchedRequest: { @@ -761,17 +1038,27 @@ export const data = [ }, params: {}, body: { - JSON: { currentEmail: 'old@email.com', newEmail: 'new@email.com' }, + JSON: { + currentEmail: 'old@email.com', + newEmail: 'new@email.com', + }, JSON_ARRAY: {}, XML: {}, FORM: {}, }, files: {}, }, - metadata: [{ jobId: 8, userId: 'u1' }], - batched: false, + metadata: [generateMetadata(8)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', dataCenter: 'USDC', @@ -781,7 +1068,13 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: false, }, { batchedRequest: { @@ -789,7 +1082,10 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.iterable.com/api/users/bulkUpdate', - headers: { 'Content-Type': 'application/json', api_key: '12345' }, + headers: { + 'Content-Type': 'application/json', + api_key: '12345', + }, params: {}, body: { JSON: { @@ -817,8 +1113,7 @@ export const data = [ }, files: {}, }, - metadata: [{ jobId: 5, userId: 'u1' }], - batched: true, + metadata: [generateMetadata(5)], statusCode: 200, destination: { ID: '1zia9wKshXt80YksLmUdJnr7IHI', @@ -859,7 +1154,6 @@ export const data = [ transformAt: 'processor', transformAtV1: 'processor', }, - ResponseRules: null, }, Config: { apiKey: '12345', @@ -870,9 +1164,13 @@ export const data = [ trackNamedPages: true, }, Enabled: true, + WorkspaceID: 'default-workspace', Transformations: [], + RevisionID: 'default-revision', IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, ], }, @@ -880,8 +1178,11 @@ export const data = [ }, }, { + id: 'router-1736135082962', name: 'iterable', description: 'Simple identify call with EUDC dataCenter', + scenario: 'Default router scenario', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -895,7 +1196,10 @@ export const data = [ sentAt: '2022-09-27T11:13:03.777Z', messageId: '9ad41366-8060-4c9f-b181-f6bea67d5469', originalTimestamp: '2022-09-27T11:13:03.777Z', - traits: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, + traits: { + ruchira: 'donaldbaker@ellis.com', + new_field2: 'GB', + }, channel: 'sources', rudderId: '3d51640c-ab09-42c1-b7b2-db6ab433b35e', context: { @@ -909,7 +1213,11 @@ export const data = [ }, mappedToDestination: 'true', externalId: [ - { id: 'Tiffany', type: 'ITERABLE-test-ruchira', identifierType: 'itemId' }, + { + id: 'Tiffany', + type: 'ITERABLE-test-ruchira', + identifierType: 'itemId', + }, ], }, timestamp: '2022-09-27T11:12:59.079Z', @@ -918,14 +1226,27 @@ export const data = [ recordId: '10', request_ip: '10.1.86.248', }, - metadata: { jobId: 2, userId: 'u1' }, + metadata: generateMetadata(1), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', dataCenter: 'EUDC', hubID: '22066036', }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { @@ -934,7 +1255,10 @@ export const data = [ sentAt: '2022-09-27T11:13:03.777Z', messageId: '9ad41366-8060-4c9f-b181-f6bea67d5469', originalTimestamp: '2022-09-27T11:13:03.777Z', - traits: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + traits: { + ruchira: 'abc@ellis.com', + new_field2: 'GB1', + }, channel: 'sources', rudderId: '3d51640c-ab09-42c1-b7b2-db6ab433b35e', context: { @@ -948,7 +1272,11 @@ export const data = [ }, mappedToDestination: 'true', externalId: [ - { id: 'ABC', type: 'ITERABLE-test-ruchira', identifierType: 'itemId' }, + { + id: 'ABC', + type: 'ITERABLE-test-ruchira', + identifierType: 'itemId', + }, ], }, timestamp: '2022-09-27T11:12:59.079Z', @@ -957,19 +1285,33 @@ export const data = [ recordId: '10', request_ip: '10.1.86.248', }, - metadata: { jobId: 2, userId: 'u1' }, + metadata: generateMetadata(2), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', dataCenter: 'EUDC', hubID: '22066036', }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, ], destType: 'iterable', }, + method: 'POST', }, }, output: { @@ -991,8 +1333,14 @@ export const data = [ body: { JSON: { documents: { - Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, - ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + Tiffany: { + ruchira: 'donaldbaker@ellis.com', + new_field2: 'GB', + }, + ABC: { + ruchira: 'abc@ellis.com', + new_field2: 'GB1', + }, }, replaceUploadedFieldsOnly: true, }, @@ -1002,20 +1350,159 @@ export const data = [ }, files: {}, }, - metadata: [ - { jobId: 2, userId: 'u1' }, - { jobId: 2, userId: 'u1' }, - ], - batched: true, + metadata: [generateMetadata(1), generateMetadata(2)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', dataCenter: 'EUDC', hubID: '22066036', }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, + }, + ], + }, + }, + }, + }, + { + id: 'router-1736135082963', + name: 'iterable', + description: 'Already transformed event sent in the message body', + scenario: 'Default router scenario', + successCriteria: 'Router test should pass successfully', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + statusCode: 200, + version: '1', + type: 'REST' as MessageType, + method: 'POST', + endpoint: 'https://api.eu.iterable.com/api/catalogs/test-ruchira/items', + headers: { + 'Content-Type': 'application/json', + api_key: '583af2f8-15ba-49c0-8511-76383e7de07e', + }, + params: {}, + body: { + JSON: { + documents: { + Tiffany: { + ruchira: 'donaldbaker@ellis.com', + new_field2: 'GB', + }, + ABC: { + ruchira: 'abc@ellis.com', + new_field2: 'GB1', + }, + }, + replaceUploadedFieldsOnly: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: generateMetadata(4), + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', + hubID: '22066036', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + destType: 'iterable', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: true, + batchedRequest: { + body: { + FORM: {}, + JSON: { + documents: {}, + replaceUploadedFieldsOnly: true, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.eu.iterable.com/api/catalogs/test-ruchira/items', + files: {}, + headers: { + 'Content-Type': 'application/json', + api_key: '583af2f8-15ba-49c0-8511-76383e7de07e', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + }, + destination: { + Config: { + apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', + hubID: '22066036', + }, + DestinationDefinition: { + Config: {}, + DisplayName: 'Default Display Name', + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + }, + Enabled: true, + ID: 'default-destination-id', + IsConnectionEnabled: true, + IsProcessorEnabled: true, + Name: 'Default Destination', + RevisionID: 'default-revision', + Transformations: [], + WorkspaceID: 'default-workspace', + }, + metadata: [generateMetadata(4)], + statusCode: 200, }, ], }, diff --git a/test/integrations/destinations/june/maskedSecrets.ts b/test/integrations/destinations/june/maskedSecrets.ts new file mode 100644 index 00000000000..c5a4dc839e8 --- /dev/null +++ b/test/integrations/destinations/june/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${secret1}`; diff --git a/test/integrations/destinations/june/processor/data.ts b/test/integrations/destinations/june/processor/data.ts index dfe35ed0a34..1f7772d5aaa 100644 --- a/test/integrations/destinations/june/processor/data.ts +++ b/test/integrations/destinations/june/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'june', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -64,7 +65,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -100,7 +101,7 @@ export const data = [ endpoint: 'https://api.june.so/api/identify', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { @@ -139,7 +140,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -194,7 +195,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -229,7 +230,7 @@ export const data = [ endpoint: 'https://api.june.so/api/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { @@ -270,7 +271,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -299,7 +300,7 @@ export const data = [ endpoint: 'https://api.june.so/api/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { @@ -334,7 +335,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -370,7 +371,7 @@ export const data = [ endpoint: 'https://api.june.so/api/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { @@ -414,7 +415,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -457,7 +458,7 @@ export const data = [ endpoint: 'https://api.june.so/api/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { @@ -501,7 +502,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -538,7 +539,7 @@ export const data = [ endpoint: 'https://api.june.so/api/group', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { @@ -581,7 +582,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -635,7 +636,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -690,7 +691,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -725,7 +726,7 @@ export const data = [ endpoint: 'https://api.june.so/api/page', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/june/router/data.ts b/test/integrations/destinations/june/router/data.ts index 81e5c6eb5aa..275ecd2bd62 100644 --- a/test/integrations/destinations/june/router/data.ts +++ b/test/integrations/destinations/june/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'fb', @@ -10,7 +11,7 @@ export const data = [ body: { input: [ { - destination: { Config: { apiKey: '93EMyDLvfpbRxxYn' }, ID: 'june123' }, + destination: { Config: { apiKey: secret1 }, ID: 'june123' }, metadata: { jobId: 1, userId: 'u1' }, message: { type: 'identify', @@ -24,7 +25,7 @@ export const data = [ }, }, { - destination: { Config: { apiKey: '93EMyDLvfpbRxxYn' }, ID: 'june123' }, + destination: { Config: { apiKey: secret1 }, ID: 'june123' }, metadata: { jobId: 2, userId: 'u1' }, message: { type: 'track', @@ -69,7 +70,7 @@ export const data = [ endpoint: 'https://api.june.so/api/identify', files: {}, headers: { - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -77,12 +78,12 @@ export const data = [ type: 'REST', version: '1', }, - destination: { Config: { apiKey: '93EMyDLvfpbRxxYn' }, ID: 'june123' }, + destination: { Config: { apiKey: secret1 }, ID: 'june123' }, metadata: [{ jobId: 1, userId: 'u1' }], statusCode: 200, }, { - destination: { Config: { apiKey: '93EMyDLvfpbRxxYn' }, ID: 'june123' }, + destination: { Config: { apiKey: secret1 }, ID: 'june123' }, batched: false, error: 'Missing required value from "userIdOnly"', metadata: [{ jobId: 2, userId: 'u1' }], diff --git a/test/integrations/destinations/klaviyo/maskedSecrets.ts b/test/integrations/destinations/klaviyo/maskedSecrets.ts new file mode 100644 index 00000000000..333e6fa6b79 --- /dev/null +++ b/test/integrations/destinations/klaviyo/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secretBadApiKey = path.basename(__dirname) + 2; + +export const authHeader1 = `Klaviyo-API-Key ${secret1}`; +export const authHeaderBadApiKey = `Klaviyo-API-Key ${secretBadApiKey}`; diff --git a/test/integrations/destinations/klaviyo/network.ts b/test/integrations/destinations/klaviyo/network.ts index d76d235c6f3..0b19ad781ed 100644 --- a/test/integrations/destinations/klaviyo/network.ts +++ b/test/integrations/destinations/klaviyo/network.ts @@ -1,3 +1,5 @@ +import { authHeaderBadApiKey } from './maskedSecrets'; + export const networkCallsData = [ { httpReq: { @@ -51,7 +53,7 @@ export const networkCallsData = [ httpReq: { url: 'https://a.klaviyo.com/api/profiles', method: 'POST', - headers: { Authorization: 'Klaviyo-API-Key dummyPrivateApiKeyforfailure' }, + headers: { Authorization: authHeaderBadApiKey }, }, httpRes: {}, }, diff --git a/test/integrations/destinations/klaviyo/processor/ecomTestData.ts b/test/integrations/destinations/klaviyo/processor/ecomTestData.ts index 34eff45232a..7b1d7b802e3 100644 --- a/test/integrations/destinations/klaviyo/processor/ecomTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/ecomTestData.ts @@ -1,6 +1,7 @@ import { overrideDestination, transformResultBuilder, generateMetadata } from '../../../testUtils'; import { ProcessorTestData } from '../../../testTypes'; import { Destination } from '../../../../../src/types'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -13,7 +14,7 @@ const destination: Destination = { }, Config: { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -33,7 +34,7 @@ const commonTraits = { const eventsEndpoint = 'https://a.klaviyo.com/api/events'; const commonOutputHeaders = { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2023-02-22', @@ -80,6 +81,7 @@ export const ecomTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -188,6 +190,7 @@ export const ecomTestData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { @@ -300,6 +303,7 @@ export const ecomTestData: ProcessorTestData[] = [ metadata: generateMetadata(3), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/groupTestData.ts b/test/integrations/destinations/klaviyo/processor/groupTestData.ts index 0002f7ce90e..92ddd163402 100644 --- a/test/integrations/destinations/klaviyo/processor/groupTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/groupTestData.ts @@ -5,7 +5,7 @@ import { generateSimplifiedGroupPayload, transformResultBuilder, } from '../../../testUtils'; - +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', Name: 'klaviyo', @@ -17,7 +17,7 @@ const destination: Destination = { }, Config: { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -26,7 +26,7 @@ const destination: Destination = { const headers = { Accept: 'application/json', - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', revision: '2023-02-22', }; @@ -67,6 +67,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -131,6 +132,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts index da7769b1105..bc99a19b53d 100644 --- a/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts @@ -5,6 +5,7 @@ import { generateSimplifiedGroupPayload, transformResultBuilder, } from '../../../testUtils'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -17,7 +18,7 @@ const destination: Destination = { }, Config: { apiVersion: 'v2', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, consent: ['email'], }, Enabled: true, @@ -26,7 +27,7 @@ const destination: Destination = { }; const headers = { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2024-06-15', @@ -108,6 +109,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -168,6 +170,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -228,6 +231,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/identifyTestData.ts b/test/integrations/destinations/klaviyo/processor/identifyTestData.ts index 0dd47511330..3b099f76e32 100644 --- a/test/integrations/destinations/klaviyo/processor/identifyTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/identifyTestData.ts @@ -7,6 +7,7 @@ import { } from '../../../testUtils'; import { ProcessorTestData } from '../../../testTypes'; import { Destination } from '../../../../../src/types'; +import { secret1, authHeader1, secretBadApiKey } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -19,7 +20,7 @@ const destination: Destination = { }, Config: { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -90,7 +91,7 @@ const commonOutputSubscriptionProps = { }; const commonOutputHeaders = { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2023-02-22', @@ -133,6 +134,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -212,6 +214,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { @@ -279,7 +282,7 @@ export const identifyData: ProcessorTestData[] = [ { destination: overrideDestination(destination, { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKeyforfailure', + privateApiKey: secretBadApiKey, }), message: generateSimplifiedIdentifyPayload({ sentAt, @@ -296,6 +299,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(3), }, ], + method: 'POST', }, }, output: { @@ -303,8 +307,10 @@ export const identifyData: ProcessorTestData[] = [ status: 200, body: [ { - error: - '{"message":"Failed to create user due to \\"\\"","destinationResponse":"\\"\\""}', + error: JSON.stringify({ + message: 'Failed to create user due to ""', + destinationResponse: '""', + }), statTags: { destType: 'KLAVIYO', errorCategory: 'network', @@ -352,6 +358,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(4), }, ], + method: 'POST', }, }, output: { @@ -406,6 +413,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(5), }, ], + method: 'POST', }, }, output: { @@ -488,6 +496,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(6), }, ], + method: 'POST', }, }, output: { @@ -565,6 +574,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(7), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts index 612bfe88f89..a5e3ae7ee16 100644 --- a/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts @@ -7,6 +7,7 @@ import { } from '../../../testUtils'; import { ProcessorTestData } from '../../../testTypes'; import { Destination } from '../../../../../src/types'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -19,7 +20,7 @@ const destination: Destination = { }, Config: { apiVersion: 'v2', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -110,7 +111,7 @@ const subscriptionRelations = { }; const commonOutputHeaders = { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2024-06-15', @@ -162,6 +163,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { @@ -254,6 +256,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { @@ -357,6 +360,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(4), }, ], + method: 'POST', }, }, output: { @@ -424,6 +428,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(5), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/screenTestData.ts b/test/integrations/destinations/klaviyo/processor/screenTestData.ts index 0a20110236b..24b3695eba9 100644 --- a/test/integrations/destinations/klaviyo/processor/screenTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/screenTestData.ts @@ -5,6 +5,7 @@ import { generateSimplifiedPageOrScreenPayload, transformResultBuilder, } from '../../../testUtils'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -17,7 +18,7 @@ const destination: Destination = { }, Config: { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -67,6 +68,7 @@ export const screenTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -79,7 +81,7 @@ export const screenTestData: ProcessorTestData[] = [ endpoint: 'https://a.klaviyo.com/api/events', headers: { Accept: 'application/json', - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', revision: '2023-02-22', }, diff --git a/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts index 5ccbed600c1..7195c4836aa 100644 --- a/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts @@ -5,7 +5,7 @@ import { generateSimplifiedPageOrScreenPayload, transformResultBuilder, } from '../../../testUtils'; - +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', Name: 'klaviyo', @@ -17,7 +17,7 @@ const destination: Destination = { }, Config: { apiVersion: 'v2', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -55,7 +55,7 @@ export const screenTestData: ProcessorTestData[] = [ id: 'user@1', age: '22', email: 'test@rudderstack.com', - phone: '9112340375', + phone: '+9112340375', anonymousId: '9c6bd77ea9da3e68', append1: 'value1', }, @@ -75,6 +75,7 @@ export const screenTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -87,7 +88,7 @@ export const screenTestData: ProcessorTestData[] = [ endpoint: 'https://a.klaviyo.com/api/events', headers: { Accept: 'application/json', - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', revision: '2024-06-15', }, @@ -124,7 +125,7 @@ export const screenTestData: ProcessorTestData[] = [ }, }, }, - phone_number: '9112340375', + phone_number: '+9112340375', properties: { id: 'user@1', age: '22', diff --git a/test/integrations/destinations/klaviyo/processor/trackTestData.ts b/test/integrations/destinations/klaviyo/processor/trackTestData.ts index 3bc2b1747ad..50a76f3144b 100644 --- a/test/integrations/destinations/klaviyo/processor/trackTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/trackTestData.ts @@ -7,6 +7,7 @@ import { overrideDestination, transformResultBuilder, } from '../../../testUtils'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -19,7 +20,7 @@ const destination: Destination = { }, Config: { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -40,7 +41,7 @@ const commonProps = { const commonOutputHeaders = { Accept: 'application/json', - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', revision: '2023-02-22', }; @@ -88,6 +89,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -170,6 +172,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { @@ -244,6 +247,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(3), }, ], + method: 'POST', }, }, output: { @@ -312,6 +316,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(4), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts index ecea141d386..8fb6ec84785 100644 --- a/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts @@ -7,7 +7,7 @@ import { overrideDestination, transformResultBuilder, } from '../../../testUtils'; - +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', Name: 'klaviyo', @@ -18,7 +18,7 @@ const destination: Destination = { Config: {}, }, Config: { - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, apiVersion: 'v2', }, Enabled: true, @@ -40,13 +40,13 @@ const commonProps = { const commonOutputHeaders = { Accept: 'application/json', - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', revision: '2024-06-15', }; const profileAttributes = { email: 'test@rudderstack.com', - phone_number: '9112340375', + phone_number: '+9112340375', anonymous_id: '9c6bd77ea9da3e68', properties: { age: '22', @@ -86,7 +86,7 @@ export const trackTestData: ProcessorTestData[] = [ ...commonTraits, name: 'Test', email: 'test@rudderstack.com', - phone: '9112340375', + phone: '+9112340375', description: 'Sample description', }, }, @@ -101,6 +101,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { @@ -173,7 +174,7 @@ export const trackTestData: ProcessorTestData[] = [ description: 'Sample description', name: 'Test', email: 'test@rudderstack.com', - phone: '9112340375', + phone: '+9112340375', }, }, properties: commonProps, @@ -183,6 +184,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(3), }, ], + method: 'POST', }, }, output: { @@ -255,7 +257,7 @@ export const trackTestData: ProcessorTestData[] = [ description: 'Sample description', name: 'Test', email: 'test@rudderstack.com', - phone: '9112340375', + phone: '+9112340375', }, }, properties: { ...commonProps, value: { price: 9.99 } }, @@ -265,6 +267,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -290,4 +293,65 @@ export const trackTestData: ProcessorTestData[] = [ }, }, }, + { + id: 'klaviyo-track-150624-test-4', + name: 'klaviyo', + description: '150624 -> Track event call, with phone not in E.164 format', + scenario: 'Business', + successCriteria: + 'Response should an error message and status code should be 400, as Phone number is not in E.164 format.', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: overrideDestination(destination, { enforceEmailAsPrimary: true }), + message: generateSimplifiedTrackPayload({ + type: 'track', + event: 'TestEven001', + sentAt: '2025-01-01T11:11:11.111Z', + userId: 'invalidPhoneUser', + context: { + traits: { + ...commonTraits, + description: 'Sample description', + name: 'Test', + email: 'test@rudderstack.com', + phone: '9112340375', + }, + }, + properties: commonProps, + originalTimestamp: '2025-01-01T11:11:11.111Z', + }), + metadata: generateMetadata(4), + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Phone number is not in E.164 format.', + statTags: { + destType: 'KLAVIYO', + destinationId: 'default-destinationId', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspaceId', + }, + statusCode: 400, + metadata: generateMetadata(4), + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/klaviyo/processor/validationTestData.ts b/test/integrations/destinations/klaviyo/processor/validationTestData.ts index 801e03d5417..868ca760eb5 100644 --- a/test/integrations/destinations/klaviyo/processor/validationTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/validationTestData.ts @@ -1,6 +1,7 @@ -import { Destination } from '../../../../../src/types'; +import { Destination, MessageType } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; +import { secret1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -13,7 +14,7 @@ const destination: Destination = { }, Config: { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -38,7 +39,7 @@ export const validationTestData: ProcessorTestData[] = [ destination, message: { userId: 'user123', - type: 'random', + type: 'random' as MessageType, groupId: 'XUepkK', traits: { subscribe: true, @@ -55,6 +56,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts index 10e2d15db0d..762861a3500 100644 --- a/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts @@ -1,7 +1,7 @@ -import { Destination } from '../../../../../src/types'; +import { Destination, MessageType } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; - +import { secret1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', Name: 'klaviyo', @@ -12,7 +12,7 @@ const destination: Destination = { Config: {}, }, Config: { - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, apiVersion: 'v2', }, Enabled: true, @@ -38,7 +38,7 @@ export const validationTestData: ProcessorTestData[] = [ destination, message: { userId: 'user123', - type: 'random', + type: 'random' as MessageType, groupId: 'XUepkK', traits: { subscribe: true, @@ -55,6 +55,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/router/commonConfig.ts b/test/integrations/destinations/klaviyo/router/commonConfig.ts index a1297635eb9..f2ccfbf11a8 100644 --- a/test/integrations/destinations/klaviyo/router/commonConfig.ts +++ b/test/integrations/destinations/klaviyo/router/commonConfig.ts @@ -1,5 +1,11 @@ import { generateMetadata } from '../../../testUtils'; -import { Destination, RouterTransformationRequest } from '../../../../../src/types'; +import { + Destination, + RouterTransformationRequest, + RouterTransformationRequestData, +} from '../../../../../src/types'; +import { secret1 } from '../maskedSecrets'; + const destination: Destination = { ID: '123', Name: 'klaviyo', @@ -10,7 +16,7 @@ const destination: Destination = { Config: {}, }, Config: { - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -26,7 +32,7 @@ const destinationV2: Destination = { Config: {}, }, Config: { - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, apiVersion: 'v2', }, Enabled: true, @@ -190,10 +196,10 @@ const getRequest = (apiVersion) => { ]; }; export const routerRequest: RouterTransformationRequest = { - input: getRequest('v1'), + input: getRequest('v1') as unknown as RouterTransformationRequestData[], destType: 'klaviyo', }; export const routerRequestV2: RouterTransformationRequest = { - input: getRequest('v2'), + input: getRequest('v2') as unknown as RouterTransformationRequestData[], destType: 'klaviyo', }; diff --git a/test/integrations/destinations/klaviyo/router/data.ts b/test/integrations/destinations/klaviyo/router/data.ts index 1b3f7f39ada..937c49983c5 100644 --- a/test/integrations/destinations/klaviyo/router/data.ts +++ b/test/integrations/destinations/klaviyo/router/data.ts @@ -3,6 +3,7 @@ import { RouterTestData } from '../../../testTypes'; import { routerRequest } from './commonConfig'; import { generateMetadata } from '../../../testUtils'; import { dataV2 } from './dataV2'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -14,7 +15,7 @@ const destination: Destination = { Config: {}, }, Config: { - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -34,6 +35,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest, + method: 'POST', }, }, output: { @@ -49,7 +51,7 @@ export const data: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2023-02-22', @@ -87,7 +89,7 @@ export const data: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2023-02-22', @@ -121,7 +123,7 @@ export const data: RouterTestData[] = [ method: 'PATCH', endpoint: 'https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2023-02-22', @@ -169,7 +171,7 @@ export const data: RouterTestData[] = [ method: 'PATCH', endpoint: 'https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2023-02-22', diff --git a/test/integrations/destinations/klaviyo/router/dataV2.ts b/test/integrations/destinations/klaviyo/router/dataV2.ts index 5a0a06fad10..70371f2d421 100644 --- a/test/integrations/destinations/klaviyo/router/dataV2.ts +++ b/test/integrations/destinations/klaviyo/router/dataV2.ts @@ -1,7 +1,8 @@ -import { Destination } from '../../../../../src/types'; +import { Destination, RouterTransformationRequestData } from '../../../../../src/types'; import { RouterTestData } from '../../../testTypes'; import { routerRequestV2 } from './commonConfig'; import { generateMetadata, transformResultBuilder } from '../../../testUtils'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -13,7 +14,7 @@ const destination: Destination = { Config: {}, }, Config: { - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, apiVersion: 'v2', }, Enabled: true, @@ -23,7 +24,7 @@ const destination: Destination = { const userProfileCommonEndpoint = 'https://a.klaviyo.com/api/profile-import'; const headers = { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2024-06-15', @@ -73,7 +74,7 @@ const alreadyTransformedEvent = { }, metadata: generateMetadata(10), destination, -}; +} as unknown as RouterTransformationRequestData; export const dataV2: RouterTestData[] = [ { @@ -89,6 +90,7 @@ export const dataV2: RouterTestData[] = [ input: { request: { body: routerRequestV2, + method: 'POST', }, }, output: { @@ -422,6 +424,7 @@ export const dataV2: RouterTestData[] = [ ], destType: 'klaviyo', }, + method: 'POST', }, }, output: { @@ -694,6 +697,7 @@ export const dataV2: RouterTestData[] = [ ], destType: 'klaviyo', }, + method: 'POST', }, }, output: { @@ -728,7 +732,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/events', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -787,7 +791,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/events', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -844,7 +848,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-import', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -878,7 +882,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-import', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -911,7 +915,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2024-06-15', @@ -982,7 +986,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/events', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1113,6 +1117,7 @@ export const dataV2: RouterTestData[] = [ ], destType: 'klaviyo', }, + method: 'POST', }, }, output: { @@ -1128,7 +1133,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-import', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1162,7 +1167,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2024-06-15', @@ -1221,7 +1226,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-import', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1371,6 +1376,7 @@ export const dataV2: RouterTestData[] = [ ], destType: 'klaviyo', }, + method: 'POST', }, }, output: { @@ -1734,6 +1740,7 @@ export const dataV2: RouterTestData[] = [ ], destType: 'klaviyo', }, + method: 'POST', }, }, output: { @@ -1749,7 +1756,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/events', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1808,7 +1815,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/events', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1865,7 +1872,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-import', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1899,7 +1906,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-import', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1932,7 +1939,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-delete-jobs', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2024-06-15', @@ -1989,7 +1996,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/events', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -2044,4 +2051,108 @@ export const dataV2: RouterTestData[] = [ }, }, }, + { + id: 'klaviyo-router-150624-test-7', + name: 'klaviyo', + description: + '150624 -> Router tests to check for invalid phone number format in identify and track calls and should throw error', + scenario: 'Framework', + successCriteria: 'Should throw invalid phone number error for identify and track calls', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + userId: 'user123', + type: 'identify', + traits: { subscribe: true }, + context: { + traits: { + email: 'test@rudderstack.com', + phone: '123321000', + consent: 'email', + }, + ip: '14.5.67.21', + library: { name: 'http' }, + }, + timestamp: '2020-01-21T00:21:34.208Z', + }, + destination, + metadata: generateMetadata(1), + }, + { + message: { + type: 'track', + event: 'TestEven001', + sentAt: '2025-01-01T11:11:11.111Z', + userId: 'invalidPhoneUser', + context: { + traits: { + name: 'Test', + email: 'test@rudderstack.com', + phone: '9112340375', + }, + }, + properties: { + price: 120, + }, + originalTimestamp: '2025-01-01T11:11:11.111Z', + }, + metadata: generateMetadata(2), + destination, + }, + ], + destType: 'klaviyo', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + error: 'Phone number is not in E.164 format.', + statTags: { + destType: 'KLAVIYO', + destinationId: 'default-destinationId', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspaceId', + }, + metadata: [generateMetadata(1)], + batched: false, + statusCode: 400, + destination, + }, + { + error: 'Phone number is not in E.164 format.', + statTags: { + destType: 'KLAVIYO', + destinationId: 'default-destinationId', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspaceId', + }, + metadata: [generateMetadata(2)], + batched: false, + statusCode: 400, + destination, + }, + ], + }, + }, + }, + }, ]; diff --git a/test/integrations/destinations/koddi/processor/clicks.ts b/test/integrations/destinations/koddi/processor/clicks.ts index 6101e9bafef..0b27c424425 100644 --- a/test/integrations/destinations/koddi/processor/clicks.ts +++ b/test/integrations/destinations/koddi/processor/clicks.ts @@ -40,6 +40,7 @@ export const clicks: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/koddi/processor/conversions.ts b/test/integrations/destinations/koddi/processor/conversions.ts index 1647ffed7db..f4516bfb984 100644 --- a/test/integrations/destinations/koddi/processor/conversions.ts +++ b/test/integrations/destinations/koddi/processor/conversions.ts @@ -52,6 +52,7 @@ export const conversions: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -122,6 +123,7 @@ export const conversions: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/koddi/processor/impressions.ts b/test/integrations/destinations/koddi/processor/impressions.ts index 840ed9139fc..90c1d6b6ae7 100644 --- a/test/integrations/destinations/koddi/processor/impressions.ts +++ b/test/integrations/destinations/koddi/processor/impressions.ts @@ -40,6 +40,7 @@ export const impressions: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/kustomer/maskedSecrets.ts b/test/integrations/destinations/kustomer/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/kustomer/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/kustomer/processor/data.ts b/test/integrations/destinations/kustomer/processor/data.ts index ba8407baaff..5ba9964f6a8 100644 --- a/test/integrations/destinations/kustomer/processor/data.ts +++ b/test/integrations/destinations/kustomer/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'kustomer', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -105,7 +106,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/customers', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -188,7 +189,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -248,7 +249,7 @@ export const data = [ 'https://api.kustomerapp.com/v1/customers/58210c3db0f09110006b7953?replace=false', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -289,7 +290,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -365,7 +366,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -407,7 +408,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -486,7 +487,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -533,7 +534,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -612,7 +613,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -660,7 +661,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -730,7 +731,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -773,7 +774,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -842,7 +843,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -885,7 +886,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, genericPage: true, }, }, @@ -958,7 +959,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1004,7 +1005,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, genericScreen: true, }, }, @@ -1081,7 +1082,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1123,7 +1124,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -1218,7 +1219,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/customers', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1301,7 +1302,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -1401,7 +1402,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/customers', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1484,7 +1485,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -1590,7 +1591,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/customers/abcd1234?replace=false', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1673,7 +1674,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, genericScreen: true, }, }, @@ -1749,7 +1750,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1791,7 +1792,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, baseEndpoint: 'https://api.prod2.kustomerapp.com', genericScreen: true, }, @@ -1868,7 +1869,7 @@ export const data = [ endpoint: 'https://api.prod2.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/kustomer/router/data.ts b/test/integrations/destinations/kustomer/router/data.ts index 06f6243cf20..e5fdc384b08 100644 --- a/test/integrations/destinations/kustomer/router/data.ts +++ b/test/integrations/destinations/kustomer/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'kustomer', @@ -77,7 +78,7 @@ export const data = [ }, metadata: { jobId: 1, userId: 'u1' }, destination: { - Config: { apiKey: 'dummyApiKey', genericPage: false, genericScreen: false }, + Config: { apiKey: secret1, genericPage: false, genericScreen: false }, }, }, { @@ -124,7 +125,7 @@ export const data = [ }, metadata: { jobId: 2, userId: 'u1' }, destination: { - Config: { apiKey: 'dummyApiKey', genericPage: false, genericScreen: false }, + Config: { apiKey: secret1, genericPage: false, genericScreen: false }, }, }, { @@ -173,7 +174,7 @@ export const data = [ destination: { Config: { baseEndpoint: 'https://api.prod2.kustomerapp.com', - apiKey: 'dummyApiKey', + apiKey: secret1, genericPage: false, genericScreen: false, }, @@ -197,7 +198,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/customers', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -246,7 +247,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'dummyApiKey', genericPage: false, genericScreen: false }, + Config: { apiKey: secret1, genericPage: false, genericScreen: false }, }, }, { @@ -257,7 +258,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -280,7 +281,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'dummyApiKey', genericPage: false, genericScreen: false }, + Config: { apiKey: secret1, genericPage: false, genericScreen: false }, }, }, { @@ -291,7 +292,7 @@ export const data = [ endpoint: 'https://api.prod2.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -316,7 +317,7 @@ export const data = [ destination: { Config: { baseEndpoint: 'https://api.prod2.kustomerapp.com', - apiKey: 'dummyApiKey', + apiKey: secret1, genericPage: false, genericScreen: false, }, diff --git a/test/integrations/destinations/lambda/processor/data.ts b/test/integrations/destinations/lambda/processor/data.ts index 540de25417d..b6149139964 100644 --- a/test/integrations/destinations/lambda/processor/data.ts +++ b/test/integrations/destinations/lambda/processor/data.ts @@ -238,8 +238,22 @@ export const data = [ resultSetID: 10, }, output: { - payload: - '{"type":"identify","sentAt":"2022-08-03T10:44:55.382+05:30","userId":"user113","context":{"os":{"name":"android"},"device":{"name":"Mi","token":"qwertyuioprtyuiop"},"traits":{"name":"User2","email":"user112@mail.com"}},"rudderId":"ed33ef22-569d-44b1-a6cb-063c69dca8f0","messageId":"29beef33-2771-45fd-adb4-4376aa6d72d9","timestamp":"2022-08-03T10:44:54.942+05:30","receivedAt":"2022-08-03T10:44:54.943+05:30","request_ip":"[::1]","originalTimestamp":"2022-08-03T10:44:55.382+05:30"}', + payload: JSON.stringify({ + type: 'identify', + sentAt: '2022-08-03T10:44:55.382+05:30', + userId: 'user113', + context: { + os: { name: 'android' }, + device: { name: 'Mi', token: 'qwertyuioprtyuiop' }, + traits: { name: 'User2', email: 'user112@mail.com' }, + }, + rudderId: 'ed33ef22-569d-44b1-a6cb-063c69dca8f0', + messageId: '29beef33-2771-45fd-adb4-4376aa6d72d9', + timestamp: '2022-08-03T10:44:54.942+05:30', + receivedAt: '2022-08-03T10:44:54.943+05:30', + request_ip: '[::1]', + originalTimestamp: '2022-08-03T10:44:55.382+05:30', + }), destConfig: { clientContext: '', invocationType: 'Event', lambda: 'testFunction' }, userId: '', }, diff --git a/test/integrations/destinations/lambda/router/data.ts b/test/integrations/destinations/lambda/router/data.ts index cba30e09747..ba580f0d335 100644 --- a/test/integrations/destinations/lambda/router/data.ts +++ b/test/integrations/destinations/lambda/router/data.ts @@ -29834,8 +29834,41 @@ export const data = [ }, { batchedRequest: { - payload: - '[{"name":"Screen View","type":"screen","sentAt":"2022-08-18T08:43:15.539+05:30","userId":"identified user id","context":{"ip":"14.5.67.21","library":{"name":"http"}},"rudderId":"daf823fb-e8d3-413a-8313-d34cd756f968","messageId":"1b8ee4c3-ffad-4457-b453-31b32da1dfea","timestamp":"2020-02-02T00:23:09.544Z","properties":{"prop1":"5"},"receivedAt":"2022-08-18T08:43:13.521+05:30","request_ip":"[::1]","anonymousId":"anon-id-new","originalTimestamp":"2022-08-18T08:43:15.539+05:30"},{"type":"group","sentAt":"2022-08-18T08:43:15.539+05:30","traits":{"name":"Company","industry":"Industry","employees":123},"userId":"user123","context":{"ip":"14.5.67.21","traits":{"trait1":"new-val"},"library":{"name":"http"}},"groupId":"group1","rudderId":"bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5","messageId":"2c59b527-3235-4fc2-9680-f41ec52ebb51","timestamp":"2020-01-21T00:21:34.208Z","receivedAt":"2022-08-18T08:43:13.521+05:30","request_ip":"[::1]","originalTimestamp":"2022-08-18T08:43:15.539+05:30"}]', + payload: JSON.stringify([ + { + name: 'Screen View', + type: 'screen', + sentAt: '2022-08-18T08:43:15.539+05:30', + userId: 'identified user id', + context: { ip: '14.5.67.21', library: { name: 'http' } }, + rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968', + messageId: '1b8ee4c3-ffad-4457-b453-31b32da1dfea', + timestamp: '2020-02-02T00:23:09.544Z', + properties: { prop1: '5' }, + receivedAt: '2022-08-18T08:43:13.521+05:30', + request_ip: '[::1]', + anonymousId: 'anon-id-new', + originalTimestamp: '2022-08-18T08:43:15.539+05:30', + }, + { + type: 'group', + sentAt: '2022-08-18T08:43:15.539+05:30', + traits: { name: 'Company', industry: 'Industry', employees: 123 }, + userId: 'user123', + context: { + ip: '14.5.67.21', + traits: { trait1: 'new-val' }, + library: { name: 'http' }, + }, + groupId: 'group1', + rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5', + messageId: '2c59b527-3235-4fc2-9680-f41ec52ebb51', + timestamp: '2020-01-21T00:21:34.208Z', + receivedAt: '2022-08-18T08:43:13.521+05:30', + request_ip: '[::1]', + originalTimestamp: '2022-08-18T08:43:15.539+05:30', + }, + ]), destConfig: { clientContext: '', lambda: 'testFunction', invocationType: 'Event' }, }, metadata: [ @@ -29990,8 +30023,25 @@ export const data = [ }, { batchedRequest: { - payload: - '[{"type":"alias","sentAt":"2022-08-18T08:43:15.539+05:30","userId":"user123","context":{"ip":"14.5.67.21","traits":{"trait1":"new-val"},"library":{"name":"http"}},"rudderId":"bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5","messageId":"3ff8d400-b6d4-43a4-a0ff-1bc7ae8b5f7d","timestamp":"2020-01-21T00:21:34.208Z","previousId":"previd1","receivedAt":"2022-08-18T08:43:13.521+05:30","request_ip":"[::1]","originalTimestamp":"2022-08-18T08:43:15.539+05:30"}]', + payload: JSON.stringify([ + { + type: 'alias', + sentAt: '2022-08-18T08:43:15.539+05:30', + userId: 'user123', + context: { + ip: '14.5.67.21', + traits: { trait1: 'new-val' }, + library: { name: 'http' }, + }, + rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5', + messageId: '3ff8d400-b6d4-43a4-a0ff-1bc7ae8b5f7d', + timestamp: '2020-01-21T00:21:34.208Z', + previousId: 'previd1', + receivedAt: '2022-08-18T08:43:13.521+05:30', + request_ip: '[::1]', + originalTimestamp: '2022-08-18T08:43:15.539+05:30', + }, + ]), destConfig: { clientContext: '', lambda: 'testFunction', invocationType: 'Event' }, }, metadata: [ diff --git a/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts b/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts index ff4fa4455f6..04db1628d59 100644 --- a/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts +++ b/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts @@ -1,5 +1,6 @@ import { generateProxyV1Payload } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; +import { defaultAccessToken, defaultAccessTokenAuthHeader } from '../../../common/secrets'; export const element = { conversion: 'urn:lla:llaPartnerConversion:23456', @@ -75,14 +76,14 @@ export const metadata = { workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }; export const headerBlockWithCorrectAccessToken = { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts b/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts index 5cc643d9723..432161cf199 100644 --- a/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts +++ b/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts @@ -1,5 +1,7 @@ +import { secret1, authHeader2, secret2, authHeader1 } from '../maskedSecrets'; import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; export const testJSONData = { elements: [ @@ -41,15 +43,15 @@ export const metadata = { workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: secret1, }, dontBatch: false, }; export const headerBlockWithCorrectAccessToken = { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; @@ -58,16 +60,17 @@ const commonRequestParameters = { headers: headerBlockWithCorrectAccessToken, JSON: testJSONData, }; -const commonRequestParametersWithInvalidAccess = { - headers: { ...headerBlockWithCorrectAccessToken, Authorization: 'Bearer invalidToken' }, + +const commonRequestParametersWithRevokedAccess = { + headers: { ...headerBlockWithCorrectAccessToken, Authorization: authHeader1 }, JSON: testJSONData, - accessToken: 'invalidToken', + accessToken: secret1, }; -const commonRequestParametersWithRevokedAccess = { - headers: { ...headerBlockWithCorrectAccessToken, Authorization: 'Bearer revokedToken' }, +const commonRequestParametersWithInvalidAccess = { + headers: { ...headerBlockWithCorrectAccessToken, Authorization: authHeader2 }, JSON: testJSONData, - accessToken: 'revokedToken', + accessToken: secret2, }; export const oauthScenariosV1: ProxyV1TestData[] = [ @@ -96,10 +99,14 @@ export const oauthScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"status":401,"serviceErrorCode":65601,"code":"REVOKED_ACCESS_TOKEN","message":"The token used in the request has been revoked by the user"}', + error: JSON.stringify({ + status: 401, + serviceErrorCode: 65601, + code: 'REVOKED_ACCESS_TOKEN', + message: 'The token used in the request has been revoked by the user', + }), statusCode: 400, - metadata: { ...metadata, secret: { accessToken: 'revokedToken' } }, + metadata: { ...metadata, secret: { accessToken: secret1 } }, }, ], statTags, @@ -137,10 +144,14 @@ export const oauthScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"status":401,"serviceErrorCode":65600,"code":"INVALID_ACCESS_TOKEN","message":"Invalid access token"}', + error: JSON.stringify({ + status: 401, + serviceErrorCode: 65600, + code: 'INVALID_ACCESS_TOKEN', + message: 'Invalid access token', + }), statusCode: 500, - metadata: { ...metadata, secret: { accessToken: 'invalidToken' } }, + metadata: { ...metadata, secret: { accessToken: secret2 } }, }, ], statTags: { ...statTags, errorType: 'retryable' }, diff --git a/test/integrations/destinations/linkedin_ads/maskedSecrets.ts b/test/integrations/destinations/linkedin_ads/maskedSecrets.ts new file mode 100644 index 00000000000..61db9ef38a9 --- /dev/null +++ b/test/integrations/destinations/linkedin_ads/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/linkedin_ads/network.ts b/test/integrations/destinations/linkedin_ads/network.ts index 890ad485895..d653f22395b 100644 --- a/test/integrations/destinations/linkedin_ads/network.ts +++ b/test/integrations/destinations/linkedin_ads/network.ts @@ -1,7 +1,10 @@ +import { defaultAccessTokenAuthHeader } from '../../common/secrets'; +import { authHeader1, authHeader2 } from './maskedSecrets'; + export const headerBlockWithCorrectAccessToken = { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; @@ -67,7 +70,10 @@ const businessMockData = [ httpReq: { method: 'post', url: 'https://api.linkedin.com/rest/conversionEvents', - headers: { ...headerBlockWithCorrectAccessToken, Authorization: 'Bearer revokedToken' }, + headers: { + ...headerBlockWithCorrectAccessToken, + Authorization: authHeader1, + }, data: testJSONData, }, httpRes: { @@ -86,7 +92,10 @@ const businessMockData = [ httpReq: { method: 'post', url: 'https://api.linkedin.com/rest/conversionEvents', - headers: { ...headerBlockWithCorrectAccessToken, Authorization: 'Bearer invalidToken' }, + headers: { + ...headerBlockWithCorrectAccessToken, + Authorization: authHeader2, + }, data: testJSONData, }, httpRes: { diff --git a/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts b/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts index 29ff1f10a8c..d5e7b691230 100644 --- a/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { generateMetadata, generateTrackPayload, @@ -6,6 +7,7 @@ import { } from '../../../testUtils'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; const commonDestination: Destination = { ID: '12335', @@ -55,9 +57,9 @@ const commonUserProperties = { const commonTimestamp = new Date('2023-10-14'); const commonHeader = { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; @@ -89,6 +91,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { hashData: false }), }, ], + method: 'POST', }, }, output: { @@ -164,6 +167,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts b/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts index 53272e73bff..f2ad44cef8f 100644 --- a/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts @@ -1,6 +1,7 @@ import { generateMetadata, generateTrackPayload, transformResultBuilder } from '../../../testUtils'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; const commonDestination: Destination = { ID: '12335', @@ -113,9 +114,9 @@ const commonStatTags = { }; const commonHeader = { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; @@ -148,6 +149,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -221,6 +223,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -327,6 +330,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -414,6 +418,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -472,6 +477,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -558,6 +564,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -651,6 +658,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts b/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts index 653ad320565..ec206a47c25 100644 --- a/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts @@ -6,6 +6,7 @@ import { } from '../../../testUtils'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; const commonDestination: Destination = { ID: '12335', @@ -76,9 +77,9 @@ const commonStats = { }; const commonHeader = { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; @@ -113,6 +114,7 @@ export const validationTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { hashData: false }), }, ], + method: 'POST', }, }, output: { @@ -168,6 +170,7 @@ export const validationTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { @@ -219,6 +222,7 @@ export const validationTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -265,6 +269,7 @@ export const validationTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { @@ -351,6 +356,7 @@ export const validationTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/linkedin_ads/router/data.ts b/test/integrations/destinations/linkedin_ads/router/data.ts index 16abc0cd060..c1240b6ae53 100644 --- a/test/integrations/destinations/linkedin_ads/router/data.ts +++ b/test/integrations/destinations/linkedin_ads/router/data.ts @@ -1,3 +1,5 @@ +import { defaultAccessToken, defaultAccessTokenAuthHeader } from '../../../common/secrets'; + export const mockFns = (_) => { // @ts-ignore jest.useFakeTimers().setSystemTime(new Date('2023-10-15')); @@ -118,7 +120,7 @@ export const data = [ namespace: '', jobId: 1, secret: { - accessToken: 'dummyToken', + accessToken: defaultAccessToken, }, }, destination: commonDestination, @@ -187,7 +189,7 @@ export const data = [ namespace: '', jobId: 2, secret: { - accessToken: 'dummyToken', + accessToken: defaultAccessToken, }, }, destination: commonDestination, @@ -255,7 +257,7 @@ export const data = [ namespace: '', jobId: 3, secret: { - accessToken: 'dummyToken', + accessToken: defaultAccessToken, }, }, destination: commonDestination, @@ -279,7 +281,7 @@ export const data = [ namespace: '', jobId: 3, secret: { - accessToken: 'dummyToken', + accessToken: defaultAccessToken, }, }, ], @@ -419,8 +421,8 @@ export const data = [ 'Content-Type': 'application/json', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', - 'LinkedIn-Version': '202402', - Authorization: 'Bearer dummyToken', + 'LinkedIn-Version': '202409', + Authorization: defaultAccessTokenAuthHeader, }, params: {}, files: {}, @@ -432,7 +434,7 @@ export const data = [ namespace: '', jobId: 1, secret: { - accessToken: 'dummyToken', + accessToken: defaultAccessToken, }, }, { @@ -441,7 +443,7 @@ export const data = [ namespace: '', jobId: 2, secret: { - accessToken: 'dummyToken', + accessToken: defaultAccessToken, }, }, ], diff --git a/test/integrations/destinations/linkedin_audience/processor/business.ts b/test/integrations/destinations/linkedin_audience/processor/business.ts index 28cb6a9a97b..4bed9db7600 100644 --- a/test/integrations/destinations/linkedin_audience/processor/business.ts +++ b/test/integrations/destinations/linkedin_audience/processor/business.ts @@ -1,5 +1,6 @@ import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata, generateRecordPayload } from '../../../testUtils'; +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; export const businessTestData: ProcessorTestData[] = [ { @@ -85,6 +86,7 @@ export const businessTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -188,6 +190,7 @@ export const businessTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -219,7 +222,7 @@ export const businessTestData: ProcessorTestData[] = [ endpoint: 'https://api.linkedin.com/rest/dmpSegments/32589526/users', files: {}, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', @@ -317,6 +320,7 @@ export const businessTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -353,7 +357,7 @@ export const businessTestData: ProcessorTestData[] = [ endpoint: 'https://api.linkedin.com/rest/dmpSegments/32589526/users', files: {}, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', @@ -468,6 +472,7 @@ export const businessTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -499,7 +504,7 @@ export const businessTestData: ProcessorTestData[] = [ endpoint: 'https://api.linkedin.com/rest/dmpSegments/32589526/companies', files: {}, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', diff --git a/test/integrations/destinations/linkedin_audience/processor/validation.ts b/test/integrations/destinations/linkedin_audience/processor/validation.ts index 3ad37b2f4de..738627ba678 100644 --- a/test/integrations/destinations/linkedin_audience/processor/validation.ts +++ b/test/integrations/destinations/linkedin_audience/processor/validation.ts @@ -1,3 +1,4 @@ +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata, generateRecordPayload } from '../../../testUtils'; @@ -86,6 +87,7 @@ export const validationTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -126,7 +128,7 @@ export const validationTestData: ProcessorTestData[] = [ endpoint: 'https://api.linkedin.com/rest/dmpSegments/32589526/users', files: {}, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', @@ -227,6 +229,7 @@ export const validationTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -337,6 +340,7 @@ export const validationTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -375,7 +379,7 @@ export const validationTestData: ProcessorTestData[] = [ endpoint: 'https://api.linkedin.com/rest/dmpSegments/1234/users', files: {}, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', diff --git a/test/integrations/destinations/linkedin_audience/router/data.ts b/test/integrations/destinations/linkedin_audience/router/data.ts index c76d3e84c6f..25d6a65caf8 100644 --- a/test/integrations/destinations/linkedin_audience/router/data.ts +++ b/test/integrations/destinations/linkedin_audience/router/data.ts @@ -1,3 +1,4 @@ +import { defaultAccessToken, defaultAccessTokenAuthHeader } from '../../../common/secrets'; import { generateMetadata, generateRecordPayload } from '../../../testUtils'; export const data = [ @@ -271,7 +272,7 @@ export const data = [ endpoint: 'https://api.linkedin.com/rest/dmpSegments/32589526/users', files: {}, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', @@ -308,7 +309,7 @@ export const data = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -320,7 +321,7 @@ export const data = [ dontBatch: false, jobId: 2, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -358,7 +359,7 @@ export const data = [ dontBatch: false, jobId: 3, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', diff --git a/test/integrations/destinations/lytics/processor/data.ts b/test/integrations/destinations/lytics/processor/data.ts index dd5511140aa..3fc30d20c20 100644 --- a/test/integrations/destinations/lytics/processor/data.ts +++ b/test/integrations/destinations/lytics/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'lytics', @@ -113,7 +115,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -137,7 +139,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -266,7 +268,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -290,7 +292,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -381,7 +383,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -405,7 +407,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -489,7 +491,7 @@ export const data = [ destination: { ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -513,7 +515,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -596,7 +598,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -620,7 +622,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -703,7 +705,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -727,7 +729,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -810,7 +812,7 @@ export const data = [ metadata: { destinationID: 'ewksfdgDFSdvzsdmwsdfvcxj' }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -897,7 +899,7 @@ export const data = [ metadata: { destinationID: 'ewksfdgDFSdvzsdmwsdfvcxj' }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -1043,7 +1045,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -1067,7 +1069,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -1187,7 +1189,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -1211,7 +1213,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -1287,7 +1289,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -1311,7 +1313,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -1397,7 +1399,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -1421,7 +1423,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -1507,7 +1509,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -1531,7 +1533,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { diff --git a/test/integrations/destinations/mailchimp/maskedSecrets.ts b/test/integrations/destinations/mailchimp/maskedSecrets.ts new file mode 100644 index 00000000000..3225565a0f0 --- /dev/null +++ b/test/integrations/destinations/mailchimp/maskedSecrets.ts @@ -0,0 +1,9 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const authHeader1 = `Basic ${base64Convertor('apiKey' + ':' + secret1)}`; +export const authHeader2 = `Basic ${base64Convertor('apiKey' + ':' + secret2)}`; +export const authHeader3 = `Basic ${base64Convertor('apiKey' + ':' + secret3)}`; diff --git a/test/integrations/destinations/mailchimp/network.ts b/test/integrations/destinations/mailchimp/network.ts index a29712ce9a0..0d2f6018914 100644 --- a/test/integrations/destinations/mailchimp/network.ts +++ b/test/integrations/destinations/mailchimp/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { @@ -82,7 +83,7 @@ export const networkCallsData = [ url: 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/5587981bdf09024971ff9ddfb2590a6d', method: 'GET', headers: { - Authorization: 'Basic YXBpS2V5OmFwaUtleS1kdW1teUFwaUtleQ==', + Authorization: authHeader1, }, }, httpRes: { @@ -101,7 +102,7 @@ export const networkCallsData = [ url: 'https://usXX.api.mailchimp.com/3.0/lists/aud111', method: 'GET', headers: { - Authorization: 'Basic YXBpS2V5OmFwaUtleS1kdW1teUFwaUtleQ==', + Authorization: authHeader1, }, }, httpRes: { diff --git a/test/integrations/destinations/mailchimp/processor/data.ts b/test/integrations/destinations/mailchimp/processor/data.ts index bf3cb6ad064..9e34fe8be33 100644 --- a/test/integrations/destinations/mailchimp/processor/data.ts +++ b/test/integrations/destinations/mailchimp/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader2, secret2, secret1 } from '../maskedSecrets'; export const data = [ { name: 'mailchimp', @@ -18,7 +19,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -93,7 +94,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -146,7 +147,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -216,7 +217,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -260,7 +261,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -370,7 +371,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -486,7 +487,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -563,7 +564,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -607,7 +608,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -687,7 +688,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -777,7 +778,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud112', datacenterId: 'usXX', }, @@ -851,7 +852,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, audienceId: 'aud112', version: '1', @@ -884,7 +885,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -959,7 +960,7 @@ export const data = [ audienceId: 'aud111', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, version: '1', endpoint: @@ -991,7 +992,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1060,7 +1061,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -1196,7 +1197,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, datacenterId: 'usXX', }, Enabled: true, @@ -1290,7 +1291,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: '', }, @@ -1385,7 +1386,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1480,7 +1481,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1527,7 +1528,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -1572,7 +1573,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1620,7 +1621,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -1666,7 +1667,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1734,7 +1735,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1807,7 +1808,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1850,7 +1851,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -1891,7 +1892,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1950,7 +1951,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -1961,7 +1962,10 @@ export const data = [ properties: { brand: 'Aster', product: 'Garments', - products: '[{"product_id":"123","price":"14"},{"product_id":"123","price":14}]', + products: JSON.stringify([ + { product_id: '123', price: '14' }, + { product_id: '123', price: 14 }, + ]), purchased: 'false', }, }, @@ -1998,7 +2002,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -2057,7 +2061,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -2068,7 +2072,10 @@ export const data = [ properties: { brand: 'Aster', product: 'Garments', - products: '[{"product_id":"123","price":"14"},{"product_id":"123","price":14}]', + products: JSON.stringify([ + { product_id: '123', price: '14' }, + { product_id: '123', price: 14 }, + ]), purchased: 'false', }, }, @@ -2105,7 +2112,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -2190,7 +2197,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, diff --git a/test/integrations/destinations/mailchimp/router/data.ts b/test/integrations/destinations/mailchimp/router/data.ts index 93635e53692..86dce69c3d5 100644 --- a/test/integrations/destinations/mailchimp/router/data.ts +++ b/test/integrations/destinations/mailchimp/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader3, secret3 } from '../maskedSecrets'; export const data = [ { name: 'mailchimp', @@ -19,7 +20,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -74,7 +75,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -124,7 +125,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -174,7 +175,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -209,7 +210,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -243,7 +244,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -296,7 +297,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111?skip_merge_validation=true&skip_duplicate_check=false', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmFwaWtleQ==', + Authorization: authHeader3, }, params: {}, body: { @@ -336,7 +337,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -354,7 +355,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmFwaWtleQ==', + Authorization: authHeader3, }, params: {}, body: { @@ -382,7 +383,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -400,7 +401,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmFwaWtleQ==', + Authorization: authHeader3, }, params: {}, body: { @@ -411,8 +412,10 @@ export const data = [ properties: { brand: 'Aster', product: 'Garments', - products: - '[{"product_id":"123","price":"14"},{"product_id":"123","price":14}]', + products: JSON.stringify([ + { product_id: '123', price: '14' }, + { product_id: '123', price: 14 }, + ]), purchased: 'false', }, }, @@ -435,7 +438,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -454,7 +457,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -485,7 +488,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -532,7 +535,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: '1232yyqw22', datacenterId: 'us20', }, @@ -589,7 +592,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: '1232yyqw22', datacenterId: 'us20', }, @@ -635,7 +638,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: '1232yyqw22', datacenterId: 'us20', }, @@ -681,7 +684,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: '1232yyqw22', datacenterId: 'us20', }, @@ -736,7 +739,7 @@ export const data = [ 'https://us20.api.mailchimp.com/3.0/lists/1232yyqw22?skip_merge_validation=false&skip_duplicate_check=false', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmFwaUtleS1kdW1teUFwaUtleQ==', + Authorization: authHeader1, }, params: {}, body: { @@ -774,7 +777,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: '1232yyqw22', datacenterId: 'us20', }, @@ -792,7 +795,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: '1232yyqw22', datacenterId: 'us20', }, diff --git a/test/integrations/destinations/mailjet/maskedSecrets.ts b/test/integrations/destinations/mailjet/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/mailjet/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/mailjet/processor/data.ts b/test/integrations/destinations/mailjet/processor/data.ts index 03c3232e723..881080726ff 100644 --- a/test/integrations/destinations/mailjet/processor/data.ts +++ b/test/integrations/destinations/mailjet/processor/data.ts @@ -1,3 +1,4 @@ +import { secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'mailjet', @@ -20,7 +21,7 @@ export const data = [ }, integrations: { All: true, 'user.com': { lookup: 'email' } }, }, - destination: { Config: { apiKey: 'dummyApiKey', apiSecret: 'dummyApiSecret' } }, + destination: { Config: { apiKey: secret1, apiSecret: secret2 } }, }, ], method: 'POST', @@ -75,7 +76,7 @@ export const data = [ }, }, }, - destination: { Config: { apiKey: 'dummyApiKey', apiSecret: 'dummyApiSecret' } }, + destination: { Config: { apiKey: secret1, apiSecret: secret2 } }, }, ], method: 'POST', @@ -129,7 +130,7 @@ export const data = [ }, }, }, - destination: { Config: { apiKey: 'dummyApiKey', apiSecret: 'dummyApiSecret' } }, + destination: { Config: { apiKey: secret1, apiSecret: secret2 } }, }, ], method: 'POST', @@ -185,8 +186,8 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, diff --git a/test/integrations/destinations/mailjet/router/data.ts b/test/integrations/destinations/mailjet/router/data.ts index 689e73ef2a6..7cb6edf5f64 100644 --- a/test/integrations/destinations/mailjet/router/data.ts +++ b/test/integrations/destinations/mailjet/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'mailjet', @@ -12,8 +13,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -56,7 +57,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58578/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -75,8 +76,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -100,8 +101,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -147,7 +148,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58578/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -176,8 +177,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { @@ -206,8 +207,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -237,8 +238,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -280,8 +281,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -323,8 +324,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -366,8 +367,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -409,8 +410,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -446,8 +447,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -493,7 +494,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58578/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -528,8 +529,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { @@ -548,7 +549,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58570/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -574,8 +575,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { @@ -594,7 +595,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58576/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -620,8 +621,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { @@ -640,7 +641,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58576/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -666,8 +667,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { @@ -686,7 +687,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/585896/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -712,8 +713,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { @@ -732,7 +733,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/584896/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -758,8 +759,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { diff --git a/test/integrations/destinations/mailmodo/processor/data.ts b/test/integrations/destinations/mailmodo/processor/data.ts index 45a14e2a52e..70e21f816c9 100644 --- a/test/integrations/destinations/mailmodo/processor/data.ts +++ b/test/integrations/destinations/mailmodo/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'mailmodo', @@ -9,7 +11,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, message: { event: 'trackevent', type: 'track', @@ -72,7 +74,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.mailmodo.com/api/v1/addEvent', - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, params: {}, body: { JSON: { email: 'firstUser@testmail.com', event_name: 'trackevent' }, @@ -264,7 +266,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abcdef' } }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abcdef' } }, message: { type: 'page', event: 'Email Opened', @@ -317,7 +319,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey', listName: '' } }, + destination: { Config: { apiKey: defaultApiKey, listName: '' } }, message: { type: 'identify', event: 'Email Opened', @@ -351,7 +353,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.mailmodo.com/api/v1/addToList/batch', - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, params: {}, body: { JSON: { listName: 'Rudderstack', values: [{ email: 'test3@abc.com' }] }, @@ -378,7 +380,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abcdef' } }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abcdef' } }, message: { type: 'identify', event: 'Email Opened', @@ -412,7 +414,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.mailmodo.com/api/v1/addToList/batch', - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, params: {}, body: { JSON: { listName: 'abcdef', values: [{ email: 'test3@abc.com' }] }, @@ -439,7 +441,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abcdef' } }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abcdef' } }, message: { type: 'identify', event: 'Email Opened', @@ -493,7 +495,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abcdef' } }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abcdef' } }, message: { type: 'identify', userId: 'identified user id', @@ -530,7 +532,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.mailmodo.com/api/v1/addToList/batch', - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, params: {}, body: { JSON: { @@ -575,7 +577,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abcdef' } }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abcdef' } }, message: { type: 'identify', userId: 'identified user id', @@ -612,7 +614,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.mailmodo.com/api/v1/addToList/batch', - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, params: {}, body: { JSON: { diff --git a/test/integrations/destinations/mailmodo/router/data.ts b/test/integrations/destinations/mailmodo/router/data.ts index 3b492b0a827..36f25c8e384 100644 --- a/test/integrations/destinations/mailmodo/router/data.ts +++ b/test/integrations/destinations/mailmodo/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'mailmodo', @@ -28,7 +30,7 @@ export const data = [ originalTimestamp: '2020-08-28T16:26:06.468Z', }, metadata: { jobId: 2, userId: 'u1' }, - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abc' }, Enabled: true }, }, { message: { @@ -49,7 +51,7 @@ export const data = [ originalTimestamp: '2020-08-28T16:26:06.468Z', }, metadata: { jobId: 3, userId: 'u1' }, - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abc' }, Enabled: true }, }, { message: { @@ -72,7 +74,7 @@ export const data = [ timestamp: '2020-02-02T00:23:09.544Z', }, metadata: { jobId: 4, userId: 'u1' }, - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abc' }, Enabled: true }, }, { message: { @@ -92,7 +94,7 @@ export const data = [ originalTimestamp: '2020-08-28T16:26:06.468Z', }, metadata: { jobId: 5, userId: 'u1' }, - destination: { Config: { apiKey: 'dummyApiKey', listName: '' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: '' }, Enabled: true }, }, ], destType: 'mailmodo', @@ -133,7 +135,7 @@ export const data = [ files: {}, method: 'POST', params: {}, - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, version: '1', endpoint: 'https://api.mailmodo.com/api/v1/addToList/batch', }, @@ -143,7 +145,7 @@ export const data = [ ], batched: true, statusCode: 200, - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abc' }, Enabled: true }, }, { batchedRequest: { @@ -166,14 +168,14 @@ export const data = [ files: {}, method: 'POST', params: {}, - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, version: '1', endpoint: 'https://api.mailmodo.com/api/v1/addEvent', }, metadata: [{ jobId: 3, userId: 'u1' }], batched: false, statusCode: 200, - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abc' }, Enabled: true }, }, { batched: false, @@ -189,7 +191,7 @@ export const data = [ module: 'destination', }, statusCode: 400, - destination: { Config: { apiKey: 'dummyApiKey', listName: '' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: '' }, Enabled: true }, }, ], }, diff --git a/test/integrations/destinations/marketo/dataDelivery/business.ts b/test/integrations/destinations/marketo/dataDelivery/business.ts index ca4e05afa99..2404ae12d89 100644 --- a/test/integrations/destinations/marketo/dataDelivery/business.ts +++ b/test/integrations/destinations/marketo/dataDelivery/business.ts @@ -1,6 +1,7 @@ import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; +import { authHeader1 } from '../maskedSecrets'; const statTags = { aborted: { @@ -86,7 +87,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer test_token_1', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -106,8 +107,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"requestId":"664#17dae8c3d48","result":[{"id":1328328,"status":"updated"}],"success":true}', + error: JSON.stringify({ + requestId: '664#17dae8c3d48', + result: [{ id: 1328328, status: 'updated' }], + success: true, + }), metadata: proxyMetdata, statusCode: 200, }, @@ -132,7 +136,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer test_token_2', + Authorization: authHeader1, 'Content-Type': 'application/json', }, endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test2', @@ -153,8 +157,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Request Failed for marketo, Access token invalid (Retryable).during Marketo Response Handling', response: [ { - error: - '{"requestId":"a61c#17daea5968a","success":false,"errors":[{"code":"601","message":"Access token invalid"}]}', + error: JSON.stringify({ + requestId: 'a61c#17daea5968a', + success: false, + errors: [{ code: '601', message: 'Access token invalid' }], + }), metadata: proxyMetdata, statusCode: 500, }, @@ -179,7 +186,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer test_token_3', + Authorization: authHeader1, 'Content-Type': 'application/json', }, endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test3', @@ -200,8 +207,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Request Failed for marketo, Requested resource not found (Aborted).during Marketo Response Handling', response: [ { - error: - '{"requestId":"a61c#17daea5968a","success":false,"errors":[{"code":"610","message":"Requested resource not found"}]}', + error: JSON.stringify({ + requestId: 'a61c#17daea5968a', + success: false, + errors: [{ code: '610', message: 'Requested resource not found' }], + }), metadata: proxyMetdata, statusCode: 400, }, @@ -226,7 +236,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer test_token_4', + Authorization: authHeader1, 'Content-Type': 'application/json', }, endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test4', @@ -270,7 +280,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ body: generateProxyV1Payload( { headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'invalid', 'User-Agent': 'RudderLabs', }, @@ -292,8 +302,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Request Failed for marketo, Invalid Content Type (Aborted).during Marketo Response Handling', response: [ { - error: - '{"success":false,"errors":[{"code":"612","message":"Invalid Content Type"}]}', + error: JSON.stringify({ + success: false, + errors: [{ code: '612', message: 'Invalid Content Type' }], + }), metadata: proxyMetdata, statusCode: 400, }, @@ -317,7 +329,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ body: generateProxyV1Payload( { headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -338,8 +350,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request failed with status: 400', response: [ { - error: - '{"success":false,"errors":[{"code":"1077","message":"Value for field exceeds max length"}]}', + error: JSON.stringify({ + success: false, + errors: [{ code: '1077', message: 'Value for field exceeds max length' }], + }), metadata: proxyMetdata, statusCode: 400, }, diff --git a/test/integrations/destinations/marketo/dataDelivery/data.ts b/test/integrations/destinations/marketo/dataDelivery/data.ts index db379c9e956..30b223b8639 100644 --- a/test/integrations/destinations/marketo/dataDelivery/data.ts +++ b/test/integrations/destinations/marketo/dataDelivery/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { testScenariosForV1API } from './business'; import { otheMarketoScenariosV1 } from './other'; @@ -16,7 +17,7 @@ const legacyTests = [ method: 'POST', userId: '', headers: { - Authorization: 'Bearer test_token_1', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -81,7 +82,7 @@ const legacyTests = [ method: 'POST', userId: '', headers: { - Authorization: 'Bearer test_token_2', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -157,7 +158,7 @@ const legacyTests = [ method: 'POST', userId: '', headers: { - Authorization: 'Bearer test_token_3', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -233,7 +234,7 @@ const legacyTests = [ method: 'POST', userId: '', headers: { - Authorization: 'Bearer test_token_4', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -299,7 +300,7 @@ const legacyTests = [ method: 'POST', userId: '', headers: { - Authorization: 'Bearer test_token_5', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -365,7 +366,7 @@ const legacyTests = [ method: 'POST', userId: '', headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -432,7 +433,7 @@ const legacyTests = [ endpoint: 'https://unhandled_exception_in_proxy_req.mktorest.com/rest/v1/leads.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, body: { JSON: { diff --git a/test/integrations/destinations/marketo/dataDelivery/other.ts b/test/integrations/destinations/marketo/dataDelivery/other.ts index 5d4e3b1f177..72faf5248af 100644 --- a/test/integrations/destinations/marketo/dataDelivery/other.ts +++ b/test/integrations/destinations/marketo/dataDelivery/other.ts @@ -1,5 +1,6 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; +import { defaultAccessToken } from '../../../common/secrets'; const statTags = { aborted: { @@ -27,7 +28,7 @@ const statTags = { const metadata = { jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, attemptNum: 1, userId: 'default-userId', @@ -63,8 +64,13 @@ export const otheMarketoScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata, }, diff --git a/test/integrations/destinations/marketo/maskedSecrets.ts b/test/integrations/destinations/marketo/maskedSecrets.ts new file mode 100644 index 00000000000..c3e36ab909c --- /dev/null +++ b/test/integrations/destinations/marketo/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secretAccessToken = path.basename(__dirname) + 2; +export const expiredAccessToken = path.basename(__dirname) + 3; + +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/marketo/network.ts b/test/integrations/destinations/marketo/network.ts index 1606e78c516..e2f90643c9e 100644 --- a/test/integrations/destinations/marketo/network.ts +++ b/test/integrations/destinations/marketo/network.ts @@ -1,3 +1,4 @@ +import { authHeader1, expiredAccessToken, secret1, secretAccessToken } from './maskedSecrets'; const userObject = { City: 'Tokyo', Country: 'JP', @@ -9,7 +10,7 @@ const userObject = { }; const headerObject = { - Authorization: 'Bearer test_token_2', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }; @@ -24,7 +25,7 @@ const tfProxyMocksData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_1', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -80,7 +81,7 @@ const tfProxyMocksData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_3', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -110,7 +111,7 @@ const tfProxyMocksData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_4', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -127,7 +128,7 @@ const tfProxyMocksData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_5', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -144,7 +145,7 @@ const tfProxyMocksData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -172,7 +173,7 @@ const tfProxyMocksData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -200,7 +201,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secretAccessToken, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -216,7 +217,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_expired', + access_token: expiredAccessToken, expires_in: 0, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -306,7 +307,7 @@ const tfProxyMocksData = [ }, { httpReq: { - url: 'https://munchkinId.mktorest.com/identity/oauth/token?client_id=b&client_secret=clientSecret&grant_type=client_credentials', + url: `https://munchkinId.mktorest.com/identity/oauth/token?client_id=b&client_secret=${secret1}&grant_type=client_credentials`, method: 'GET', }, httpRes: { @@ -319,12 +320,12 @@ const tfProxyMocksData = [ }, { httpReq: { - url: 'https://munchkinId.mktorest.com/identity/oauth/token?client_id=wrongClientId&client_secret=clientSecret&grant_type=client_credentials', + url: `https://munchkinId.mktorest.com/identity/oauth/token?client_id=wrongClientId&client_secret=${secret1}&grant_type=client_credentials`, method: 'GET', }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -388,7 +389,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -401,7 +402,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -444,7 +445,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -475,7 +476,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -488,7 +489,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -541,7 +542,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -605,7 +606,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -765,7 +766,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -816,7 +817,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -867,7 +868,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -934,7 +935,7 @@ const businessMockData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_1', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -992,7 +993,7 @@ const businessMockData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_3', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -1023,7 +1024,7 @@ const businessMockData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_4', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -1041,7 +1042,7 @@ const businessMockData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_5', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -1059,7 +1060,7 @@ const businessMockData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -1081,7 +1082,7 @@ const businessMockData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -1110,7 +1111,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1127,7 +1128,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_expired', + access_token: expiredAccessToken, expires_in: 0, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1236,12 +1237,12 @@ const businessMockData = [ { description: 'Mock response for a failed access token request due to invalid client id', httpReq: { - url: 'https://munchkinId.mktorest.com/identity/oauth/token?client_id=wrongClientId&client_secret=clientSecret&grant_type=client_credentials', + url: `https://munchkinId.mktorest.com/identity/oauth/token?client_id=wrongClientId&client_secret=${secret1}&grant_type=client_credentials`, method: 'GET', }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -1308,7 +1309,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -1322,7 +1323,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -1367,7 +1368,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -1400,7 +1401,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -1414,7 +1415,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -1471,7 +1472,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1538,7 +1539,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1705,7 +1706,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1760,7 +1761,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1815,7 +1816,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1878,7 +1879,7 @@ const businessMockData = [ httpReq: { url: 'https://mktId.mktorest.com/rest/v1/leads.json/test_invalid_header', headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'invalid', 'User-Agent': 'RudderLabs', }, @@ -1903,7 +1904,7 @@ const businessMockData = [ httpReq: { url: 'https://mktId.mktorest.com/rest/v1/leads.json/test_exceeded_length', headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, diff --git a/test/integrations/destinations/marketo/processor/data.ts b/test/integrations/destinations/marketo/processor/data.ts index 38201bd60df..f7c6e7fb6de 100644 --- a/test/integrations/destinations/marketo/processor/data.ts +++ b/test/integrations/destinations/marketo/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, expiredAccessToken, secret1 } from '../maskedSecrets'; export const data = [ { name: 'marketo', @@ -50,7 +51,7 @@ export const data = [ userId: 'lynnanderson@smith.net', }, destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoYksLmUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -85,7 +86,7 @@ export const data = [ }, Config: { clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, accountId: 'marketo_acct_id_success', rudderEventsMapping: [], }, @@ -114,7 +115,7 @@ export const data = [ endpoint: 'https://marketo_acct_id_success.mktorest.com/rest/v1/customobjects/new_user.json', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -217,7 +218,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -264,7 +265,7 @@ export const data = [ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, params: {}, body: { @@ -363,7 +364,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -409,7 +410,7 @@ export const data = [ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, params: {}, body: { @@ -513,7 +514,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: false, customActivityPropertyMap: [ { @@ -555,7 +556,7 @@ export const data = [ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, params: {}, body: { @@ -654,8 +655,16 @@ export const data = [ body: [ { statusCode: 500, - error: - '{"message":"Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token","destinationResponse":{"access_token":"access_token_expired","expires_in":0,"scope":"integrations@rudderstack.com","token_type":"bearer"}}', + error: JSON.stringify({ + message: + 'Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token', + destinationResponse: { + access_token: expiredAccessToken, + expires_in: 0, + scope: 'integrations@rudderstack.com', + token_type: 'bearer', + }, + }), statTags: { errorCategory: 'network', errorType: 'retryable', @@ -741,7 +750,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_failed', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: false, customActivityPropertyMap: [ { @@ -775,8 +784,17 @@ export const data = [ body: [ { statusCode: 500, - error: - '{"message":"Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token","destinationResponse":{"response":{"success":false,"errors":[{"code":"601","message":"Access Token Expired"}]},"status":200}}', + error: JSON.stringify({ + message: + 'Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token', + destinationResponse: { + response: { + success: false, + errors: [{ code: '601', message: 'Access Token Expired' }], + }, + status: 200, + }, + }), statTags: { errorCategory: 'network', errorType: 'retryable', @@ -839,7 +857,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -962,7 +980,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: false, customActivityPropertyMap: [ { @@ -1081,7 +1099,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -1200,7 +1218,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -1318,7 +1336,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -1437,7 +1455,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -1537,7 +1555,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -1580,7 +1598,7 @@ export const data = [ method: 'POST', endpoint: 'https://marketo_acct_id_success.mktorest.com/rest/v1/leads.json', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1657,7 +1675,7 @@ export const data = [ userId: 'dummyMail@dummyDomain.com', }, destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoYksLmUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -1692,7 +1710,7 @@ export const data = [ }, Config: { clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, accountId: 'marketo_acct_id_success', rudderEventsMapping: [], }, @@ -1720,7 +1738,7 @@ export const data = [ method: 'POST', endpoint: 'https://marketo_acct_id_success.mktorest.com/rest/v1/leads.json', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/marketo/router/data.ts b/test/integrations/destinations/marketo/router/data.ts index d187792ea80..e71e1f1fc6c 100644 --- a/test/integrations/destinations/marketo/router/data.ts +++ b/test/integrations/destinations/marketo/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'marketo', @@ -49,8 +50,8 @@ export const data = [ destination: { Config: { accountId: 'marketo_acct_id_success', - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [{ from: 'name', to: 'productName' }], leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }], @@ -169,8 +170,8 @@ export const data = [ destination: { Config: { accountId: 'marketo_acct_id_success', - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [{ from: 'name', to: 'productName' }], leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }], @@ -316,8 +317,8 @@ export const data = [ destination: { Config: { accountId: 'valid_account_broken_event', - clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', - clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: false, createIfNotExist: true, rudderEventsMapping: [ @@ -469,8 +470,8 @@ export const data = [ destination: { Config: { accountId: 'unhandled_status_code', - clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', - clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: false, createIfNotExist: true, rudderEventsMapping: [ @@ -622,8 +623,8 @@ export const data = [ destination: { Config: { accountId: 'successful_identify_transformation', - clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', - clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: false, createIfNotExist: true, rudderEventsMapping: [ @@ -728,7 +729,7 @@ export const data = [ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, params: {}, body: { @@ -757,8 +758,8 @@ export const data = [ destination: { Config: { accountId: 'marketo_acct_id_success', - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [{ from: 'name', to: 'productName' }], leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }], @@ -846,7 +847,7 @@ export const data = [ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, params: {}, body: { @@ -875,8 +876,8 @@ export const data = [ destination: { Config: { accountId: 'marketo_acct_id_success', - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [{ from: 'name', to: 'productName' }], leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }], @@ -967,8 +968,8 @@ export const data = [ destination: { Config: { accountId: 'valid_account_broken_event', - clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', - clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: false, createIfNotExist: true, rudderEventsMapping: [ @@ -1055,8 +1056,18 @@ export const data = [ { batched: false, statusCode: 400, - error: - '{"message":"Error occurred [Marketo Transformer]: During lead look up using email -> some other problem","destinationResponse":{"response":{"requestId":"142e4#1835b117b76","success":false,"errors":[{"code":"random_marketo_code","message":"some other problem"}]},"status":200}}', + error: JSON.stringify({ + message: + 'Error occurred [Marketo Transformer]: During lead look up using email -> some other problem', + destinationResponse: { + response: { + requestId: '142e4#1835b117b76', + success: false, + errors: [{ code: 'random_marketo_code', message: 'some other problem' }], + }, + status: 200, + }, + }), statTags: { errorCategory: 'network', errorType: 'aborted', @@ -1065,8 +1076,8 @@ export const data = [ destination: { Config: { accountId: 'unhandled_status_code', - clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', - clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: false, createIfNotExist: true, rudderEventsMapping: [ @@ -1162,7 +1173,7 @@ export const data = [ 'https://successful_identify_transformation.mktorest.com/rest/v1/leads.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, params: {}, body: { @@ -1193,8 +1204,8 @@ export const data = [ destination: { Config: { accountId: 'successful_identify_transformation', - clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', - clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: false, createIfNotExist: true, rudderEventsMapping: [ @@ -1333,8 +1344,8 @@ export const data = [ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', Config: { accountId: 'marketo_acct_id_success', - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { from: 'name', to: 'productName' }, @@ -1374,7 +1385,7 @@ export const data = [ endpoint: 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1403,8 +1414,8 @@ export const data = [ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', Config: { accountId: 'marketo_acct_id_success', - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { from: 'name', to: 'productName' }, diff --git a/test/integrations/destinations/marketo_static_list/dataDelivery/business.ts b/test/integrations/destinations/marketo_static_list/dataDelivery/business.ts index 08be877ba84..c00a46613f8 100644 --- a/test/integrations/destinations/marketo_static_list/dataDelivery/business.ts +++ b/test/integrations/destinations/marketo_static_list/dataDelivery/business.ts @@ -1,7 +1,7 @@ import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; - +import { authHeader1, authHeaderAccessToken } from '../maskedSecrets'; export const statTags = { aborted: { destType: 'MARKETO_STATIC_LIST', @@ -79,11 +79,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer Incorrect_token', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', }, reqMetadataArray, ), @@ -99,8 +99,19 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"requestId":"b6d1#18a8d2c10e7","result":[{"id":110,"status":"skipped","reasons":[{"code":"1015","message":"Lead not in list"}]},{"id":111,"status":"removed"},{"id":112,"status":"removed"}],"success":true}', + error: JSON.stringify({ + requestId: 'b6d1#18a8d2c10e7', + result: [ + { + id: 110, + status: 'skipped', + reasons: [{ code: '1015', message: 'Lead not in list' }], + }, + { id: 111, status: 'removed' }, + { id: 112, status: 'removed' }, + ], + success: true, + }), metadata: proxyMetdata, statusCode: 200, }, @@ -125,11 +136,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer Incorrect_token', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', }, reqMetadataArray, ), @@ -147,8 +158,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Request Failed for Marketo Static List, Access token invalid (Retryable).during Marketo Static List Response Handling', response: [ { - error: - '{"requestId":"68d8#1846058ee27","success":false,"errors":[{"code":"601","message":"Access token invalid"}]}', + error: JSON.stringify({ + requestId: '68d8#1846058ee27', + success: false, + errors: [{ code: '601', message: 'Access token invalid' }], + }), metadata: proxyMetdata, statusCode: 500, }, @@ -174,12 +188,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', }, reqMetadataArray, ), @@ -195,8 +209,14 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"requestId":"12d3c#1846057dce2","result":[{"id":1,"status":"added"},{"id":2,"status":"added"}],"success":true}', + error: JSON.stringify({ + requestId: '12d3c#1846057dce2', + result: [ + { id: 1, status: 'added' }, + { id: 2, status: 'added' }, + ], + success: true, + }), metadata: proxyMetdata, statusCode: 200, }, @@ -221,7 +241,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, diff --git a/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts b/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts index c0398f6d2b8..8cb4e2854e2 100644 --- a/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts +++ b/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeaderAccessToken } from '../maskedSecrets'; import { testScenariosForV1API } from './business'; import { otherScenariosV1 } from './other'; @@ -13,11 +14,11 @@ const legacyTests = [ body: { type: 'REST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', method: 'POST', userId: '', headers: { - Authorization: 'Bearer Incorrect_token', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, body: { @@ -84,11 +85,11 @@ const legacyTests = [ body: { type: 'REST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', method: 'POST', userId: '', headers: { - Authorization: 'Bearer Incorrect_token', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, body: { @@ -152,11 +153,11 @@ const legacyTests = [ body: { type: 'REST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', method: 'POST', userId: '', headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -213,11 +214,11 @@ const legacyTests = [ body: { type: 'REST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4', method: 'POST', userId: '', headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -267,11 +268,11 @@ const legacyTests = [ body: { type: 'REST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6', method: 'POST', userId: '', headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/marketo_static_list/dataDelivery/other.ts b/test/integrations/destinations/marketo_static_list/dataDelivery/other.ts index b1f3403fa6f..b2dc97de115 100644 --- a/test/integrations/destinations/marketo_static_list/dataDelivery/other.ts +++ b/test/integrations/destinations/marketo_static_list/dataDelivery/other.ts @@ -1,6 +1,6 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload, generateMetadata } from '../../../testUtils'; -import { reqMetadataArray, statTags } from './business'; +import { statTags } from './business'; export const otherScenariosV1: ProxyV1TestData[] = [ { @@ -28,8 +28,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/marketo_static_list/maskedSecrets.ts b/test/integrations/destinations/marketo_static_list/maskedSecrets.ts new file mode 100644 index 00000000000..2c99d64d815 --- /dev/null +++ b/test/integrations/destinations/marketo_static_list/maskedSecrets.ts @@ -0,0 +1,9 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secretAccessToken = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; + +export const authHeader1 = `Bearer ${secret1}`; +export const authHeaderAccessToken = `Bearer ${secretAccessToken}`; +export const authHeader3 = `Bearer ${secret3}`; diff --git a/test/integrations/destinations/marketo_static_list/network.ts b/test/integrations/destinations/marketo_static_list/network.ts index f165291c15a..d9da4b3996f 100644 --- a/test/integrations/destinations/marketo_static_list/network.ts +++ b/test/integrations/destinations/marketo_static_list/network.ts @@ -1,10 +1,11 @@ +import { authHeader1, authHeaderAccessToken, secret1, secretAccessToken } from './maskedSecrets'; const deliveryCallsData = [ { httpReq: { - url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', + url: 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', params: { destination: 'marketo_static_list' }, headers: { - Authorization: 'Bearer Incorrect_token', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -25,10 +26,10 @@ const deliveryCallsData = [ }, { httpReq: { - url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', + url: 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', params: { destination: 'marketo_static_list' }, headers: { - Authorization: 'Bearer Incorrect_token', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -45,10 +46,10 @@ const deliveryCallsData = [ }, { httpReq: { - url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', + url: 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', params: { destination: 'marketo_static_list' }, headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -68,10 +69,10 @@ const deliveryCallsData = [ }, { httpReq: { - url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4', + url: 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4', params: {}, headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -91,10 +92,10 @@ const deliveryCallsData = [ }, { httpReq: { - url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6', + url: 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6', params: {}, headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -119,15 +120,15 @@ export const networkCallsData = [ httpReq: { method: 'GET', params: { - client_id: 'marketo_client_id_success', - client_secret: 'marketo_client_secret_success', + client_id: 'marketo_static_list_client_id_success', + client_secret: secret1, grant_type: 'client_credentials', }, - url: 'https://marketo_acct_id_success.mktorest.com/identity/oauth/token', + url: 'https://marketo_static_list_acct_id_success.mktorest.com/identity/oauth/token', }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secretAccessToken, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', diff --git a/test/integrations/destinations/marketo_static_list/processor/data.ts b/test/integrations/destinations/marketo_static_list/processor/data.ts index 05fba54f6a5..944858908d1 100644 --- a/test/integrations/destinations/marketo_static_list/processor/data.ts +++ b/test/integrations/destinations/marketo_static_list/processor/data.ts @@ -1,3 +1,5 @@ +import { authHeaderAccessToken, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'marketo_static_list', @@ -10,7 +12,7 @@ export const data = [ body: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -20,9 +22,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 3421, }, Enabled: true, @@ -64,9 +66,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -82,9 +84,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -109,7 +111,7 @@ export const data = [ body: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -119,9 +121,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -510,9 +512,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -528,9 +530,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -555,7 +557,7 @@ export const data = [ body: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -565,9 +567,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -956,9 +958,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -974,9 +976,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1001,7 +1003,7 @@ export const data = [ body: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -1011,9 +1013,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -1066,7 +1068,7 @@ export const data = [ body: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -1076,9 +1078,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -1131,7 +1133,7 @@ export const data = [ body: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -1141,9 +1143,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -1175,9 +1177,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/marketo_static_list/router/data.ts b/test/integrations/destinations/marketo_static_list/router/data.ts index 6525f7419d9..474925e4b82 100644 --- a/test/integrations/destinations/marketo_static_list/router/data.ts +++ b/test/integrations/destinations/marketo_static_list/router/data.ts @@ -1,3 +1,5 @@ +import { authHeaderAccessToken, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'marketo_static_list', @@ -12,7 +14,7 @@ export const data = [ input: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -22,9 +24,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -50,7 +52,7 @@ export const data = [ }, { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -60,9 +62,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -455,9 +457,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -469,9 +471,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -480,12 +482,12 @@ export const data = [ }, ], metadata: [ - { destInfo: { authKey: '1zia9wKshXt80YksLmUdJnr7IHI' }, jobId: 1, userId: 'u1' }, + { destInfo: { authKey: 'marketoStaticListUdJnr7IHI' }, jobId: 1, userId: 'u1' }, ], batched: false, statusCode: 200, destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -495,9 +497,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -512,9 +514,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -526,9 +528,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -537,12 +539,12 @@ export const data = [ }, ], metadata: [ - { destInfo: { authKey: '1zia9wKshXt80YksLmUdJnr7IHI' }, jobId: 2, userId: 'u1' }, + { destInfo: { authKey: 'marketoStaticListUdJnr7IHI' }, jobId: 2, userId: 'u1' }, ], batched: false, statusCode: 200, destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -552,9 +554,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -589,9 +591,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -630,9 +632,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -671,9 +673,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -712,9 +714,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -753,9 +755,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -794,9 +796,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -825,7 +827,7 @@ export const data = [ }, { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo_al', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -835,9 +837,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -863,7 +865,7 @@ export const data = [ }, { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo_al', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -873,9 +875,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -1268,9 +1270,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=2001&id=2002&id=2003', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=2001&id=2002&id=2003', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1296,9 +1298,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1313,9 +1315,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1001&id=1002&id=1003', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1001&id=1002&id=1003', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1341,9 +1343,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1358,9 +1360,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1372,9 +1374,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=101&id=102&id=103', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=101&id=102&id=103', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1383,12 +1385,12 @@ export const data = [ }, ], metadata: [ - { jobId: 7, destInfo: { authKey: '1zia9wKshXt80YksLmUdJnr7IHI' }, userId: 'u1' }, + { jobId: 7, destInfo: { authKey: 'marketoStaticListUdJnr7IHI' }, userId: 'u1' }, ], batched: false, statusCode: 200, destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo_al', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -1398,9 +1400,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -1415,9 +1417,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1429,9 +1431,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1440,12 +1442,12 @@ export const data = [ }, ], metadata: [ - { jobId: 8, destInfo: { authKey: '1zia9wKshXt80YksLmUdJnr7IHI' }, userId: 'u1' }, + { jobId: 8, destInfo: { authKey: 'marketoStaticListUdJnr7IHI' }, userId: 'u1' }, ], batched: false, statusCode: 200, destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo_al', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -1455,9 +1457,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -1493,9 +1495,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1534,9 +1536,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1575,9 +1577,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1616,9 +1618,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1657,9 +1659,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1698,9 +1700,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1744,9 +1746,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=2002', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=2002', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1770,9 +1772,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1787,9 +1789,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=1001&id=1003', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=1001&id=1003', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1814,9 +1816,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1831,9 +1833,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=2001&id=2003', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=2001&id=2003', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1858,9 +1860,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1875,9 +1877,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=1002', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=1002', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1901,9 +1903,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, diff --git a/test/integrations/destinations/mautic/maskedSecrets.ts b/test/integrations/destinations/mautic/maskedSecrets.ts new file mode 100644 index 00000000000..36a02e326f6 --- /dev/null +++ b/test/integrations/destinations/mautic/maskedSecrets.ts @@ -0,0 +1,10 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; +export const authHeader2 = `Basic ${base64Convertor(secret3 + ':' + secret2)}`; +export const authHeader3 = `Basic ${base64Convertor(secret4 + ':' + secret2)}`; diff --git a/test/integrations/destinations/mautic/network.ts b/test/integrations/destinations/mautic/network.ts index 593a6306412..c2ee4faa08b 100644 --- a/test/integrations/destinations/mautic/network.ts +++ b/test/integrations/destinations/mautic/network.ts @@ -1,8 +1,9 @@ +import { authHeader1, authHeader2 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -13,7 +14,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -24,7 +25,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -674,7 +675,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'GET', @@ -1324,7 +1325,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'GET', @@ -3221,7 +3222,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'GET', diff --git a/test/integrations/destinations/mautic/processor/data.ts b/test/integrations/destinations/mautic/processor/data.ts index fe1dc6c41af..d4d93aacb8e 100644 --- a/test/integrations/destinations/mautic/processor/data.ts +++ b/test/integrations/destinations/mautic/processor/data.ts @@ -1,3 +1,12 @@ +import { + authHeader1, + secret1, + secret2, + authHeader2, + secret3, + authHeader3, + secret4, +} from '../maskedSecrets'; export const data = [ { name: 'mautic', @@ -32,11 +41,11 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: '', domainMethod: 'domainNameOption', domainName: 'https://testmautic.com', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -56,7 +65,7 @@ export const data = [ endpoint: 'https://testmautic.com/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmQGdtYWlsLmNvbTpkdW1teVBhc3N3b3Jk', + Authorization: authHeader3, }, params: {}, body: { @@ -113,11 +122,11 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'test', domainMethod: 'subDomainNameOption', domainName: 'https://testmautic.com/', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -137,7 +146,7 @@ export const data = [ endpoint: 'https://test.mautic.net/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmQGdtYWlsLmNvbTpkdW1teVBhc3N3b3Jk', + Authorization: authHeader3, }, params: {}, body: { @@ -193,11 +202,11 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'test', domainMethod: 'domainNameOption', domainName: 'https://testmautic.com', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -217,7 +226,7 @@ export const data = [ endpoint: 'https://testmautic.com/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmQGdtYWlsLmNvbTpkdW1teVBhc3N3b3Jk', + Authorization: authHeader3, }, params: {}, body: { @@ -277,7 +286,7 @@ export const data = [ lookUpField: 'email', password: '', subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -340,7 +349,7 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: '', domainName: '', userName: 'opiogfuebj', @@ -416,9 +425,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -438,7 +447,7 @@ export const data = [ endpoint: 'https://ruddertest2.mautic.net/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, }, params: {}, body: { @@ -519,9 +528,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -541,7 +550,7 @@ export const data = [ endpoint: 'https://ruddertest2.mautic.net/api/contacts/247/edit', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, }, params: {}, body: { @@ -622,7 +631,7 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', userName: '', }, @@ -684,7 +693,7 @@ export const data = [ lookUpField: 'email', password: '', subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -757,9 +766,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: '', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -816,9 +825,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -876,9 +885,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -932,9 +941,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -988,9 +997,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -1048,9 +1057,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -1104,9 +1113,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -1164,9 +1173,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -1212,9 +1221,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -1272,9 +1281,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -1328,9 +1337,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -1350,7 +1359,7 @@ export const data = [ endpoint: 'https://testapi3.mautic.net/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmQGdtYWlsLmNvbTpkdW1teVBhc3N3b3Jk', + Authorization: authHeader3, }, params: {}, body: { @@ -1406,9 +1415,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -1428,7 +1437,7 @@ export const data = [ endpoint: 'https://testapi3.mautic.net/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmQGdtYWlsLmNvbTpkdW1teVBhc3N3b3Jk', + Authorization: authHeader3, }, params: {}, body: { @@ -1478,9 +1487,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi5', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, @@ -1500,7 +1509,7 @@ export const data = [ endpoint: 'https://testapi5.mautic.net/api/contacts/246/edit', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, }, params: {}, body: { @@ -1541,9 +1550,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi5', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, @@ -1592,9 +1601,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi5', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, @@ -1614,7 +1623,7 @@ export const data = [ endpoint: 'https://testapi5.mautic.net/api/segments/17/contact/246/remove', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, }, params: {}, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, @@ -1648,9 +1657,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi5', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, @@ -1670,7 +1679,7 @@ export const data = [ endpoint: 'https://testapi5.mautic.net/api/segments/17/contact/246/add', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, }, params: {}, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, @@ -1702,9 +1711,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi5', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -1752,9 +1761,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi5', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -1803,9 +1812,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, @@ -1825,7 +1834,7 @@ export const data = [ endpoint: 'https://ruddertest2.mautic.net/api/companies/20/contact/247/add', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, }, params: {}, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, @@ -1858,9 +1867,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, @@ -1907,9 +1916,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, diff --git a/test/integrations/destinations/mautic/router/data.ts b/test/integrations/destinations/mautic/router/data.ts index e0924053f8a..13c98378f55 100644 --- a/test/integrations/destinations/mautic/router/data.ts +++ b/test/integrations/destinations/mautic/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'mautic', @@ -45,9 +46,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, metadata: { jobId: 1, userId: 'u1' }, @@ -71,8 +72,7 @@ export const data = [ endpoint: 'https://ruddertest2.mautic.net/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, }, params: {}, body: { @@ -107,9 +107,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -164,7 +164,7 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: '', domainName: '', userName: 'abcdef', @@ -197,7 +197,7 @@ export const data = [ Config: { domainName: '', lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: '', userName: 'abcdef', }, @@ -232,9 +232,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, metadata: { jobId: 3, userId: 'u1' }, @@ -258,8 +258,7 @@ export const data = [ endpoint: 'https://ruddertest2.mautic.net/api/segments/17/contact/246/add', headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, }, params: {}, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, @@ -271,9 +270,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, diff --git a/test/integrations/destinations/moengage/maskedSecrets.ts b/test/integrations/destinations/moengage/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/moengage/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/moengage/processor/data.ts b/test/integrations/destinations/moengage/processor/data.ts index df6e1226b6d..f7572185621 100644 --- a/test/integrations/destinations/moengage/processor/data.ts +++ b/test/integrations/destinations/moengage/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; const mockFns = (_) => { jest.spyOn(Date, 'now').mockReturnValueOnce(new Date('2023-10-14T00:00:00.000Z').valueOf()); }; @@ -5,7 +6,7 @@ const mockFns = (_) => { export const data = [ { name: 'moengage', - description: 'Test 0', + description: 'Test 0: Track event with nested arrays and product properties', feature: 'processor', module: 'destination', version: 'v0', @@ -151,8 +152,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -176,11 +177,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/event/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -292,7 +293,7 @@ export const data = [ FORM: {}, }, files: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', }, statusCode: 200, }, @@ -303,7 +304,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 1', + description: 'Test 1: Identify call with user traits', feature: 'processor', module: 'destination', version: 'v0', @@ -375,8 +376,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -418,14 +419,14 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, }, statusCode: 200, }, @@ -435,7 +436,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 2', + description: 'Test 2: Identify call with custom traits', feature: 'processor', module: 'destination', version: 'v0', @@ -505,8 +506,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -548,12 +549,12 @@ export const data = [ params: {}, userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, }, statusCode: 200, }, @@ -563,7 +564,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 3', + description: 'Test 3: Identify call with device information for Android', feature: 'processor', module: 'destination', version: 'v0', @@ -643,8 +644,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -686,14 +687,14 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, }, statusCode: 200, }, @@ -719,14 +720,14 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-01.moengage.com/v1/device/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/device/${secret1}`, }, statusCode: 200, }, @@ -736,7 +737,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 4', + description: 'Test 4: Identify call with EU region configuration', feature: 'processor', module: 'destination', version: 'v0', @@ -808,8 +809,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'EU', @@ -851,14 +852,216 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', + headers: { + 'MOE-APPKEY': secret1, + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + version: '1', + endpoint: `https://api-02.moengage.com/v1/customer/${secret1}`, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'moengage', + description: 'Test 5: Pass traits as object with nested properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + channel: 'web', + properties: { + key1: { + key1_1: 'value1', + key1_2: 'value2', + data: 'hello', + }, + data: { + key2: 'value2', + }, + key2: 'value2', + }, + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.6', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + token: 'desuhere', + type: 'android', + }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.6' }, + locale: 'en-GB', + os: { name: '', version: '' }, + page: { + path: '/testing/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:3243/testing/script-test.html', + }, + screen: { density: 2 }, + traits: { + company: { id: 'abc123' }, + createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', + email: 'rudderTest@gmail.com', + name: 'Rudder Test', + plan: 'Enterprise', + address: { + city: 'San Francisco', + country: 'USA', + }, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', + }, + integrations: { All: true }, + messageId: '531e3507-1ef5-4a06-b83c-cb521ff34f0c', + originalTimestamp: '2020-10-16T08:53:29.386Z', + receivedAt: '2020-10-16T14:23:29.402+05:30', + request_ip: '[::1]', + sentAt: '2020-10-16T08:53:29.387Z', + timestamp: '2020-10-16T14:23:29.401+05:30', + type: 'identify', + userId: 'rudder123', + }, + destination: { + ID: '1iuTZs6eEZVMm6GjRBe6bNShaL3', + Name: 'MoEngage Testing', + DestinationDefinition: { + ID: '1iu4802Tx27kNC4KNYYou6D8jzL', + Name: 'MOENGAGE', + DisplayName: 'MoEngage', + Config: { + destConfig: { defaultConfig: ['apiId', 'apiKey', 'region'] }, + excludeKeys: [], + includeKeys: [], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + ], + }, + }, + Config: { + apiId: secret1, + apiKey: secret2, + eventDelivery: false, + eventDeliveryTS: 1602757086384, + region: 'US', + useObjectData: true, + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + type: 'customer', + attributes: { + name: 'Rudder Test', + plan: 'Enterprise', + email: 'rudderTest@gmail.com', + createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', + company: { id: 'abc123' }, + address: { + city: 'San Francisco', + country: 'USA', + }, + created_time: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', + }, + customer_id: 'rudder123', + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-02.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, + }, + statusCode: 200, + }, + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + type: 'device', + device_id: '7e32188a4dab669f', + attributes: { + model: 'Android SDK built for x86', + push_id: 'desuhere', + platform: 'android', + app_version: '1.1.6', + key1: { + key1_1: 'value1', + key1_2: 'value2', + data: 'hello', + }, + data: { + key2: 'value2', + }, + key2: 'value2', + }, + customer_id: 'rudder123', + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + userId: 'rudder123', + headers: { + 'MOE-APPKEY': secret1, + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + version: '1', + endpoint: `https://api-01.moengage.com/v1/device/${secret1}`, }, statusCode: 200, }, @@ -868,7 +1071,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 5', + description: 'Test 6: Identify call with IND region configuration', feature: 'processor', module: 'destination', version: 'v0', @@ -940,8 +1143,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'IND', @@ -983,14 +1186,14 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-03.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-03.moengage.com/v1/customer/${secret1}`, }, statusCode: 200, }, @@ -1000,7 +1203,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 6', + description: 'Test 7: Invalid region configuration', feature: 'processor', module: 'destination', version: 'v0', @@ -1072,8 +1275,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'AMA', @@ -1110,7 +1313,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 7', + description: 'Test 8: Missing event type validation', feature: 'processor', module: 'destination', version: 'v0', @@ -1181,8 +1384,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'IND', @@ -1219,7 +1422,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 8', + description: 'Test 9: Unsupported event type validation', feature: 'processor', module: 'destination', version: 'v0', @@ -1291,8 +1494,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'IND', @@ -1329,7 +1532,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 9', + description: 'Test 10: Track event with timezone offset', feature: 'processor', module: 'destination', version: 'v0', @@ -1480,8 +1683,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -1505,11 +1708,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/event/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -1638,7 +1841,299 @@ export const data = [ }, { name: 'moengage', - description: 'Test 10', + description: 'Test 11: Track event with object data enabled', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + timezone: 'Asia/Kolkata', + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.6', + }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.6' }, + locale: 'en-GB', + os: { name: '', version: '' }, + page: { + path: '/testing/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:3243/testing/script-test.html', + }, + screen: { density: 2 }, + traits: { + company: { id: 'abc123' }, + createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', + email: 'rudderTest@gmail.com', + name: 'Rudder Test', + plan: 'Enterprise', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', + }, + event: 'Order Completed', + integrations: { All: true }, + messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', + originalTimestamp: '2020-10-16T08:10:12.782Z', + properties: { + category: 'some category', + originalArray: [ + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3', 'tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3', 'tag_1', 'tag_2', 'tag_3'], + }, + ], + checkout_id: 'what is checkout id here??', + coupon: 'APPARELSALE', + currency: 'GBP', + order_id: 'transactionId', + products: [ + { + brand: '', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + name: 'Food/Drink', + position: 1, + price: 3, + product_id: 'product-bacon-jam', + quantity: 2, + sku: 'sku-1', + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + value: 6, + variant: 'Extra topped', + }, + { + brand: 'Levis', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/t-shirt.jpg', + name: 'T-Shirt', + position: 2, + price: 12.99, + product_id: 'product-t-shirt', + quantity: 1, + sku: 'sku-2', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/t-shirt', + value: 12.99, + variant: 'White', + }, + { + brand: 'Levis', + category: 'Merch', + coupon: 'APPARELSALE', + currency: 'GBP', + image_url: 'https://www.example.com/product/offer-t-shirt.jpg', + name: 'T-Shirt-on-offer', + position: 1, + price: 12.99, + product_id: 'offer-t-shirt', + quantity: 1, + sku: 'sku-3', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/offer-t-shirt', + value: 12.99, + variant: 'Black', + }, + ], + revenue: 31.98, + shipping: 4, + value: 31.98, + }, + 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', + userId: 'rudder123', + }, + destination: { + ID: '1iuTZs6eEZVMm6GjRBe6bNShaL3', + Name: 'MoEngage Testing', + DestinationDefinition: { + ID: '1iu4802Tx27kNC4KNYYou6D8jzL', + Name: 'MOENGAGE', + DisplayName: 'MoEngage', + Config: { + destConfig: { defaultConfig: ['apiId', 'apiKey', 'region'] }, + excludeKeys: [], + includeKeys: [], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + ], + }, + }, + Config: { + apiId: secret1, + apiKey: secret2, + eventDelivery: false, + eventDeliveryTS: 1602757086384, + region: 'US', + useObjectData: true, + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, + headers: { + 'Content-Type': 'application/json', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + customer_id: 'rudder123', + type: 'event', + actions: [ + { + action: 'Order Completed', + attributes: { + checkout_id: 'what is checkout id here??', + coupon: 'APPARELSALE', + currency: 'GBP', + order_id: 'transactionId', + category: 'some category', + originalArray: [ + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3', 'tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3', 'tag_1', 'tag_2', 'tag_3'], + }, + ], + products: [ + { + brand: '', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + name: 'Food/Drink', + position: 1, + price: 3, + product_id: 'product-bacon-jam', + quantity: 2, + sku: 'sku-1', + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + value: 6, + variant: 'Extra topped', + }, + { + brand: 'Levis', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/t-shirt.jpg', + name: 'T-Shirt', + position: 2, + price: 12.99, + product_id: 'product-t-shirt', + quantity: 1, + sku: 'sku-2', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/t-shirt', + value: 12.99, + variant: 'White', + }, + { + brand: 'Levis', + category: 'Merch', + coupon: 'APPARELSALE', + currency: 'GBP', + image_url: 'https://www.example.com/product/offer-t-shirt.jpg', + name: 'T-Shirt-on-offer', + position: 1, + price: 12.99, + product_id: 'offer-t-shirt', + quantity: 1, + sku: 'sku-3', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/offer-t-shirt', + value: 12.99, + variant: 'Black', + }, + ], + revenue: 31.98, + shipping: 4, + value: 31.98, + }, + app_version: '1.1.6', + current_time: '2020-10-16T13:40:12.791+05:30', + user_timezone_offset: 19800, + platform: 'web', + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'rudder123', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns, + }, + { + name: 'moengage', + description: 'Test 12: Track event with invalid timezone', feature: 'processor', module: 'destination', version: 'v0', @@ -1772,8 +2267,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -1797,11 +2292,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/event/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -1875,7 +2370,7 @@ export const data = [ FORM: {}, }, files: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', }, statusCode: 200, }, @@ -1885,7 +2380,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 11', + description: 'Test 13: Identify call with iOS device information', feature: 'processor', module: 'destination', version: 'v0', @@ -1965,8 +2460,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -2008,14 +2503,14 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, }, statusCode: 200, }, @@ -2041,14 +2536,14 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-01.moengage.com/v1/device/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/device/${secret1}`, }, statusCode: 200, }, @@ -2058,7 +2553,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 12', + description: 'Test 14: Track event with iOS device information and invalid timezone', feature: 'processor', module: 'destination', version: 'v0', @@ -2206,8 +2701,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -2231,11 +2726,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/event/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -2318,7 +2813,7 @@ export const data = [ FORM: {}, }, files: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', }, statusCode: 200, }, @@ -2328,7 +2823,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 13', + description: 'Test 15: Track event with nested object properties and invalid timezone', feature: 'processor', module: 'destination', version: 'v0', @@ -2483,8 +2978,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -2508,11 +3003,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/event/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -2599,7 +3094,7 @@ export const data = [ FORM: {}, }, files: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', }, statusCode: 200, }, @@ -2609,7 +3104,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 14', + description: 'Test 16: Alias call for user merging', feature: 'processor', module: 'destination', version: 'v0', @@ -2652,8 +3147,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -2691,11 +3186,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: - 'https://api-01.moengage.com/v1/customer/merge?app_id=W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/merge?app_id=${secret1}`, }, statusCode: 200, }, @@ -2705,7 +3199,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 15', + description: 'Test 17: Alias call without previousId validation', feature: 'processor', module: 'destination', version: 'v0', @@ -2747,8 +3241,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -2785,8 +3279,7 @@ export const data = [ }, { name: 'moengage', - description: - 'when identify is sent without context, the event should not throw internal server error', + description: 'Test 18: Identify call without context', feature: 'processor', module: 'destination', version: 'v0', @@ -2833,8 +3326,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -2865,17 +3358,17 @@ export const data = [ JSON_ARRAY: {}, XML: {}, }, - endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, files: {}, headers: { - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, }, method: 'POST', params: {}, type: 'REST', - userId: 'anon-dummyId-1', + userId: 'userId16', version: '1', }, statusCode: 200, diff --git a/test/integrations/destinations/moengage/router/data.ts b/test/integrations/destinations/moengage/router/data.ts index b24453fd348..01fe949bce9 100644 --- a/test/integrations/destinations/moengage/router/data.ts +++ b/test/integrations/destinations/moengage/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; const mockFns = (_) => { jest.spyOn(Date, 'now').mockReturnValueOnce(new Date('2023-10-14T00:00:00.000Z').valueOf()); }; @@ -141,8 +142,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -218,8 +219,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -245,11 +246,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/event/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -324,7 +325,7 @@ export const data = [ FORM: {}, }, files: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', }, metadata: [{ jobId: 1, userId: 'u1' }], batched: false, @@ -352,8 +353,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -368,11 +369,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -393,7 +394,7 @@ export const data = [ FORM: {}, }, files: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', }, metadata: [{ jobId: 2, userId: 'u1' }], batched: false, @@ -421,8 +422,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', diff --git a/test/integrations/destinations/monday/dataDelivery/data.ts b/test/integrations/destinations/monday/dataDelivery/data.ts index 16d20470952..1012b866104 100644 --- a/test/integrations/destinations/monday/dataDelivery/data.ts +++ b/test/integrations/destinations/monday/dataDelivery/data.ts @@ -113,7 +113,7 @@ export const data: ProxyV1TestData[] = [ output: { response: [ { - error: '{"error_message":"Rate Limit Exceeded.","status_code":429}', + error: JSON.stringify({ error_message: 'Rate Limit Exceeded.', status_code: 429 }), statusCode: 429, metadata: generateMetadata(1), }, @@ -163,7 +163,7 @@ export const data: ProxyV1TestData[] = [ output: { response: [ { - error: '{"error_message":"Internal server error","status_code":500}', + error: JSON.stringify({ error_message: 'Internal server error', status_code: 500 }), statusCode: 500, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/monday/maskedSecrets.ts b/test/integrations/destinations/monday/maskedSecrets.ts new file mode 100644 index 00000000000..f27971f42a6 --- /dev/null +++ b/test/integrations/destinations/monday/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secretApiToken = path.basename(__dirname) + 1; +export const secretFailedApiToken = path.basename(__dirname) + 2; diff --git a/test/integrations/destinations/monday/network.ts b/test/integrations/destinations/monday/network.ts index f91952069aa..25096b0401a 100644 --- a/test/integrations/destinations/monday/network.ts +++ b/test/integrations/destinations/monday/network.ts @@ -1,3 +1,5 @@ +import { secretFailedApiToken, secretApiToken } from './maskedSecrets'; + export const networkCallsData = [ { httpReq: { @@ -26,8 +28,12 @@ export const networkCallsData = [ title: 'Subitems', type: 'subtasks', description: null, - settings_str: - '{"allowMultipleItems":true,"itemTypeName":"column.subtasks.title","displayType":"BOARD_INLINE","boardIds":[3160974974]}', + settings_str: JSON.stringify({ + allowMultipleItems: true, + itemTypeName: 'column.subtasks.title', + displayType: 'BOARD_INLINE', + boardIds: [3160974974], + }), }, { id: 'person', @@ -41,8 +47,15 @@ export const networkCallsData = [ title: 'Status', type: 'color', description: null, - settings_str: - '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_positions_v2":{"0":0,"1":2,"2":1,"5":3},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + settings_str: JSON.stringify({ + labels: { '0': 'Working on it', '1': 'Done', '2': 'Stuck' }, + labels_positions_v2: { '0': 0, '1': 2, '2': 1, '5': 3 }, + labels_colors: { + '0': { color: '#fdab3d', border: '#E99729', var_name: 'orange' }, + '1': { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + '2': { color: '#e2445c', border: '#CE3048', var_name: 'red-shadow' }, + }, + }), }, { id: 'date4', @@ -63,30 +76,42 @@ export const networkCallsData = [ title: 'Connect boards', type: 'board-relation', description: null, - settings_str: '{"allowCreateReflectionColumn":false}', + settings_str: JSON.stringify({ allowCreateReflectionColumn: false }), }, { id: 'status_1', title: 'Other', type: 'color', description: null, - settings_str: - '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + settings_str: JSON.stringify({ + labels: { '0': 'Working on it', '1': 'Done', '2': 'Stuck' }, + labels_colors: { + '0': { color: '#fdab3d', border: '#E99729', var_name: 'orange' }, + '1': { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + '2': { color: '#e2445c', border: '#CE3048', var_name: 'red-shadow' }, + }, + }), }, { id: 'date_1', title: 'Date 1', type: 'date', description: null, - settings_str: '{"hide_footer":false}', + settings_str: JSON.stringify({ hide_footer: false }), }, { id: 'status_12', title: 'new status', type: 'color', description: null, - settings_str: - '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + settings_str: JSON.stringify({ + labels: { '0': 'Working on it', '1': 'Done', '2': 'Stuck' }, + labels_colors: { + '0': { color: '#fdab3d', border: '#E99729', var_name: 'orange' }, + '1': { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + '2': { color: '#e2445c', border: '#CE3048', var_name: 'red-shadow' }, + }, + }), }, { id: 'numbers', @@ -114,8 +139,13 @@ export const networkCallsData = [ title: 'Dropdown', type: 'dropdown', description: null, - settings_str: - '{"hide_footer":false,"labels":[{"id":1,"name":"dropdown"},{"id":2,"name":"dropup"}]}', + settings_str: JSON.stringify({ + hide_footer: false, + labels: [ + { id: 1, name: 'dropdown' }, + { id: 2, name: 'dropup' }, + ], + }), }, { id: 'email', @@ -150,7 +180,7 @@ export const networkCallsData = [ title: 'Timeline', type: 'timerange', description: null, - settings_str: '{"hide_footer":false}', + settings_str: JSON.stringify({ hide_footer: false }), }, { id: 'dependent_on', @@ -158,8 +188,11 @@ export const networkCallsData = [ type: 'dependency', description: 'Choose the item your task will be dependent on. If the “dependent on” item’s date is changing, the other dates will adjust automatically', - settings_str: - '{"boardIds":[3142482015],"dependencyNewInfra":true,"allowMultipleItems":true}', + settings_str: JSON.stringify({ + boardIds: [3142482015], + dependencyNewInfra: true, + allowMultipleItems: true, + }), }, { id: 'long_text', @@ -180,15 +213,23 @@ export const networkCallsData = [ title: 'Tags', type: 'tag', description: null, - settings_str: '{"hide_footer":false}', + settings_str: JSON.stringify({ hide_footer: false }), }, { id: 'label', title: 'Label', type: 'color', description: '', - settings_str: - '{"done_colors":[1],"labels":{"3":"Label 2","105":"Label 1","156":"Label 3"},"labels_positions_v2":{"3":1,"5":3,"105":0,"156":2},"labels_colors":{"3":{"color":"#0086c0","border":"#3DB0DF","var_name":"blue-links"},"105":{"color":"#9AADBD","border":"#9AADBD","var_name":"winter"},"156":{"color":"#9D99B9","border":"#9D99B9","var_name":"purple_gray"}}}', + settings_str: JSON.stringify({ + done_colors: [1], + labels: { '3': 'Label 2', '105': 'Label 1', '156': 'Label 3' }, + labels_positions_v2: { '3': 1, '5': 3, '105': 0, '156': 2 }, + labels_colors: { + '3': { color: '#0086c0', border: '#3DB0DF', var_name: 'blue-links' }, + '105': { color: '#9AADBD', border: '#9AADBD', var_name: 'winter' }, + '156': { color: '#9D99B9', border: '#9D99B9', var_name: 'purple_gray' }, + }, + }), }, { id: 'world_clock', @@ -287,8 +328,7 @@ export const networkCallsData = [ url: 'https://api.monday.com/v2', method: 'POST', headers: { - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, }, }, httpRes: { @@ -310,8 +350,12 @@ export const networkCallsData = [ title: 'Subitems', type: 'subtasks', description: null, - settings_str: - '{"allowMultipleItems":true,"itemTypeName":"column.subtasks.title","displayType":"BOARD_INLINE","boardIds":[3160974974]}', + settings_str: JSON.stringify({ + allowMultipleItems: true, + itemTypeName: 'column.subtasks.title', + displayType: 'BOARD_INLINE', + boardIds: [3160974974], + }), }, { id: 'person', @@ -325,8 +369,15 @@ export const networkCallsData = [ title: 'Status', type: 'color', description: null, - settings_str: - '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_positions_v2":{"0":0,"1":2,"2":1,"5":3},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + settings_str: JSON.stringify({ + labels: { '0': 'Working on it', '1': 'Done', '2': 'Stuck' }, + labels_positions_v2: { '0': 0, '1': 2, '2': 1, '5': 3 }, + labels_colors: { + '0': { color: '#fdab3d', border: '#E99729', var_name: 'orange' }, + '1': { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + '2': { color: '#e2445c', border: '#CE3048', var_name: 'red-shadow' }, + }, + }), }, { id: 'date4', @@ -347,30 +398,42 @@ export const networkCallsData = [ title: 'Connect boards', type: 'board-relation', description: null, - settings_str: '{"allowCreateReflectionColumn":false}', + settings_str: JSON.stringify({ allowCreateReflectionColumn: false }), }, { id: 'status_1', title: 'Other', type: 'color', description: null, - settings_str: - '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + settings_str: JSON.stringify({ + labels: { '0': 'Working on it', '1': 'Done', '2': 'Stuck' }, + labels_colors: { + '0': { color: '#fdab3d', border: '#E99729', var_name: 'orange' }, + '1': { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + '2': { color: '#e2445c', border: '#CE3048', var_name: 'red-shadow' }, + }, + }), }, { id: 'date_1', title: 'Date 1', type: 'date', description: null, - settings_str: '{"hide_footer":false}', + settings_str: JSON.stringify({ hide_footer: false }), }, { id: 'status_12', title: 'new status', type: 'color', description: null, - settings_str: - '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + settings_str: JSON.stringify({ + labels: { '0': 'Working on it', '1': 'Done', '2': 'Stuck' }, + labels_colors: { + '0': { color: '#fdab3d', border: '#E99729', var_name: 'orange' }, + '1': { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + '2': { color: '#e2445c', border: '#CE3048', var_name: 'red-shadow' }, + }, + }), }, { id: 'numbers', @@ -398,8 +461,13 @@ export const networkCallsData = [ title: 'Dropdown', type: 'dropdown', description: null, - settings_str: - '{"hide_footer":false,"labels":[{"id":1,"name":"dropdown"},{"id":2,"name":"dropup"}]}', + settings_str: JSON.stringify({ + hide_footer: false, + labels: [ + { id: 1, name: 'dropdown' }, + { id: 2, name: 'dropup' }, + ], + }), }, { id: 'email', @@ -434,7 +502,7 @@ export const networkCallsData = [ title: 'Timeline', type: 'timerange', description: null, - settings_str: '{"hide_footer":false}', + settings_str: JSON.stringify({ hide_footer: false }), }, { id: 'dependent_on', @@ -442,8 +510,11 @@ export const networkCallsData = [ type: 'dependency', description: 'Choose the item your task will be dependent on. If the “dependent on” item’s date is changing, the other dates will adjust automatically', - settings_str: - '{"boardIds":[3142482015],"dependencyNewInfra":true,"allowMultipleItems":true}', + settings_str: JSON.stringify({ + boardIds: [3142482015], + dependencyNewInfra: true, + allowMultipleItems: true, + }), }, { id: 'long_text', @@ -464,15 +535,23 @@ export const networkCallsData = [ title: 'Tags', type: 'tag', description: null, - settings_str: '{"hide_footer":false}', + settings_str: JSON.stringify({ hide_footer: false }), }, { id: 'label', title: 'Label', type: 'color', description: '', - settings_str: - '{"done_colors":[1],"labels":{"3":"Label 2","105":"Label 1","156":"Label 3"},"labels_positions_v2":{"3":1,"5":3,"105":0,"156":2},"labels_colors":{"3":{"color":"#0086c0","border":"#3DB0DF","var_name":"blue-links"},"105":{"color":"#9AADBD","border":"#9AADBD","var_name":"winter"},"156":{"color":"#9D99B9","border":"#9D99B9","var_name":"purple_gray"}}}', + settings_str: JSON.stringify({ + done_colors: [1], + labels: { '3': 'Label 2', '105': 'Label 1', '156': 'Label 3' }, + labels_positions_v2: { '3': 1, '5': 3, '105': 0, '156': 2 }, + labels_colors: { + '3': { color: '#0086c0', border: '#3DB0DF', var_name: 'blue-links' }, + '105': { color: '#9AADBD', border: '#9AADBD', var_name: 'winter' }, + '156': { color: '#9D99B9', border: '#9D99B9', var_name: 'purple_gray' }, + }, + }), }, { id: 'world_clock', @@ -512,7 +591,7 @@ export const networkCallsData = [ url: 'https://api.monday.com/v2', method: 'POST', headers: { - Authorization: 'failedApiToken', + Authorization: secretFailedApiToken, }, }, httpRes: { diff --git a/test/integrations/destinations/monday/processor/data.ts b/test/integrations/destinations/monday/processor/data.ts index 082ff822fd5..8423d188a12 100644 --- a/test/integrations/destinations/monday/processor/data.ts +++ b/test/integrations/destinations/monday/processor/data.ts @@ -1,3 +1,5 @@ +import { secretFailedApiToken, secretApiToken } from '../maskedSecrets'; + export const data = [ { name: 'monday', @@ -11,8 +13,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [], @@ -82,8 +83,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', files: {}, headers: { - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, 'Content-Type': 'application/json', }, method: 'POST', @@ -110,8 +110,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', whitelistedEvents: [ @@ -180,8 +179,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', files: {}, headers: { - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, 'Content-Type': 'application/json', }, method: 'POST', @@ -208,8 +206,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [], @@ -293,8 +290,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [], @@ -462,8 +458,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '', groupTitle: '', columnToPropertyMapping: [], @@ -547,8 +542,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [], @@ -632,8 +626,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [ @@ -709,8 +702,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', headers: { 'Content-Type': 'application/json', - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, }, params: {}, body: { @@ -743,8 +735,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next month', columnToPropertyMapping: [ @@ -820,8 +811,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', headers: { 'Content-Type': 'application/json', - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, }, params: {}, body: { @@ -854,8 +844,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next year', columnToPropertyMapping: [ @@ -951,8 +940,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next month', columnToPropertyMapping: [ @@ -1049,8 +1037,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next month', columnToPropertyMapping: [ @@ -1181,8 +1168,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', headers: { 'Content-Type': 'application/json', - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, }, params: {}, body: { @@ -1215,8 +1201,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next month', columnToPropertyMapping: [ @@ -1301,6 +1286,7 @@ export const data = [ }, }, { + only: true, name: 'monday', description: 'check for deleted boards (configured boards are deleted)', feature: 'processor', @@ -1312,7 +1298,7 @@ export const data = [ { destination: { Config: { - apiToken: 'failedApiToken', + apiToken: secretFailedApiToken, boardId: '339283934', groupTitle: 'Next year', columnToPropertyMapping: [ diff --git a/test/integrations/destinations/monday/router/data.ts b/test/integrations/destinations/monday/router/data.ts index abd649d805c..0228690878b 100644 --- a/test/integrations/destinations/monday/router/data.ts +++ b/test/integrations/destinations/monday/router/data.ts @@ -1,3 +1,5 @@ +import { secretApiToken } from '../maskedSecrets'; + export const data = [ { name: 'monday', @@ -12,8 +14,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [], @@ -52,8 +53,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next month', columnToPropertyMapping: [ @@ -121,8 +121,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', files: {}, headers: { - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, 'Content-Type': 'application/json', }, method: 'POST', @@ -135,8 +134,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [], @@ -152,8 +150,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', headers: { 'Content-Type': 'application/json', - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, }, params: {}, body: { @@ -172,8 +169,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next month', columnToPropertyMapping: [ diff --git a/test/integrations/destinations/movable_ink/common.ts b/test/integrations/destinations/movable_ink/common.ts index 29fe76852cb..2cb83e99af7 100644 --- a/test/integrations/destinations/movable_ink/common.ts +++ b/test/integrations/destinations/movable_ink/common.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from './maskedSecrets'; import { Destination } from '../../../../src/types'; const destType = 'movable_ink'; @@ -7,8 +8,8 @@ const channel = 'web'; const destination: Destination = { Config: { endpoint: 'https://collector.movableink-dmz.com/behavioral/abc123', - accessKey: 'test-access-key', - accessSecret: 'test_access_secret', + accessKey: secret1, + accessSecret: secret2, }, DestinationDefinition: { DisplayName: displayName, @@ -48,7 +49,7 @@ const traits = { const headers = { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC1hY2Nlc3Mta2V5OnRlc3RfYWNjZXNzX3NlY3JldA==', + Authorization: authHeader1, }; const commonProperties = { diff --git a/test/integrations/destinations/movable_ink/maskedSecrets.ts b/test/integrations/destinations/movable_ink/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/movable_ink/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/movable_ink/processor/identify.ts b/test/integrations/destinations/movable_ink/processor/identify.ts index 0fe806df4ae..60c9b39d76b 100644 --- a/test/integrations/destinations/movable_ink/processor/identify.ts +++ b/test/integrations/destinations/movable_ink/processor/identify.ts @@ -31,6 +31,7 @@ export const identify: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/movable_ink/processor/track.ts b/test/integrations/destinations/movable_ink/processor/track.ts index 890de11a0cf..e34e1799e59 100644 --- a/test/integrations/destinations/movable_ink/processor/track.ts +++ b/test/integrations/destinations/movable_ink/processor/track.ts @@ -33,6 +33,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -96,6 +97,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -159,6 +161,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/movable_ink/processor/validation.ts b/test/integrations/destinations/movable_ink/processor/validation.ts index 6aafb5e2c07..575337a20fb 100644 --- a/test/integrations/destinations/movable_ink/processor/validation.ts +++ b/test/integrations/destinations/movable_ink/processor/validation.ts @@ -27,6 +27,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -71,6 +72,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -111,6 +113,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -154,6 +157,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -197,6 +201,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -241,6 +246,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/mp/common.ts b/test/integrations/destinations/mp/common.ts index f8aae817808..56baf27d0f4 100644 --- a/test/integrations/destinations/mp/common.ts +++ b/test/integrations/destinations/mp/common.ts @@ -1,13 +1,13 @@ import { Destination } from '../../../../src/types'; - +import { secret1, secret2 } from './maskedSecrets'; const defaultMockFns = () => { jest.spyOn(Date, 'now').mockReturnValue(new Date(Date.UTC(2020, 0, 25)).valueOf()); }; const sampleDestination: Destination = { Config: { - apiKey: 'dummyApiKey', - token: 'test_api_token', + apiKey: secret1, + token: secret2, prefixProperties: true, useNativeSDK: false, }, @@ -15,7 +15,7 @@ const sampleDestination: Destination = { DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', - Config: undefined, + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -26,7 +26,7 @@ const sampleDestination: Destination = { const destinationWithSetOnceProperty = { Config: { - apiSecret: 'dummySecret', + apiSecret: secret1, dataResidency: 'us', identityMergeApi: 'simplified', setOnceProperties: [ @@ -45,7 +45,7 @@ const destinationWithSetOnceProperty = { property: 'random', }, ], - token: 'dummyToken', + token: secret2, useNativeSDK: false, useNewMapping: false, userDeletionApi: 'engage', diff --git a/test/integrations/destinations/mp/deleteUsers/data.ts b/test/integrations/destinations/mp/deleteUsers/data.ts index 0f469b508fa..fdd0413e097 100644 --- a/test/integrations/destinations/mp/deleteUsers/data.ts +++ b/test/integrations/destinations/mp/deleteUsers/data.ts @@ -1,3 +1,6 @@ +import { defaultApiKey } from '../../../common/secrets'; +import { secret4 } from '../maskedSecrets'; + export const data = [ { name: 'mp', @@ -3099,7 +3102,7 @@ export const data = [ }, ], config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, prefixProperties: true, useNativeSDK: false, }, @@ -3179,11 +3182,11 @@ export const data = [ }, ], config: { - token: 'test_token', + token: secret4, prefixProperties: true, useNativeSDK: false, userDeletionApi: 'task', - gdprApiToken: 'test_gdpr_token', + gdprApiToken: secret4, }, }, ], @@ -3218,7 +3221,7 @@ export const data = [ }, ], config: { - token: 'test_token', + token: secret4, prefixProperties: true, useNativeSDK: false, userDeletionApi: 'task', @@ -3257,7 +3260,7 @@ export const data = [ }, ], config: { - token: 'test_token', + token: secret4, prefixProperties: true, useNativeSDK: false, dataResidency: 'eu', diff --git a/test/integrations/destinations/mp/maskedSecrets.ts b/test/integrations/destinations/mp/maskedSecrets.ts new file mode 100644 index 00000000000..e78fce5e754 --- /dev/null +++ b/test/integrations/destinations/mp/maskedSecrets.ts @@ -0,0 +1,9 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const authHeader2 = `Basic ${base64Convertor(secret2 + ':')}`; +export const authHeader4 = `Bearer ${secret4}`; diff --git a/test/integrations/destinations/mp/network.ts b/test/integrations/destinations/mp/network.ts index cc5e265f43f..446bdc4d775 100644 --- a/test/integrations/destinations/mp/network.ts +++ b/test/integrations/destinations/mp/network.ts @@ -1,3 +1,5 @@ +import { authHeader4, secret4 } from './maskedSecrets'; + const deleteNwData = [ { httpReq: { @@ -1077,16 +1079,14 @@ const deleteNwData = [ { httpReq: { method: 'post', - - url: 'https://mixpanel.com/api/app/data-deletions/v3.0/?token=test_token', + url: `https://mixpanel.com/api/app/data-deletions/v3.0/?token=${secret4}`, data: { distinct_ids: ['rudder1', 'rudder2', 'rudder3'], compliance_type: 'CCPA', }, headers: { 'Content-Type': 'application/json', - - Authorization: 'Bearer test_gdpr_token', + Authorization: authHeader4, }, }, httpRes: { @@ -1101,7 +1101,7 @@ const deleteNwData = [ httpReq: { method: 'post', - url: 'https://mixpanel.com/api/app/data-deletions/v3.0/?token=test_token', + url: `https://mixpanel.com/api/app/data-deletions/v3.0/?token=${secret4}`, data: { distinct_ids: ['rudder2'], compliance_type: 'GDPR', @@ -1109,7 +1109,7 @@ const deleteNwData = [ headers: { 'Content-Type': 'application/json', Accept: 'text/plain', - Authorization: 'Bearer test_gdpr_token', + Authorization: authHeader4, }, }, httpRes: { @@ -1150,7 +1150,7 @@ const deleteNwData = [ httpReq: { method: 'post', url: 'https://api-eu.mixpanel.com/engage', - data: [{ $distinct_id: 'rudder1', $token: 'test_token', $delete: null, $ignore_alias: true }], + data: [{ $distinct_id: 'rudder1', $token: secret4, $delete: null, $ignore_alias: true }], headers: { 'Content-Type': 'application/json', Accept: 'text/plain', diff --git a/test/integrations/destinations/mp/processor/data.ts b/test/integrations/destinations/mp/processor/data.ts index d13cf64cae2..1ed97577d66 100644 --- a/test/integrations/destinations/mp/processor/data.ts +++ b/test/integrations/destinations/mp/processor/data.ts @@ -1,5 +1,6 @@ import { overrideDestination } from '../../../testUtils'; import { sampleDestination, defaultMockFns, destinationWithSetOnceProperty } from '../common'; +import { authHeader2, secret2, secret3 } from '../maskedSecrets'; export const data = [ { @@ -12,7 +13,7 @@ export const data = [ request: { body: [ { - destination: overrideDestination(sampleDestination, { token: 'test_api_token' }), + destination: overrideDestination(sampleDestination, { token: secret2 }), message: { anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', channel: 'web', @@ -89,15 +90,44 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","campaign_id":"test_name","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1579847342402,"utm_campaign":"test_name","utm_source":"rudder","utm_medium":"test_medium","utm_term":"test_tem","utm_content":"test_content","utm_test":"test","utm_keyword":"test_keyword","name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Page', + properties: { + ip: '0.0.0.0', + campaign_id: 'test_name', + $user_id: 'hjikl', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjikl', + time: 1579847342402, + utm_campaign: 'test_name', + utm_source: 'rudder', + utm_medium: 'test_medium', + utm_term: 'test_tem', + utm_content: 'test_content', + utm_test: 'test', + utm_keyword: 'test_keyword', + name: 'Contact Us', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -196,15 +226,37 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Viewed a Contact Us page","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1579847342402,"name":"Contact Us","category":"Contact","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'Viewed a Contact Us page', + properties: { + ip: '0.0.0.0', + $user_id: 'hjikl', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjikl', + time: 1579847342402, + name: 'Contact Us', + category: 'Contact', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -280,15 +332,32 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Screen","properties":{"category":"communication","ip":"0.0.0.0","$user_id":"hjikl","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1579847342402,"name":"Contact Us"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Screen', + properties: { + category: 'communication', + ip: '0.0.0.0', + $user_id: 'hjikl', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjikl', + time: 1579847342402, + name: 'Contact Us', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -371,15 +440,37 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Screen","properties":{"path":"/tests/html/index2.html","referrer":"","search":"","title":"","url":"http://localhost/tests/html/index2.html","ip":"0.0.0.0","$user_id":"hjiklmk","$screen_dpi":2,"mp_lib":"RudderLabs Android SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjiklmk","time":1579847342402,"name":"Contact Us","category":"Contact"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Screen', + properties: { + path: '/tests/html/index2.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost/tests/html/index2.html', + ip: '0.0.0.0', + $user_id: 'hjiklmk', + $screen_dpi: 2, + mp_lib: 'RudderLabs Android SDK', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjiklmk', + time: 1579847342402, + name: 'Contact Us', + category: 'Contact', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -454,15 +545,31 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Screen","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1579847342402,"name":"Contact Us"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Screen', + properties: { + ip: '0.0.0.0', + $user_id: 'hjikl', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjikl', + time: 1579847342402, + name: 'Contact Us', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -564,8 +671,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -678,8 +804,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2020-01-24T06:29:02.403Z","$amount":45.89}},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2020-01-24T06:29:02.403Z', $amount: 45.89 }, + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + ]), }, XML: {}, FORM: {}, @@ -700,8 +833,13 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$add":{"counter":1,"item_purchased":"2"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca"}]', + batch: JSON.stringify([ + { + $add: { counter: 1, item_purchased: '2' }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + ]), }, XML: {}, FORM: {}, @@ -718,15 +856,51 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"test revenue MIXPANEL","properties":{"currency":"USD","revenue":45.89,"counter":1,"item_purchased":"2","number_of_logins":"","city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","campaign_id":"test_name","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"a6a0ad5a-bd26-4f19-8f75-38484e580fc7","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342403,"utm_campaign":"test_name","utm_source":"rudder","utm_medium":"test_medium","utm_term":"test_tem","utm_content":"test_content","utm_test":"test","utm_keyword":"test_keyword","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'test revenue MIXPANEL', + properties: { + currency: 'USD', + revenue: 45.89, + counter: 1, + item_purchased: '2', + number_of_logins: '', + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstName: 'Mickey', + ip: '0.0.0.0', + campaign_id: 'test_name', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'a6a0ad5a-bd26-4f19-8f75-38484e580fc7', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342403, + utm_campaign: 'test_name', + utm_source: 'rudder', + utm_medium: 'test_medium', + utm_term: 'test_tem', + utm_content: 'test_content', + utm_test: 'test', + utm_keyword: 'test_keyword', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -816,15 +990,23 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$create_alias","properties":{"distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","alias":"1234abc","token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$create_alias', + properties: { + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + alias: '1234abc', + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -953,8 +1135,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2020-01-24T06:29:02.402Z","$amount":25}},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2020-01-24T06:29:02.402Z', $amount: 25 }, + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + ]), }, XML: {}, FORM: {}, @@ -971,15 +1160,69 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"KM Order Completed","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"revenue":25,"shipping":3,"subtotal":22.5,"tax":2,"total":27.5,"city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'KM Order Completed', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + coupon: 'hasbros', + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + price: 19, + product_id: '507f1f77bcf86cd799439011', + quantity: 1, + sku: '45790-32', + url: 'https://www.example.com/product/path', + }, + { + category: 'Games', + name: 'Uno Card Game', + price: 3, + product_id: '505bd76785ebb509fc183733', + quantity: 2, + sku: '46493-32', + }, + ], + revenue: 25, + shipping: 3, + subtotal: 22.5, + tax: 2, + total: 27.5, + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstName: 'Mickey', + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342402, + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1112,8 +1355,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2020-01-24T06:29:02.402Z","$amount":34}},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2020-01-24T06:29:02.402Z', $amount: 34 }, + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + ]), }, XML: {}, FORM: {}, @@ -1130,15 +1380,78 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"KM Order Completed","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"order_id":"50314b8e9bcf000000000000","revenue":34,"key_1":{"child_key1":"child_value1","child_key2":{"child_key21":"child_value21","child_key22":"child_value22"}},"products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"shipping":3,"subtotal":22.5,"tax":2,"total":27.5,"city":"Disney","country":"USA","email":"mickey@disney.com","first_name":"Mickey","lastName":"Mouse","name":"Mickey Mouse","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'KM Order Completed', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + coupon: 'hasbros', + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + revenue: 34, + key_1: { + child_key1: 'child_value1', + child_key2: { + child_key21: 'child_value21', + child_key22: 'child_value22', + }, + }, + products: [ + { + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + price: 19, + product_id: '507f1f77bcf86cd799439011', + quantity: 1, + sku: '45790-32', + url: 'https://www.example.com/product/path', + }, + { + category: 'Games', + name: 'Uno Card Game', + price: 3, + product_id: '505bd76785ebb509fc183733', + quantity: 2, + sku: '46493-32', + }, + ], + shipping: 3, + subtotal: 22.5, + tax: 2, + total: 27.5, + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + first_name: 'Mickey', + lastName: 'Mouse', + name: 'Mickey Mouse', + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342402, + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1264,15 +1577,75 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":" new Order Completed totally","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"total":23,"order_id":"50314b8e9bcf000000000000","key_1":{"child_key1":"child_value1","child_key2":{"child_key21":"child_value21","child_key22":"child_value22"}},"products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"shipping":3,"subtotal":22.5,"tax":2,"city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: ' new Order Completed totally', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + coupon: 'hasbros', + currency: 'USD', + discount: 2.5, + total: 23, + order_id: '50314b8e9bcf000000000000', + key_1: { + child_key1: 'child_value1', + child_key2: { + child_key21: 'child_value21', + child_key22: 'child_value22', + }, + }, + products: [ + { + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + price: 19, + product_id: '507f1f77bcf86cd799439011', + quantity: 1, + sku: '45790-32', + url: 'https://www.example.com/product/path', + }, + { + category: 'Games', + name: 'Uno Card Game', + price: 3, + product_id: '505bd76785ebb509fc183733', + quantity: 2, + sku: '46493-32', + }, + ], + shipping: 3, + subtotal: 22.5, + tax: 2, + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstName: 'Mickey', + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342402, + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1398,15 +1771,76 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":" Order Completed ","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"total":23,"order_id":"50314b8e9bcf000000000000","key_1":{"child_key1":"child_value1","child_key2":{"child_key21":"child_value21","child_key22":"child_value22"}},"products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"shipping":3,"subtotal":22.5,"tax":2,"Billing Amount":"77","city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: ' Order Completed ', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + coupon: 'hasbros', + currency: 'USD', + discount: 2.5, + total: 23, + order_id: '50314b8e9bcf000000000000', + key_1: { + child_key1: 'child_value1', + child_key2: { + child_key21: 'child_value21', + child_key22: 'child_value22', + }, + }, + products: [ + { + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + price: 19, + product_id: '507f1f77bcf86cd799439011', + quantity: 1, + sku: '45790-32', + url: 'https://www.example.com/product/path', + }, + { + category: 'Games', + name: 'Uno Card Game', + price: 3, + product_id: '505bd76785ebb509fc183733', + quantity: 2, + sku: '46493-32', + }, + ], + shipping: 3, + subtotal: 22.5, + tax: 2, + 'Billing Amount': '77', + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstName: 'Mickey', + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342402, + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1573,8 +2007,24 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $firstName: 'Mickey', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -1660,8 +2110,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"hjikl","$set":{"company":["testComp"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: 'hjikl', + $set: { company: ['testComp'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -1682,8 +2138,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp","$set":{"company":"testComp"}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp', + $set: { company: 'testComp' }, + }, + ]), }, XML: {}, FORM: {}, @@ -1769,8 +2231,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"hjikl","$set":{"company":["testComp","testComp1"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: 'hjikl', + $set: { company: ['testComp', 'testComp1'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -1791,8 +2259,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp","$set":{"company":["testComp","testComp1"]}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp', + $set: { company: ['testComp', 'testComp1'] }, + }, + ]), }, XML: {}, FORM: {}, @@ -1813,8 +2287,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp1","$set":{"company":["testComp","testComp1"]}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp1', + $set: { company: ['testComp', 'testComp1'] }, + }, + ]), }, XML: {}, FORM: {}, @@ -1901,8 +2381,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"hjikl","$set":{"company":["testComp"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: 'hjikl', + $set: { company: ['testComp'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -1923,8 +2409,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp","$set":{"company":"testComp"}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp', + $set: { company: 'testComp' }, + }, + ]), }, XML: {}, FORM: {}, @@ -2051,8 +2543,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2020-01-24T06:29:02.402Z","$amount":25}},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2020-01-24T06:29:02.402Z', $amount: 25 }, + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + ]), }, XML: {}, FORM: {}, @@ -2069,15 +2568,70 @@ export const data = [ method: 'POST', endpoint: 'https://api-eu.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"KM Order Completed","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"revenue":25,"shipping":3,"subtotal":22.5,"tax":2,"total":27.5,"city":"Disney","country":"USA","email":"mickey@disney.com","firstname":"Mickey","lastname":"Mouse","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'KM Order Completed', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + coupon: 'hasbros', + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + price: 19, + product_id: '507f1f77bcf86cd799439011', + quantity: 1, + sku: '45790-32', + url: 'https://www.example.com/product/path', + }, + { + category: 'Games', + name: 'Uno Card Game', + price: 3, + product_id: '505bd76785ebb509fc183733', + quantity: 2, + sku: '46493-32', + }, + ], + revenue: 25, + shipping: 3, + subtotal: 22.5, + tax: 2, + total: 27.5, + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstname: 'Mickey', + lastname: 'Mouse', + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342402, + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -2164,8 +2718,30 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","$android_devices":["test_device_token"],"$os":"Android","$android_model":"Android SDK built for x86","$android_os_version":"8.1.0","$android_manufacturer":"Google","$android_app_version":"1.0","$android_app_version_code":"1.0","$android_brand":"Google"},"$token":"test_api_token","$distinct_id":"5094f5704b9cf2b3","$time":1584003903421}]', + batch: JSON.stringify([ + { + $set: { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $screen_height: 1794, + $screen_width: 1080, + $wifi: true, + anonymousId: '5094f5704b9cf2b3', + $android_devices: ['test_device_token'], + $os: 'Android', + $android_model: 'Android SDK built for x86', + $android_os_version: '8.1.0', + $android_manufacturer: 'Google', + $android_app_version: '1.0', + $android_app_version_code: '1.0', + $android_brand: 'Google', + }, + $token: secret2, + $distinct_id: '5094f5704b9cf2b3', + $time: 1584003903421, + }, + ]), }, XML: {}, FORM: {}, @@ -2251,8 +2827,29 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1","$ios_app_version":"1.0"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + batch: JSON.stringify([ + { + $set: { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $screen_height: 1794, + $screen_width: 1080, + $wifi: true, + anonymousId: '5094f5704b9cf2b3', + userId: 'test_user_id', + $ios_devices: ['test_device_token'], + $os: 'iOS', + $ios_device_model: 'Android SDK built for x86', + $ios_version: '8.1.0', + $ios_app_release: '1.0', + $ios_app_version: '1', + }, + $token: secret2, + $distinct_id: 'test_user_id', + $time: 1584003903421, + }, + ]), }, XML: {}, FORM: {}, @@ -2269,15 +2866,22 @@ export const data = [ method: 'POST', endpoint: 'https://api-eu.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$merge","properties":{"$distinct_ids":["test_user_id","5094f5704b9cf2b3"],"token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$merge', + properties: { + $distinct_ids: ['test_user_id', '5094f5704b9cf2b3'], + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -2366,15 +2970,41 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Page","properties":{"path":"/tests/html/index2.html","referrer":"","search":"","title":"","url":"http://localhost/tests/html/index2.html","category":"communication","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Page', + properties: { + path: '/tests/html/index2.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost/tests/html/index2.html', + category: 'communication', + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342402, + name: 'Contact Us', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -2464,15 +3094,23 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$create_alias","properties":{"distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","alias":"1234abc","token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$create_alias', + properties: { + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + alias: '1234abc', + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -2564,8 +3202,28 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","createdat":"2020-01-23T08:54:02.362Z","$ios_devices":["test_device_token"],"$ios_device_model":"Android SDK built for x86","$ios_app_release":"1","$ios_app_version":"1.0"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + batch: JSON.stringify([ + { + $set: { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $screen_height: 1794, + $screen_width: 1080, + $wifi: true, + anonymousId: '5094f5704b9cf2b3', + userId: 'test_user_id', + createdat: '2020-01-23T08:54:02.362Z', + $ios_devices: ['test_device_token'], + $ios_device_model: 'Android SDK built for x86', + $ios_app_release: '1.0', + $ios_app_version: '1', + }, + $token: secret2, + $distinct_id: 'test_user_id', + $time: 1584003903421, + }, + ]), }, XML: {}, FORM: {}, @@ -2582,15 +3240,22 @@ export const data = [ method: 'POST', endpoint: 'https://api-eu.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$merge","properties":{"$distinct_ids":["test_user_id","5094f5704b9cf2b3"],"token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$merge', + properties: { + $distinct_ids: ['test_user_id', '5094f5704b9cf2b3'], + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -2682,8 +3347,26 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -2774,8 +3457,24 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $firstName: 'Mickey', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -2867,8 +3566,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$name":"Mickey Mouse","$country_code":"USA","$city":"Disney","$region":"US","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $name: 'Mickey Mouse', + $country_code: 'USA', + $city: 'Disney', + $region: 'US', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -2965,8 +3683,26 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -3061,8 +3797,26 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -3156,8 +3910,26 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -3250,8 +4022,24 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$first_name":"Mickey","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -3345,8 +4133,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$name":"Mickey Mouse","$country_code":"USA","$city":"Disney","$region":"US","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $name: 'Mickey Mouse', + $country_code: 'USA', + $city: 'Disney', + $region: 'US', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -3446,8 +4253,26 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -3550,15 +4375,57 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"FirstTrackCall12","properties":{"foo":"bar","$deviceId":"nkasdnkasd","anonymousId":"ea776ad0-3136-44fb-9216-5b1578609a2b","userId":"as09sufa09usaf09as0f9uasf","id":"as09sufa09usaf09as0f9uasf","firstName":"Bob","lastName":"Marley","name":"Bob Marley","age":43,"email":"bob@marleymail.com","phone":"+447748544123","birthday":"1987-01-01T20:08:59+0000","createdAt":"2022-01-21T14:10:12+0000","address":"51,B.L.T road, Kolkata-700060","description":"I am great","gender":"male","title":"Founder","username":"bobm","website":"https://bobm.com","randomProperty":"randomValue","$user_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$current_url":"http://127.0.0.1:7307/Testing/App_for_testingTool/","$referrer":"http://127.0.0.1:7307/Testing/","$screen_height":900,"$screen_width":1440,"$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.1.18","$insert_id":"0d5c1a4a-27e4-41da-a246-4d01f44e74bd","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1632986123523,"$browser":"Chrome","$browser_version":"93.0.4577.82"}}]', + batch: JSON.stringify([ + { + event: 'FirstTrackCall12', + properties: { + foo: 'bar', + $deviceId: 'nkasdnkasd', + anonymousId: 'ea776ad0-3136-44fb-9216-5b1578609a2b', + userId: 'as09sufa09usaf09as0f9uasf', + id: 'as09sufa09usaf09as0f9uasf', + firstName: 'Bob', + lastName: 'Marley', + name: 'Bob Marley', + age: 43, + email: 'bob@marleymail.com', + phone: '+447748544123', + birthday: '1987-01-01T20:08:59+0000', + createdAt: '2022-01-21T14:10:12+0000', + address: '51,B.L.T road, Kolkata-700060', + description: 'I am great', + gender: 'male', + title: 'Founder', + username: 'bobm', + website: 'https://bobm.com', + randomProperty: 'randomValue', + $user_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $current_url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', + $referrer: 'http://127.0.0.1:7307/Testing/', + $screen_height: 900, + $screen_width: 1440, + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'http://127.0.0.1:7307/Testing/', + $initial_referring_domain: '127.0.0.1:7307', + $app_build_number: '1.0.0', + $app_version_string: '1.1.18', + $insert_id: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1632986123523, + $browser: 'Chrome', + $browser_version: '93.0.4577.82', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -3743,15 +4610,44 @@ export const data = [ method: 'POST', endpoint: 'https://api-eu.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"MainActivity","properties":{"name":"MainActivity","automatic":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$user_id":"test_user_id","$os":"iOS","$screen_height":1794,"$screen_width":1080,"$screen_dpi":420,"$carrier":"Android","$os_version":"8.1.0","$device":"generic_x86","$manufacturer":"Google","$model":"Android SDK built for x86","mp_device_model":"Android SDK built for x86","$wifi":true,"$bluetooth_enabled":false,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"1","$app_version_string":"1.0","$insert_id":"id2","token":"test_api_token","distinct_id":"test_user_id","time":1520845503421}}]', + batch: JSON.stringify([ + { + event: 'MainActivity', + properties: { + name: 'MainActivity', + automatic: true, + anonymousId: '5094f5704b9cf2b3', + userId: 'test_user_id', + $user_id: 'test_user_id', + $os: 'iOS', + $screen_height: 1794, + $screen_width: 1080, + $screen_dpi: 420, + $carrier: 'Android', + $os_version: '8.1.0', + $device: 'generic_x86', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + mp_device_model: 'Android SDK built for x86', + $wifi: true, + $bluetooth_enabled: false, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '1', + $app_version_string: '1.0', + $insert_id: 'id2', + token: secret2, + distinct_id: 'test_user_id', + time: 1520845503421, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -4021,8 +4917,28 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402,"$ignore_time":true}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + $ignore_time: true, + }, + ]), }, XML: {}, FORM: {}, @@ -4127,8 +5043,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -4332,8 +5267,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"user1234","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'user1234', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -4351,14 +5305,21 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$merge","properties":{"$distinct_ids":["user1234","e6ab2c5e-2cda-44a9-a962-e2f67df78bca"],"token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$merge', + properties: { + $distinct_ids: ['user1234', 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca'], + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -4423,7 +5384,7 @@ export const data = [ originalTimestamp: '2022-09-05T07:46:20.290Z', }, destination: overrideDestination(sampleDestination, { - apiSecret: 'dummyApiKey', + apiSecret: secret3, useNewMapping: true, }), }, @@ -4443,15 +5404,43 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Application Installed","properties":{"build":4,"version":"1.0","anonymousId":"39da706ec83d0e90","$os":"Android","$screen_height":2984,"$screen_width":1440,"$screen_dpi":560,"$carrier":"T-Mobile","$os_version":"12","$device":"emu64a","$manufacturer":"Google","$model":"sdk_gphone64_arm64","mp_device_model":"sdk_gphone64_arm64","$wifi":true,"$bluetooth_enabled":true,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"4","$app_version_string":"1.0","$insert_id":"168cf720-6227-4b56-a98e-c49bdc7279e9","$session_id":"1662363980","token":"test_api_token","distinct_id":"39da706ec83d0e90","time":1662363980290}}]', + batch: JSON.stringify([ + { + event: 'Application Installed', + properties: { + build: 4, + version: '1.0', + anonymousId: '39da706ec83d0e90', + $os: 'Android', + $screen_height: 2984, + $screen_width: 1440, + $screen_dpi: 560, + $carrier: 'T-Mobile', + $os_version: '12', + $device: 'emu64a', + $manufacturer: 'Google', + $model: 'sdk_gphone64_arm64', + mp_device_model: 'sdk_gphone64_arm64', + $wifi: true, + $bluetooth_enabled: true, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '4', + $app_version_string: '1.0', + $insert_id: '168cf720-6227-4b56-a98e-c49bdc7279e9', + $session_id: '1662363980', + token: secret2, + distinct_id: '39da706ec83d0e90', + time: 1662363980290, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -4513,7 +5502,7 @@ export const data = [ originalTimestamp: '2022-09-05T07:46:20.290Z', }, destination: overrideDestination(sampleDestination, { - apiSecret: 'dummyApiKey', + apiSecret: secret3, useNewMapping: true, }), }, @@ -4533,15 +5522,43 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Application Opened","properties":{"build":4,"version":"1.0","anonymousId":"39da706ec83d0e90","$os":"Android","$screen_height":2984,"$screen_width":1440,"$screen_dpi":560,"$carrier":"T-Mobile","$os_version":"12","$device":"emu64a","$manufacturer":"Google","$model":"sdk_gphone64_arm64","mp_device_model":"sdk_gphone64_arm64","$wifi":true,"$bluetooth_enabled":true,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"4","$app_version_string":"1.0","$insert_id":"168cf720-6227-4b56-a98e-c49bdc7279e9","$session_id":"1662363980","token":"test_api_token","distinct_id":"39da706ec83d0e90","time":1662363980290}}]', + batch: JSON.stringify([ + { + event: 'Application Opened', + properties: { + build: 4, + version: '1.0', + anonymousId: '39da706ec83d0e90', + $os: 'Android', + $screen_height: 2984, + $screen_width: 1440, + $screen_dpi: 560, + $carrier: 'T-Mobile', + $os_version: '12', + $device: 'emu64a', + $manufacturer: 'Google', + $model: 'sdk_gphone64_arm64', + mp_device_model: 'sdk_gphone64_arm64', + $wifi: true, + $bluetooth_enabled: true, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '4', + $app_version_string: '1.0', + $insert_id: '168cf720-6227-4b56-a98e-c49bdc7279e9', + $session_id: '1662363980', + token: secret2, + distinct_id: '39da706ec83d0e90', + time: 1662363980290, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -4628,8 +5645,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"hjikl","$set":{"groupId":["testGroupId"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: 'hjikl', + $set: { groupId: ['testGroupId'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -4650,8 +5673,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"groupId","$group_id":"testGroupId","$set":{"company":"testComp","groupId":"groupIdInTraits"}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'groupId', + $group_id: 'testGroupId', + $set: { company: 'testComp', groupId: 'groupIdInTraits' }, + }, + ]), }, XML: {}, FORM: {}, @@ -4678,7 +5707,7 @@ export const data = [ description: 'Track: set device id and user id when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', }), message: { @@ -4736,15 +5765,42 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Product Viewed","properties":{"name":"T-Shirt","$user_id":"userId01","$os":"iOS","$screen_height":1794,"$screen_width":1080,"$screen_dpi":420,"$carrier":"Android","$os_version":"8.1.0","$device":"generic_x86","$manufacturer":"Google","$model":"Android SDK built for x86","mp_device_model":"Android SDK built for x86","$wifi":true,"$bluetooth_enabled":false,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"1","$app_version_string":"1.0","$insert_id":"id2","token":"test_api_token","distinct_id":"userId01","time":1579847342402,"$device_id":"anonId01"}}]', + batch: JSON.stringify([ + { + event: 'Product Viewed', + properties: { + name: 'T-Shirt', + $user_id: 'userId01', + $os: 'iOS', + $screen_height: 1794, + $screen_width: 1080, + $screen_dpi: 420, + $carrier: 'Android', + $os_version: '8.1.0', + $device: 'generic_x86', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + mp_device_model: 'Android SDK built for x86', + $wifi: true, + $bluetooth_enabled: false, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '1', + $app_version_string: '1.0', + $insert_id: 'id2', + token: secret2, + distinct_id: 'userId01', + time: 1579847342402, + $device_id: 'anonId01', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -4773,7 +5829,7 @@ export const data = [ { description: 'Identify: skip merge event when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', }), message: { @@ -4853,8 +5909,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"userId01","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'userId01', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -4882,7 +5957,7 @@ export const data = [ 'Identify: append $device: to deviceId while creating the user when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { apiKey: 'apiKey123', - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', }), message: { @@ -4961,8 +6036,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"$device:anonId01","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: '$device:anonId01', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -4989,7 +6083,7 @@ export const data = [ description: 'Unsupported alias call when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { apiKey: 'apiKey123', - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', }), message: { @@ -5078,7 +6172,7 @@ export const data = [ 'Track revenue event: set device id and user id when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { apiKey: 'apiKey123', - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', }), message: { @@ -5148,8 +6242,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2020-01-24T06:29:02.403Z","$amount":18.9}},"$token":"test_api_token","$distinct_id":"userId01"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2020-01-24T06:29:02.403Z', $amount: 18.9 }, + }, + $token: secret2, + $distinct_id: 'userId01', + }, + ]), }, XML: {}, FORM: {}, @@ -5166,15 +6267,42 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"test revenue MIXPANEL","properties":{"currency":"USD","revenue":18.9,"city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$user_id":"userId01","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"a6a0ad5a-bd26-4f19-8f75-38484e580fc7","token":"test_api_token","distinct_id":"userId01","time":1579847342403,"$device_id":"anonId01","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'test revenue MIXPANEL', + properties: { + currency: 'USD', + revenue: 18.9, + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstName: 'Mickey', + ip: '0.0.0.0', + $user_id: 'userId01', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'a6a0ad5a-bd26-4f19-8f75-38484e580fc7', + token: secret2, + distinct_id: 'userId01', + time: 1579847342403, + $device_id: 'anonId01', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -5204,7 +6332,7 @@ export const data = [ description: 'Page with anonymous user when simplified api is selected', destination: overrideDestination(sampleDestination, { apiKey: 'apiKey123', - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', }), message: { @@ -5273,15 +6401,36 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"$device:anonId01","time":1579847342402,"$device_id":"anonId01","name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Page', + properties: { + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: '$device:anonId01', + time: 1579847342402, + $device_id: 'anonId01', + name: 'Contact Us', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -5311,7 +6460,7 @@ export const data = [ description: 'Group call with anonymous user when simplified api is selected', destination: overrideDestination(sampleDestination, { apiKey: 'apiKey123', - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', groupKeySettings: [{ groupKey: 'company' }], }), @@ -5373,8 +6522,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"$device:anonId01","$set":{"company":["testComp"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: '$device:anonId01', + $set: { company: ['testComp'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -5395,8 +6550,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp","$set":{"company":"testComp"}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp', + $set: { company: 'testComp' }, + }, + ]), }, XML: {}, FORM: {}, @@ -5422,7 +6583,7 @@ export const data = [ { destination: overrideDestination(sampleDestination, { apiKey: 'apiKey123', - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', groupKeySettings: [{ groupKey: 'company' }], }), @@ -5540,9 +6701,9 @@ export const data = [ originalTimestamp: '2022-09-05T07:46:20.290Z', }, destination: overrideDestination(sampleDestination, { - apiKey: 'dummyApiKey', - token: 'test_api_token', - apiSecret: 'dummyApiKey', + apiKey: secret3, + token: secret2, + apiSecret: secret3, useNewMapping: true, }), }, @@ -5566,8 +6727,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2022-09-05T07:46:20.290Z","$amount":12.13}},"$token":"test_api_token","$distinct_id":"39da706ec83d0e90"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2022-09-05T07:46:20.290Z', $amount: 12.13 }, + }, + $token: secret2, + $distinct_id: '39da706ec83d0e90', + }, + ]), }, XML: {}, FORM: {}, @@ -5584,15 +6752,44 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Application Installed","properties":{"build":4,"version":"1.0","revenue":12.13,"anonymousId":"39da706ec83d0e90","$os":"Android","$screen_height":2984,"$screen_width":1440,"$screen_dpi":560,"$carrier":"T-Mobile","$os_version":"12","$device":"emu64a","$manufacturer":"Google","$model":"sdk_gphone64_arm64","mp_device_model":"sdk_gphone64_arm64","$wifi":true,"$bluetooth_enabled":true,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"4","$app_version_string":"1.0","$insert_id":"168cf720-6227-4b56-a98e-c49bdc7279e9","$session_id":"1662363980","token":"test_api_token","distinct_id":"39da706ec83d0e90","time":1662363980290}}]', + batch: JSON.stringify([ + { + event: 'Application Installed', + properties: { + build: 4, + version: '1.0', + revenue: 12.13, + anonymousId: '39da706ec83d0e90', + $os: 'Android', + $screen_height: 2984, + $screen_width: 1440, + $screen_dpi: 560, + $carrier: 'T-Mobile', + $os_version: '12', + $device: 'emu64a', + $manufacturer: 'Google', + $model: 'sdk_gphone64_arm64', + mp_device_model: 'sdk_gphone64_arm64', + $wifi: true, + $bluetooth_enabled: true, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '4', + $app_version_string: '1.0', + $insert_id: '168cf720-6227-4b56-a98e-c49bdc7279e9', + $session_id: '1662363980', + token: secret2, + distinct_id: '39da706ec83d0e90', + time: 1662363980290, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -5655,9 +6852,9 @@ export const data = [ originalTimestamp: '2022-09-05T07:46:20.290Z', }, destination: overrideDestination(sampleDestination, { - apiKey: 'dummyApiKey', - token: 'test_api_token', - apiSecret: 'dummyApiKey', + apiKey: secret3, + token: secret2, + apiSecret: secret3, useNewMapping: true, }), }, @@ -5681,8 +6878,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2022-09-05T07:46:20.290Z","$amount":23.45}},"$token":"test_api_token","$distinct_id":"39da706ec83d0e90"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2022-09-05T07:46:20.290Z', $amount: 23.45 }, + }, + $token: secret2, + $distinct_id: '39da706ec83d0e90', + }, + ]), }, XML: {}, FORM: {}, @@ -5699,15 +6903,44 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Application Installed","properties":{"build":4,"version":"1.0","revenue":23.45,"anonymousId":"39da706ec83d0e90","$os":"Android","$screen_height":2984,"$screen_width":1440,"$screen_dpi":560,"$carrier":"T-Mobile","$os_version":"12","$device":"emu64a","$manufacturer":"Google","$model":"sdk_gphone64_arm64","mp_device_model":"sdk_gphone64_arm64","$wifi":true,"$bluetooth_enabled":true,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"4","$app_version_string":"1.0","$insert_id":"168cf720-6227-4b56-a98e-c49bdc7279e9","$session_id":"1662363980","token":"test_api_token","distinct_id":"39da706ec83d0e90","time":null}}]', + batch: JSON.stringify([ + { + event: 'Application Installed', + properties: { + build: 4, + version: '1.0', + revenue: 23.45, + anonymousId: '39da706ec83d0e90', + $os: 'Android', + $screen_height: 2984, + $screen_width: 1440, + $screen_dpi: 560, + $carrier: 'T-Mobile', + $os_version: '12', + $device: 'emu64a', + $manufacturer: 'Google', + $model: 'sdk_gphone64_arm64', + mp_device_model: 'sdk_gphone64_arm64', + $wifi: true, + $bluetooth_enabled: true, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '4', + $app_version_string: '1.0', + $insert_id: '168cf720-6227-4b56-a98e-c49bdc7279e9', + $session_id: '1662363980', + token: secret2, + distinct_id: '39da706ec83d0e90', + time: null, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -5733,8 +6966,8 @@ export const data = [ { description: 'Track: with strict mode enabled', destination: overrideDestination(sampleDestination, { - apiKey: 'dummyApiKey', - token: 'test_api_token', + apiKey: secret3, + token: secret2, apiSecret: 'some_api_secret', dataResidency: 'eu', strictMode: true, @@ -5797,8 +7030,29 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1","$ios_app_version":"1.0"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + batch: JSON.stringify([ + { + $set: { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $screen_height: 1794, + $screen_width: 1080, + $wifi: true, + anonymousId: '5094f5704b9cf2b3', + userId: 'test_user_id', + $ios_devices: ['test_device_token'], + $os: 'iOS', + $ios_device_model: 'Android SDK built for x86', + $ios_version: '8.1.0', + $ios_app_release: '1.0', + $ios_app_version: '1', + }, + $token: secret2, + $distinct_id: 'test_user_id', + $time: 1584003903421, + }, + ]), }, XML: {}, FORM: {}, @@ -5815,15 +7069,22 @@ export const data = [ method: 'POST', endpoint: 'https://api-eu.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$merge","properties":{"$distinct_ids":["test_user_id","5094f5704b9cf2b3"],"token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$merge', + properties: { + $distinct_ids: ['test_user_id', '5094f5704b9cf2b3'], + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -6019,8 +7280,17 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set_once":{"$first_name":"Mickey test","$city":"Disney","nationality":"USA"},"$token":"dummyToken","$distinct_id":"Santiy"}]', + batch: JSON.stringify([ + { + $set_once: { + $first_name: 'Mickey test', + $city: 'Disney', + nationality: 'USA', + }, + $token: secret2, + $distinct_id: 'Santiy', + }, + ]), }, XML: {}, FORM: {}, @@ -6041,8 +7311,25 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"TestSanity@disney.com","$country_code":"USA","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","random":"superProp","$lastName":"VarChange","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"dummyToken","$distinct_id":"Santiy","$ip":"0.0.0.0","$time":null}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'TestSanity@disney.com', + $country_code: 'USA', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + random: 'superProp', + $lastName: 'VarChange', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'Santiy', + $ip: '0.0.0.0', + $time: null, + }, + ]), }, XML: {}, FORM: {}, @@ -6153,8 +7440,17 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set_once":{"$first_name":"Mickey test","$city":"Disney","nationality":"USA"},"$token":"dummyToken","$distinct_id":"$device:dummyAnnonymousId"}]', + batch: JSON.stringify([ + { + $set_once: { + $first_name: 'Mickey test', + $city: 'Disney', + nationality: 'USA', + }, + $token: secret2, + $distinct_id: '$device:dummyAnnonymousId', + }, + ]), }, XML: {}, FORM: {}, @@ -6175,8 +7471,25 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"TestSanity@disney.com","$country_code":"USA","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","random":"superProp","$lastName":"VarChange","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"dummyToken","$distinct_id":"$device:dummyAnnonymousId","$ip":"0.0.0.0","$time":null}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'TestSanity@disney.com', + $country_code: 'USA', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + random: 'superProp', + $lastName: 'VarChange', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: '$device:dummyAnnonymousId', + $ip: '0.0.0.0', + $time: null, + }, + ]), }, XML: {}, FORM: {}, @@ -6190,4 +7503,215 @@ export const data = [ }, }, }, + { + name: 'mp', + description: 'Track event test when dropTraitsInTrackEvent is true', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: overrideDestination(sampleDestination, { + dropTraitsInTrackEvent: true, + }), + message: { + type: 'track', + event: 'FirstTrackCall12', + sentAt: '2021-09-30T07:15:23.523Z', + channel: 'web', + context: { + os: { name: '', version: '' }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.18', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', + path: '/Testing/App_for_testingTool/', + title: 'Document', + search: '', + tab_url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', + referrer: 'http://127.0.0.1:7307/Testing/', + initial_referrer: 'http://127.0.0.1:7307/Testing/', + referring_domain: '127.0.0.1:7307', + initial_referring_domain: '127.0.0.1:7307', + }, + locale: 'en-US', + screen: { width: 1440, height: 900, density: 2, innerWidth: 590, innerHeight: 665 }, + traits: { + anonymousId: 'ea776ad0-3136-44fb-9216-5b1578609a2b', + userId: 'as09sufa09usaf09as0f9uasf', + id: 'as09sufa09usaf09as0f9uasf', + firstName: 'Bob', + lastName: 'Marley', + name: 'Bob Marley', + age: 43, + email: 'bob@marleymail.com', + phone: '+447748544123', + birthday: '1987-01-01T20:08:59+0000', + createdAt: '2022-01-21T14:10:12+0000', + address: '51,B.L.T road, Kolkata-700060', + description: 'I am great', + gender: 'male', + title: 'Founder', + username: 'bobm', + website: 'https://bobm.com', + randomProperty: 'randomValue', + }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.18' }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36', + }, + rudderId: '294702c7-8732-4fb3-b39f-f3bdffe1aa88', + messageId: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + properties: { foo: 'bar', $deviceId: 'nkasdnkasd' }, + anonymousId: '1dbb5784-b8e2-4074-8644-9920145b7ae5', + integrations: { All: true }, + originalTimestamp: '2021-09-30T07:15:23.523Z', + }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.mixpanel.com/import/', + headers: { + Authorization: authHeader2, + 'Content-Type': 'application/json', + }, + params: { strict: 0 }, + body: { + JSON: {}, + JSON_ARRAY: { + batch: JSON.stringify([ + { + event: 'FirstTrackCall12', + properties: { + foo: 'bar', + $deviceId: 'nkasdnkasd', + $user_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $current_url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', + $referrer: 'http://127.0.0.1:7307/Testing/', + $screen_height: 900, + $screen_width: 1440, + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'http://127.0.0.1:7307/Testing/', + $initial_referring_domain: '127.0.0.1:7307', + $app_build_number: '1.0.0', + $app_version_string: '1.1.18', + $insert_id: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1632986123523, + $browser: 'Chrome', + $browser_version: '93.0.4577.82', + }, + }, + ]), + }, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mp', + description: + 'Track event test when dropTraitsInTrackEvent is false/undefined and context.traits is undefined', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: overrideDestination(sampleDestination, {}), + message: { + type: 'track', + event: 'FirstTrackCall12', + sentAt: '2021-09-30T07:15:23.523Z', + channel: 'web', + rudderId: '294702c7-8732-4fb3-b39f-f3bdffe1aa88', + messageId: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + properties: { foo: 'bar', $deviceId: 'nkasdnkasd' }, + anonymousId: '1dbb5784-b8e2-4074-8644-9920145b7ae5', + integrations: { All: true }, + originalTimestamp: '2021-09-30T07:15:23.523Z', + }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.mixpanel.com/import/', + headers: { + Authorization: authHeader2, + 'Content-Type': 'application/json', + }, + params: { strict: 0 }, + body: { + JSON: {}, + JSON_ARRAY: { + batch: JSON.stringify([ + { + event: 'FirstTrackCall12', + properties: { + foo: 'bar', + $deviceId: 'nkasdnkasd', + $user_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $insert_id: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1632986123523, + }, + }, + ]), + }, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + statusCode: 200, + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/mp/router/data.ts b/test/integrations/destinations/mp/router/data.ts index 8716c9daa09..e6fa145eab5 100644 --- a/test/integrations/destinations/mp/router/data.ts +++ b/test/integrations/destinations/mp/router/data.ts @@ -1,5 +1,6 @@ import { overrideDestination } from '../../../testUtils'; import { sampleDestination } from '../common'; +import { authHeader2, secret1, secret2, secret3 } from '../maskedSecrets'; export const data = [ { @@ -15,8 +16,8 @@ export const data = [ { description: 'Page call', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, useOldMapping: true, strictMode: true, }), @@ -76,8 +77,8 @@ export const data = [ description: 'Track: set device id and user id when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, identityMergeApi: 'simplified', strictMode: true, }), @@ -124,8 +125,8 @@ export const data = [ { description: 'Identify call to create anonymous user profile', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, useOldMapping: true, strictMode: true, }), @@ -189,8 +190,8 @@ export const data = [ description: 'Identify: append $device: to deviceId while creating the user when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, identityMergeApi: 'simplified', strictMode: true, }), @@ -254,8 +255,8 @@ export const data = [ { description: 'Merge call with strict mode enabled', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, strictMode: true, }), metadata: { jobId: 5, additionalProp: 5, userId: 'u1' }, @@ -300,8 +301,8 @@ export const data = [ { description: 'Group call', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, groupKeySettings: [ { groupKey: 'company', @@ -363,8 +364,8 @@ export const data = [ { description: 'Group key not present in traits', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, groupKeySettings: [ { groupKey: 'company', @@ -442,15 +443,36 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: {}, GZIP: { - payload: - '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1688624942402,"name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + payload: JSON.stringify([ + { + event: 'Loaded a Page', + properties: { + ip: '0.0.0.0', + $user_id: 'hjikl', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjikl', + time: 1688624942402, + name: 'Contact Us', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -462,9 +484,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, useNativeSDK: false, useOldMapping: true, @@ -474,6 +496,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -494,8 +517,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2023-07-06T06:29:02.402Z","$amount":18.9}},"$token":"test_api_token","$distinct_id":"userId01"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2023-07-06T06:29:02.402Z', $amount: 18.9 }, + }, + $token: secret2, + $distinct_id: 'userId01', + }, + ]), }, XML: {}, FORM: {}, @@ -509,15 +539,43 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: {}, GZIP: { - payload: - '[{"event":"Product Viewed","properties":{"name":"T-Shirt","revenue":18.9,"$user_id":"userId01","$os":"iOS","$screen_height":1794,"$screen_width":1080,"$screen_dpi":420,"$carrier":"Android","$os_version":"8.1.0","$device":"generic_x86","$manufacturer":"Google","$model":"Android SDK built for x86","mp_device_model":"Android SDK built for x86","$wifi":true,"$bluetooth_enabled":false,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"1","$app_version_string":"1.0","$insert_id":"id2","token":"test_api_token","distinct_id":"userId01","time":1688624942402,"$device_id":"anonId01"}}]', + payload: JSON.stringify([ + { + event: 'Product Viewed', + properties: { + name: 'T-Shirt', + revenue: 18.9, + $user_id: 'userId01', + $os: 'iOS', + $screen_height: 1794, + $screen_width: 1080, + $screen_dpi: 420, + $carrier: 'Android', + $os_version: '8.1.0', + $device: 'generic_x86', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + mp_device_model: 'Android SDK built for x86', + $wifi: true, + $bluetooth_enabled: false, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '1', + $app_version_string: '1.0', + $insert_id: 'id2', + token: secret2, + distinct_id: 'userId01', + time: 1688624942402, + $device_id: 'anonId01', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -530,9 +588,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, identityMergeApi: 'simplified', strictMode: true, @@ -542,6 +600,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -562,8 +621,64 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"$device:anonId01","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1","$ios_app_version":"1.0"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $firstName: 'Mickey', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1688624942402, + }, + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: '$device:anonId01', + $ip: '0.0.0.0', + $time: 1688624942402, + }, + { + $set: { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $screen_height: 1794, + $screen_width: 1080, + $wifi: true, + anonymousId: '5094f5704b9cf2b3', + userId: 'test_user_id', + $ios_devices: ['test_device_token'], + $os: 'iOS', + $ios_device_model: 'Android SDK built for x86', + $ios_version: '8.1.0', + $ios_app_release: '1.0', + $ios_app_version: '1', + }, + $token: secret2, + $distinct_id: 'test_user_id', + $time: 1584003903421, + }, + ]), }, XML: {}, FORM: {}, @@ -577,15 +692,22 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: {}, GZIP: { - payload: - '[{"event":"$merge","properties":{"$distinct_ids":["test_user_id","5094f5704b9cf2b3"],"token":"test_api_token"}}]', + payload: JSON.stringify([ + { + event: '$merge', + properties: { + $distinct_ids: ['test_user_id', '5094f5704b9cf2b3'], + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -602,9 +724,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, useNativeSDK: false, useOldMapping: true, @@ -614,6 +736,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -634,8 +757,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"userId06","$set":{"company":["testComp"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: 'userId06', + $set: { company: ['testComp'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -652,8 +781,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp","$set":{"company":"testComp"}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp', + $set: { company: 'testComp' }, + }, + ]), }, XML: {}, FORM: {}, @@ -666,9 +801,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, groupKeySettings: [{ groupKey: 'company' }], strictMode: true, @@ -678,6 +813,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -702,9 +838,9 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, useNativeSDK: false, groupKeySettings: [{ groupKey: 'company' }], @@ -714,6 +850,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -740,8 +877,7 @@ export const data = [ { description: 'Page call', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, useOldMapping: true, strictMode: true, }), @@ -801,8 +937,8 @@ export const data = [ description: 'Track: set device id and user id when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, identityMergeApi: 'simplified', strictMode: true, }), @@ -849,8 +985,8 @@ export const data = [ { description: 'Identify call to create anonymous user profile', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, useOldMapping: true, strictMode: true, }), @@ -914,8 +1050,8 @@ export const data = [ description: 'Identify: append $device: to deviceId while creating the user when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, identityMergeApi: 'simplified', strictMode: true, }), @@ -979,8 +1115,8 @@ export const data = [ { description: 'Merge call with strict mode enabled', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, strictMode: true, }), metadata: { jobId: 5, additionalProp: 5, userId: 'u1' }, @@ -1025,8 +1161,8 @@ export const data = [ { description: 'Group call', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, groupKeySettings: [ { groupKey: 'company', @@ -1088,8 +1224,8 @@ export const data = [ { description: 'Group key not present in traits', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, groupKeySettings: [ { groupKey: 'company', @@ -1166,14 +1302,35 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1688624942402,"name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Page', + properties: { + ip: '0.0.0.0', + $user_id: 'hjikl', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjikl', + time: 1688624942402, + name: 'Contact Us', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1185,9 +1342,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, useNativeSDK: false, useOldMapping: true, @@ -1197,6 +1354,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -1217,8 +1375,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2023-07-06T06:29:02.402Z","$amount":18.9}},"$token":"test_api_token","$distinct_id":"userId01"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2023-07-06T06:29:02.402Z', $amount: 18.9 }, + }, + $token: secret2, + $distinct_id: 'userId01', + }, + ]), }, XML: {}, FORM: {}, @@ -1232,14 +1397,42 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Product Viewed","properties":{"name":"T-Shirt","revenue":18.9,"$user_id":"userId01","$os":"iOS","$screen_height":1794,"$screen_width":1080,"$screen_dpi":420,"$carrier":"Android","$os_version":"8.1.0","$device":"generic_x86","$manufacturer":"Google","$model":"Android SDK built for x86","mp_device_model":"Android SDK built for x86","$wifi":true,"$bluetooth_enabled":false,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"1","$app_version_string":"1.0","$insert_id":"id2","token":"test_api_token","distinct_id":"userId01","time":1688624942402,"$device_id":"anonId01"}}]', + batch: JSON.stringify([ + { + event: 'Product Viewed', + properties: { + name: 'T-Shirt', + revenue: 18.9, + $user_id: 'userId01', + $os: 'iOS', + $screen_height: 1794, + $screen_width: 1080, + $screen_dpi: 420, + $carrier: 'Android', + $os_version: '8.1.0', + $device: 'generic_x86', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + mp_device_model: 'Android SDK built for x86', + $wifi: true, + $bluetooth_enabled: false, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '1', + $app_version_string: '1.0', + $insert_id: 'id2', + token: secret2, + distinct_id: 'userId01', + time: 1688624942402, + $device_id: 'anonId01', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1252,9 +1445,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, identityMergeApi: 'simplified', strictMode: true, @@ -1264,6 +1457,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -1284,8 +1478,64 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"$device:anonId01","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1","$ios_app_version":"1.0"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $firstName: 'Mickey', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1688624942402, + }, + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: '$device:anonId01', + $ip: '0.0.0.0', + $time: 1688624942402, + }, + { + $set: { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $screen_height: 1794, + $screen_width: 1080, + $wifi: true, + anonymousId: '5094f5704b9cf2b3', + userId: 'test_user_id', + $ios_devices: ['test_device_token'], + $os: 'iOS', + $ios_device_model: 'Android SDK built for x86', + $ios_version: '8.1.0', + $ios_app_release: '1.0', + $ios_app_version: '1', + }, + $token: secret2, + $distinct_id: 'test_user_id', + $time: 1584003903421, + }, + ]), }, XML: {}, FORM: {}, @@ -1299,14 +1549,21 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$merge","properties":{"$distinct_ids":["test_user_id","5094f5704b9cf2b3"],"token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$merge', + properties: { + $distinct_ids: ['test_user_id', '5094f5704b9cf2b3'], + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1323,9 +1580,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, useNativeSDK: false, useOldMapping: true, @@ -1335,6 +1592,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -1355,8 +1613,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"userId06","$set":{"company":["testComp"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: 'userId06', + $set: { company: ['testComp'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -1373,8 +1637,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp","$set":{"company":"testComp"}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp', + $set: { company: 'testComp' }, + }, + ]), }, XML: {}, FORM: {}, @@ -1387,9 +1657,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, groupKeySettings: [{ groupKey: 'company' }], strictMode: true, @@ -1399,6 +1669,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -1423,9 +1694,9 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, useNativeSDK: false, groupKeySettings: [{ groupKey: 'company' }], @@ -1435,6 +1706,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', diff --git a/test/integrations/destinations/ometria/processor/data.ts b/test/integrations/destinations/ometria/processor/data.ts index c28854c9fd9..6f70c37efad 100644 --- a/test/integrations/destinations/ometria/processor/data.ts +++ b/test/integrations/destinations/ometria/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'ometria', @@ -55,7 +57,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'EXPLICITLY_OPTEDOUT', @@ -77,13 +79,24 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testone@gmail.com","id":"test1","customer_id":"userId1","firstname":"test","lastname":"one","@type":"contact","properties":{"field1":"val1","ip":"0.0.0.0"},"marketing_optin":"EXPLICITLY_OPTEDOUT","channels":{"sms":{"allow_marketing":false,"allow_transactional":false}}}]', + batch: JSON.stringify([ + { + email: 'testone@gmail.com', + id: 'test1', + customer_id: 'userId1', + firstname: 'test', + lastname: 'one', + '@type': 'contact', + properties: { field1: 'val1', ip: '0.0.0.0' }, + marketing_optin: 'EXPLICITLY_OPTEDOUT', + channels: { sms: { allow_marketing: false, allow_transactional: false } }, + }, + ]), }, XML: {}, FORM: {}, @@ -153,7 +166,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'EXPLICITLY_OPTEDOUT', @@ -175,13 +188,24 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testone@gmail.com","id":"updatedId1","customer_id":"userId1","firstname":"test","lastname":"one","@type":"contact","properties":{"field1":"val1","ip":"0.0.0.0"},"marketing_optin":"EXPLICITLY_OPTEDOUT","channels":{"sms":{"allow_marketing":true,"allow_transactional":false}}}]', + batch: JSON.stringify([ + { + email: 'testone@gmail.com', + id: 'updatedId1', + customer_id: 'userId1', + firstname: 'test', + lastname: 'one', + '@type': 'contact', + properties: { field1: 'val1', ip: '0.0.0.0' }, + marketing_optin: 'EXPLICITLY_OPTEDOUT', + channels: { sms: { allow_marketing: true, allow_transactional: false } }, + }, + ]), }, XML: {}, FORM: {}, @@ -250,7 +274,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'EXPLICITLY_OPTEDOUT', @@ -272,13 +296,25 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testone@gmail.com","id":"test1","customer_id":"userId1","@type":"contact","properties":{"field1":"val1","ip":"0.0.0.0"},"marketing_optin":"EXPLICITLY_OPTEDOUT","channels":{"sms":{"allow_marketing":false,"allow_transactional":false}},"firstname":"test","middlename":"one","lastname":"two"}]', + batch: JSON.stringify([ + { + email: 'testone@gmail.com', + id: 'test1', + customer_id: 'userId1', + '@type': 'contact', + properties: { field1: 'val1', ip: '0.0.0.0' }, + marketing_optin: 'EXPLICITLY_OPTEDOUT', + channels: { sms: { allow_marketing: false, allow_transactional: false } }, + firstname: 'test', + middlename: 'one', + lastname: 'two', + }, + ]), }, XML: {}, FORM: {}, @@ -349,7 +385,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'NOT_SPECIFIED', @@ -371,13 +407,25 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testone@gmail.com","id":"test1","phone_number":"+911234567890","customer_id":"userId1","@type":"contact","properties":{"field1":"val1"},"marketing_optin":"NOT_SPECIFIED","channels":{"sms":{"allow_marketing":false,"allow_transactional":false}},"firstname":"test","lastname":"one"}]', + batch: JSON.stringify([ + { + email: 'testone@gmail.com', + id: 'test1', + phone_number: '+911234567890', + customer_id: 'userId1', + '@type': 'contact', + properties: { field1: 'val1' }, + marketing_optin: 'NOT_SPECIFIED', + channels: { sms: { allow_marketing: false, allow_transactional: false } }, + firstname: 'test', + lastname: 'one', + }, + ]), }, XML: {}, FORM: {}, @@ -450,7 +498,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'NOT_SPECIFIED', @@ -472,13 +520,25 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testone@gmail.com","id":"test1","phone_number":"+911234567890","customer_id":"userId1","@type":"contact","properties":{"field1":"val1"},"marketing_optin":"NOT_SPECIFIED","channels":{"sms":{"allow_marketing":true,"allow_transactional":true}},"firstname":"test","lastname":"one"}]', + batch: JSON.stringify([ + { + email: 'testone@gmail.com', + id: 'test1', + phone_number: '+911234567890', + customer_id: 'userId1', + '@type': 'contact', + properties: { field1: 'val1' }, + marketing_optin: 'NOT_SPECIFIED', + channels: { sms: { allow_marketing: true, allow_transactional: true } }, + firstname: 'test', + lastname: 'one', + }, + ]), }, XML: {}, FORM: {}, @@ -545,7 +605,7 @@ export const data = [ integrations: { All: true }, sentAt: '2019-10-14T09:03:22.563Z', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, }, ], method: 'POST', @@ -562,13 +622,22 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"id":"eventId1","timestamp":"2017-05-01T14:00:00Z","identity_email":"testone@gmail.com","identity_account_id":"userId1","@type":"custom_event","event_type":"event name","properties":{"field1":"val1"}}]', + batch: JSON.stringify([ + { + id: 'eventId1', + timestamp: '2017-05-01T14:00:00Z', + identity_email: 'testone@gmail.com', + identity_account_id: 'userId1', + '@type': 'custom_event', + event_type: 'event name', + properties: { field1: 'val1' }, + }, + ]), }, XML: {}, FORM: {}, @@ -637,7 +706,7 @@ export const data = [ integrations: { All: true }, sentAt: '2019-10-14T09:03:22.563Z', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, }, ], method: 'POST', @@ -654,13 +723,30 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"id":"orderId1","timestamp":"2017-05-01T14:00:00Z","grand_total":1000,"currency":"INR","ip_address":"0.0.0.0","customer":{"id":"userId1","email":"testone@gmail.com","firstname":"test","lastname":"one"},"@type":"order","status":"complete","is_valid":true,"properties":{"field1":"val1"}}]', + batch: JSON.stringify([ + { + id: 'orderId1', + timestamp: '2017-05-01T14:00:00Z', + grand_total: 1000, + currency: 'INR', + ip_address: '0.0.0.0', + customer: { + id: 'userId1', + email: 'testone@gmail.com', + firstname: 'test', + lastname: 'one', + }, + '@type': 'order', + status: 'complete', + is_valid: true, + properties: { field1: 'val1' }, + }, + ]), }, XML: {}, FORM: {}, @@ -730,7 +816,7 @@ export const data = [ integrations: { All: true }, sentAt: '2019-10-14T09:03:22.563Z', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, }, ], method: 'POST', @@ -747,13 +833,31 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"id":"orderId1","timestamp":"2017-05-01T14:00:00Z","grand_total":1000,"currency":"INR","ip_address":"0.0.0.0","customer":{"id":"userId1","email":"testone@gmail.com","firstname":"test","lastname":"one"},"@type":"order","status":"complete","is_valid":true,"properties":{"field1":"val1"},"lineitems":[{"product_id":"prod123","quantity":4,"subtotal":10}]}]', + batch: JSON.stringify([ + { + id: 'orderId1', + timestamp: '2017-05-01T14:00:00Z', + grand_total: 1000, + currency: 'INR', + ip_address: '0.0.0.0', + customer: { + id: 'userId1', + email: 'testone@gmail.com', + firstname: 'test', + lastname: 'one', + }, + '@type': 'order', + status: 'complete', + is_valid: true, + properties: { field1: 'val1' }, + lineitems: [{ product_id: 'prod123', quantity: 4, subtotal: 10 }], + }, + ]), }, XML: {}, FORM: {}, @@ -830,7 +934,7 @@ export const data = [ integrations: { All: true }, sentAt: '2019-10-14T09:03:22.563Z', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, }, ], method: 'POST', @@ -847,13 +951,38 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"id":"orderId1","timestamp":"2017-05-01T14:00:00Z","grand_total":1000,"currency":"INR","ip_address":"0.0.0.0","customer":{"id":"userId1","email":"testone@gmail.com","firstname":"test","lastname":"one"},"@type":"order","status":"complete","is_valid":true,"properties":{"field1":"val1"},"lineitems":[{"product_id":"prod123","quantity":4,"subtotal":10,"variant_options":[{"id":"newid","type":"size","label":"5"}]}]}]', + batch: JSON.stringify([ + { + id: 'orderId1', + timestamp: '2017-05-01T14:00:00Z', + grand_total: 1000, + currency: 'INR', + ip_address: '0.0.0.0', + customer: { + id: 'userId1', + email: 'testone@gmail.com', + firstname: 'test', + lastname: 'one', + }, + '@type': 'order', + status: 'complete', + is_valid: true, + properties: { field1: 'val1' }, + lineitems: [ + { + product_id: 'prod123', + quantity: 4, + subtotal: 10, + variant_options: [{ id: 'newid', type: 'size', label: '5' }], + }, + ], + }, + ]), }, XML: {}, FORM: {}, @@ -932,7 +1061,7 @@ export const data = [ integrations: { All: true }, sentAt: '2019-10-14T09:03:22.563Z', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, }, ], method: 'POST', @@ -949,13 +1078,38 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"id":"orderId1","timestamp":"2017-05-01T14:00:00Z","grand_total":1000,"currency":"INR","ip_address":"0.0.0.0","customer":{"id":"userId1","email":"testone@gmail.com","firstname":"test","lastname":"one"},"@type":"order","status":"complete","is_valid":true,"properties":{"field1":"val1"},"lineitems":[{"product_id":"prod123","quantity":4,"subtotal":10,"variant_options":[{"id":"newid","type":"size","label":"5"}]}]}]', + batch: JSON.stringify([ + { + id: 'orderId1', + timestamp: '2017-05-01T14:00:00Z', + grand_total: 1000, + currency: 'INR', + ip_address: '0.0.0.0', + customer: { + id: 'userId1', + email: 'testone@gmail.com', + firstname: 'test', + lastname: 'one', + }, + '@type': 'order', + status: 'complete', + is_valid: true, + properties: { field1: 'val1' }, + lineitems: [ + { + product_id: 'prod123', + quantity: 4, + subtotal: 10, + variant_options: [{ id: 'newid', type: 'size', label: '5' }], + }, + ], + }, + ]), }, XML: {}, FORM: {}, @@ -1038,7 +1192,7 @@ export const data = [ integrations: { All: true }, sentAt: '2019-10-14T09:03:22.563Z', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, }, ], method: 'POST', @@ -1055,13 +1209,44 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"id":"orderId1","timestamp":"2017-05-01T14:00:00Z","grand_total":1000,"currency":"INR","ip_address":"0.0.0.0","shipping_address":{"city":"Kolkata","state":"West Bengal","country_code":"IN","postcode":"700001"},"customer":{"id":"userId1","email":"testone@gmail.com","firstname":"test","lastname":"one"},"@type":"order","status":"complete","is_valid":true,"properties":{"field1":"val1"},"lineitems":[{"product_id":"prod123","quantity":4,"subtotal":10,"variant_options":[{"id":"newid","type":"size","label":"5"}]}]}]', + batch: JSON.stringify([ + { + id: 'orderId1', + timestamp: '2017-05-01T14:00:00Z', + grand_total: 1000, + currency: 'INR', + ip_address: '0.0.0.0', + shipping_address: { + city: 'Kolkata', + state: 'West Bengal', + country_code: 'IN', + postcode: '700001', + }, + customer: { + id: 'userId1', + email: 'testone@gmail.com', + firstname: 'test', + lastname: 'one', + }, + '@type': 'order', + status: 'complete', + is_valid: true, + properties: { field1: 'val1' }, + lineitems: [ + { + product_id: 'prod123', + quantity: 4, + subtotal: 10, + variant_options: [{ id: 'newid', type: 'size', label: '5' }], + }, + ], + }, + ]), }, XML: {}, FORM: {}, diff --git a/test/integrations/destinations/ometria/router/data.ts b/test/integrations/destinations/ometria/router/data.ts index 58f3a91d877..246a23c5d5f 100644 --- a/test/integrations/destinations/ometria/router/data.ts +++ b/test/integrations/destinations/ometria/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'ometria', @@ -103,7 +105,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'EXPLICITLY_OPTEDOUT', @@ -207,7 +209,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'EXPLICITLY_OPTEDOUT', @@ -234,13 +236,35 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testone@gmail.com","id":"test1","customer_id":"userId1","firstname":"test","lastname":"one","@type":"contact","properties":{"field1":"val1","ip":"0.0.0.0"},"marketing_optin":"EXPLICITLY_OPTEDOUT","channels":{"sms":{"allow_marketing":false,"allow_transactional":false}}},{"email":"testone@gmail.com","id":"updatedId1","customer_id":"userId1","firstname":"test","lastname":"one","@type":"contact","properties":{"field1":"val1","ip":"0.0.0.0"},"marketing_optin":"EXPLICITLY_OPTEDOUT","channels":{"sms":{"allow_marketing":true,"allow_transactional":false}}}]', + batch: JSON.stringify([ + { + email: 'testone@gmail.com', + id: 'test1', + customer_id: 'userId1', + firstname: 'test', + lastname: 'one', + '@type': 'contact', + properties: { field1: 'val1', ip: '0.0.0.0' }, + marketing_optin: 'EXPLICITLY_OPTEDOUT', + channels: { sms: { allow_marketing: false, allow_transactional: false } }, + }, + { + email: 'testone@gmail.com', + id: 'updatedId1', + customer_id: 'userId1', + firstname: 'test', + lastname: 'one', + '@type': 'contact', + properties: { field1: 'val1', ip: '0.0.0.0' }, + marketing_optin: 'EXPLICITLY_OPTEDOUT', + channels: { sms: { allow_marketing: true, allow_transactional: false } }, + }, + ]), }, XML: {}, FORM: {}, @@ -291,7 +315,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'EXPLICITLY_OPTEDOUT', diff --git a/test/integrations/destinations/optimizely_fullstack/network.ts b/test/integrations/destinations/optimizely_fullstack/network.ts index e6a1101ab90..a894449ae4d 100644 --- a/test/integrations/destinations/optimizely_fullstack/network.ts +++ b/test/integrations/destinations/optimizely_fullstack/network.ts @@ -37,8 +37,15 @@ const deleteNwData = [ { id: '$opt_test_audience', name: 'Optimizely-Generated Audience for Backwards Compatibility', - conditions: - '["or", {"match": "exact", "name": "$opt_test_attribute", "type": "custom_attribute", "value": "$opt_test_value"}]', + conditions: JSON.stringify([ + 'or', + { + match: 'exact', + name: '$opt_test_attribute', + type: 'custom_attribute', + value: '$opt_test_value', + }, + ]), }, ], version: '4', diff --git a/test/integrations/destinations/optimizely_fullstack/processor/data.ts b/test/integrations/destinations/optimizely_fullstack/processor/data.ts index fb514bc6b8a..56bd93490e3 100644 --- a/test/integrations/destinations/optimizely_fullstack/processor/data.ts +++ b/test/integrations/destinations/optimizely_fullstack/processor/data.ts @@ -598,8 +598,17 @@ export const data = [ status: 200, body: [ { - error: - '{"message":"{\\"message\\":\\"Data File Lookup Failed due to {\\\\\\"code\\\\\\":\\\\\\"document_not_found\\\\\\",\\\\\\"message\\\\\\":\\\\\\"document_not_found\\\\\\"}: Workflow: procWorkflow, Step: dataFile, ChildStep: undefined, OriginalError: Data File Lookup Failed due to {\\\\\\"code\\\\\\":\\\\\\"document_not_found\\\\\\",\\\\\\"message\\\\\\":\\\\\\"document_not_found\\\\\\"}\\",\\"destinationResponse\\":{\\"code\\":\\"document_not_found\\",\\"message\\":\\"document_not_found\\"}}","destinationResponse":{"code":"document_not_found","message":"document_not_found"}}', + error: JSON.stringify({ + message: JSON.stringify({ + message: + 'Data File Lookup Failed due to {"code":"document_not_found","message":"document_not_found"}: Workflow: procWorkflow, Step: dataFile, ChildStep: undefined, OriginalError: Data File Lookup Failed due to {"code":"document_not_found","message":"document_not_found"}', + destinationResponse: { code: 'document_not_found', message: 'document_not_found' }, + }), + destinationResponse: { + code: 'document_not_found', + message: 'document_not_found', + }, + }), statTags: { destType: 'OPTIMIZELY_FULLSTACK', errorCategory: 'network', diff --git a/test/integrations/destinations/ortto/processor/data.ts b/test/integrations/destinations/ortto/processor/data.ts index ff84f5dbbd1..903765a94b5 100644 --- a/test/integrations/destinations/ortto/processor/data.ts +++ b/test/integrations/destinations/ortto/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'ortto', @@ -18,7 +20,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -149,7 +151,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.ap3api.com/v1/person/merge', headers: { - 'X-Api-Key': 'dummyApiKey', + 'X-Api-Key': defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -219,7 +221,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -383,7 +385,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -542,7 +544,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, orttoEventsMapping: [ { rsEventName: 'RudderEvent', @@ -868,7 +870,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -1006,7 +1008,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.ap3api.com/v1/activities/create', headers: { - 'X-Api-Key': 'dummyApiKey', + 'X-Api-Key': defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -1084,7 +1086,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -1221,7 +1223,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.ap3api.com/v1/activities/create', headers: { - 'X-Api-Key': 'dummyApiKey', + 'X-Api-Key': defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -1296,7 +1298,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { diff --git a/test/integrations/destinations/ortto/router/data.ts b/test/integrations/destinations/ortto/router/data.ts index 8999637a669..0e94045e544 100644 --- a/test/integrations/destinations/ortto/router/data.ts +++ b/test/integrations/destinations/ortto/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'ortto', @@ -19,7 +21,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -140,7 +142,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -314,7 +316,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.ap3api.com/v1/person/merge', headers: { - 'X-Api-Key': 'dummyApiKey', + 'X-Api-Key': defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -338,7 +340,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -424,7 +426,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.ap3api.com/v1/activities/create', headers: { - 'X-Api-Key': 'dummyApiKey', + 'X-Api-Key': defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -448,7 +450,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { diff --git a/test/integrations/destinations/pardot/dataDelivery/constant.ts b/test/integrations/destinations/pardot/dataDelivery/constant.ts index 97e456998e1..ff7a570a821 100644 --- a/test/integrations/destinations/pardot/dataDelivery/constant.ts +++ b/test/integrations/destinations/pardot/dataDelivery/constant.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; export const retryStatTags = { destType: 'PARDOT', errorCategory: 'network', @@ -9,7 +10,7 @@ export const retryStatTags = { module: 'destination', }; const commonHeaders = { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8', 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', 'User-Agent': 'RudderLabs', diff --git a/test/integrations/destinations/pardot/maskedSecrets.ts b/test/integrations/destinations/pardot/maskedSecrets.ts new file mode 100644 index 00000000000..61db9ef38a9 --- /dev/null +++ b/test/integrations/destinations/pardot/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/pardot/network.ts b/test/integrations/destinations/pardot/network.ts index 9493aab01fb..bcff01361cd 100644 --- a/test/integrations/destinations/pardot/network.ts +++ b/test/integrations/destinations/pardot/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; import { getFormData } from '../../../../src/adapters/network'; export const networkCallsData = [ @@ -268,7 +269,7 @@ export const networkCallsData = [ }).toString(), params: { destination: 'pardot' }, headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8', 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', 'User-Agent': 'RudderLabs', diff --git a/test/integrations/destinations/pardot/router/data.ts b/test/integrations/destinations/pardot/router/data.ts index 0862666bbab..23ebb973fa2 100644 --- a/test/integrations/destinations/pardot/router/data.ts +++ b/test/integrations/destinations/pardot/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader2, secret2 } from '../maskedSecrets'; import { FEATURES, MODULES } from '../../../../../src/v0/util/tags'; export const data = [ @@ -56,7 +57,7 @@ export const data = [ }, metadata: { jobId: 1, - secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret1, refresh_token: 'myRefreshToken' }, userId: 'u1', }, message: { @@ -163,7 +164,7 @@ export const data = [ }, metadata: { jobId: 2, - secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret1, refresh_token: 'myRefreshToken' }, userId: 'u1', }, message: { @@ -269,7 +270,7 @@ export const data = [ }, metadata: { jobId: 3, - secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret1, refresh_token: 'myRefreshToken' }, userId: 'u1', }, message: { @@ -376,7 +377,7 @@ export const data = [ }, metadata: { jobId: 4, - secret: { access_token: 'myExpiredToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret2, refresh_token: 'myRefreshToken' }, userId: 'u1', }, message: { @@ -557,7 +558,7 @@ export const data = [ method: 'POST', endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/id/123435', headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, params: {}, @@ -578,7 +579,7 @@ export const data = [ metadata: [ { jobId: 1, - secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret1, refresh_token: 'myRefreshToken' }, userId: 'u1', }, ], @@ -635,7 +636,7 @@ export const data = [ endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/email/Roger_12@waltair.io', headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, params: {}, @@ -656,7 +657,7 @@ export const data = [ metadata: [ { jobId: 2, - secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret1, refresh_token: 'myRefreshToken' }, userId: 'u1', }, ], @@ -713,7 +714,7 @@ export const data = [ endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/fid/00Q6r000002LKhTPVR', headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, params: {}, @@ -734,7 +735,7 @@ export const data = [ metadata: [ { jobId: 3, - secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret1, refresh_token: 'myRefreshToken' }, userId: 'u1', }, ], @@ -791,7 +792,7 @@ export const data = [ endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/email/rolex_waltair@mywebsite.io', headers: { - Authorization: 'Bearer myExpiredToken', + Authorization: authHeader2, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, params: {}, @@ -812,7 +813,7 @@ export const data = [ metadata: [ { jobId: 4, - secret: { access_token: 'myExpiredToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret2, refresh_token: 'myRefreshToken' }, userId: 'u1', }, ], @@ -936,7 +937,7 @@ export const data = [ method: 'POST', endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/id/123435', headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, body: { @@ -1072,7 +1073,7 @@ export const data = [ endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/email/Roger_12@waltair.io', headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, body: { @@ -1207,7 +1208,7 @@ export const data = [ method: 'POST', endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/fid/00Q6r000002LKhTPVR', headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, body: { @@ -1343,7 +1344,7 @@ export const data = [ endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/email/rolex_waltair@mywebsite.io', headers: { - Authorization: 'Bearer myExpiredToken', + Authorization: authHeader2, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, body: { diff --git a/test/integrations/destinations/persistiq/processor/data.ts b/test/integrations/destinations/persistiq/processor/data.ts index 05bafe6123f..b4f07ea7cc9 100644 --- a/test/integrations/destinations/persistiq/processor/data.ts +++ b/test/integrations/destinations/persistiq/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'persistiq', @@ -43,7 +45,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, persistIqAttributesMapping: [ { from: 'useroccupation', @@ -87,7 +89,7 @@ export const data = [ files: {}, userId: '', headers: { - 'x-api-key': 'dummyApiKey', + 'x-api-key': defaultApiKey, }, method: 'PATCH', params: {}, @@ -140,7 +142,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, persistIqAttributesMapping: [ { from: 'useroccupation', @@ -189,7 +191,7 @@ export const data = [ files: {}, userId: '', headers: { - 'x-api-key': 'dummyApiKey', + 'x-api-key': defaultApiKey, }, method: 'POST', params: {}, @@ -224,7 +226,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, }, @@ -285,7 +287,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, }, @@ -339,7 +341,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, }, @@ -400,7 +402,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, }, @@ -429,7 +431,7 @@ export const data = [ method: 'POST', params: {}, headers: { - 'x-api-key': 'dummyApiKey', + 'x-api-key': defaultApiKey, }, version: '1', endpoint: 'https://api.persistiq.com/v1/campaigns/testgroup1/leads', @@ -472,7 +474,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, }, @@ -498,7 +500,7 @@ export const data = [ method: 'DELETE', params: {}, headers: { - 'x-api-key': 'dummyApiKey', + 'x-api-key': defaultApiKey, }, version: '1', endpoint: 'https://api.persistiq.com/v1/campaigns/testgroup1/leads/lel1c5u1wuk8', @@ -547,7 +549,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, persistIqAttributesMapping: [ { from: 'useroccupation', diff --git a/test/integrations/destinations/persistiq/router/data.ts b/test/integrations/destinations/persistiq/router/data.ts index ddb39b90280..12208aaf411 100644 --- a/test/integrations/destinations/persistiq/router/data.ts +++ b/test/integrations/destinations/persistiq/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'persistiq', @@ -37,7 +39,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, persistIqAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], }, }, @@ -79,7 +81,7 @@ export const data = [ }, endpoint: 'https://api.persistiq.com/v1/leads/lel1c5u1wuk8', files: {}, - headers: { 'x-api-key': 'dummyApiKey' }, + headers: { 'x-api-key': defaultApiKey }, method: 'PATCH', params: {}, type: 'REST', @@ -87,7 +89,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, persistIqAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], }, }, diff --git a/test/integrations/destinations/pinterest_tag/maskedSecrets.ts b/test/integrations/destinations/pinterest_tag/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/pinterest_tag/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/pinterest_tag/processor/data.ts b/test/integrations/destinations/pinterest_tag/processor/data.ts index 4982444346c..a891ca1cc5f 100644 --- a/test/integrations/destinations/pinterest_tag/processor/data.ts +++ b/test/integrations/destinations/pinterest_tag/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'pinterest_tag', @@ -2791,7 +2792,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -2824,7 +2825,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -2972,7 +2973,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3005,7 +3006,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -3156,7 +3157,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3189,7 +3190,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -3321,7 +3322,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: '', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3510,7 +3511,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3580,7 +3581,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, files: {}, @@ -3636,7 +3637,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3761,7 +3762,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, diff --git a/test/integrations/destinations/pinterest_tag/router/data.ts b/test/integrations/destinations/pinterest_tag/router/data.ts index 4049f7663a8..7b2f04cb550 100644 --- a/test/integrations/destinations/pinterest_tag/router/data.ts +++ b/test/integrations/destinations/pinterest_tag/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { destType: 'pinterest_tag', @@ -1123,7 +1124,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', sendingUnHashedData: true, enableDeduplication: true, @@ -1217,7 +1218,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', sendingUnHashedData: true, enableDeduplication: true, @@ -1311,7 +1312,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', sendingUnHashedData: true, enableDeduplication: true, @@ -1352,7 +1353,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -1568,7 +1569,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', sendingUnHashedData: true, enableDeduplication: true, diff --git a/test/integrations/destinations/pinterest_tag/step/data.ts b/test/integrations/destinations/pinterest_tag/step/data.ts index 71f12c735ca..af9a3ace4b5 100644 --- a/test/integrations/destinations/pinterest_tag/step/data.ts +++ b/test/integrations/destinations/pinterest_tag/step/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'pinterest_tag', @@ -2810,7 +2811,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -2845,7 +2846,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -2993,7 +2994,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3028,7 +3029,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -3179,7 +3180,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3214,7 +3215,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -3346,7 +3347,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: '', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3539,7 +3540,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3574,7 +3575,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/profitwell/maskedSecrets.ts b/test/integrations/destinations/profitwell/maskedSecrets.ts new file mode 100644 index 00000000000..fa268ef78c3 --- /dev/null +++ b/test/integrations/destinations/profitwell/maskedSecrets.ts @@ -0,0 +1,3 @@ +import path from 'path'; + +export const secretApiKey = path.basename(__dirname) + 1; diff --git a/test/integrations/destinations/profitwell/processor/data.ts b/test/integrations/destinations/profitwell/processor/data.ts index 58bd2ed35fb..57b2194f9ce 100644 --- a/test/integrations/destinations/profitwell/processor/data.ts +++ b/test/integrations/destinations/profitwell/processor/data.ts @@ -1,3 +1,5 @@ +import { secretApiKey } from '../maskedSecrets'; + export const data = [ { name: 'profitwell', @@ -11,7 +13,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -92,7 +94,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -179,7 +181,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -241,7 +243,7 @@ export const data = [ endpoint: 'https://api.profitwell.com/v2/subscriptions/', headers: { 'Content-Type': 'application/json', - Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + Authorization: secretApiKey, }, params: {}, body: { @@ -281,7 +283,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -362,7 +364,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -450,7 +452,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -518,7 +520,7 @@ export const data = [ endpoint: 'https://api.profitwell.com/v2/subscriptions/', headers: { 'Content-Type': 'application/json', - Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + Authorization: secretApiKey, }, params: {}, body: { @@ -559,7 +561,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -652,7 +654,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -725,7 +727,7 @@ export const data = [ endpoint: 'https://api.profitwell.com/v2/subscriptions/pws_FecTCEyo17rV/', headers: { 'Content-Type': 'application/json', - Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + Authorization: secretApiKey, }, params: {}, body: { @@ -761,7 +763,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -854,7 +856,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -927,7 +929,7 @@ export const data = [ endpoint: 'https://api.profitwell.com/v2/subscriptions/pws_FecTCEyo17rV/', headers: { 'Content-Type': 'application/json', - Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + Authorization: secretApiKey, }, params: {}, body: { @@ -1053,7 +1055,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -1147,7 +1149,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -1210,7 +1212,7 @@ export const data = [ endpoint: 'https://api.profitwell.com/v2/subscriptions/', headers: { 'Content-Type': 'application/json', - Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + Authorization: secretApiKey, }, params: {}, body: { diff --git a/test/integrations/destinations/profitwell/router/data.ts b/test/integrations/destinations/profitwell/router/data.ts index b308155dae8..fbd82cfe392 100644 --- a/test/integrations/destinations/profitwell/router/data.ts +++ b/test/integrations/destinations/profitwell/router/data.ts @@ -1,3 +1,5 @@ +import { secretApiKey } from '../maskedSecrets'; + export const data = [ { name: 'profitwell', @@ -10,7 +12,7 @@ export const data = [ body: { input: [ { - destination: { Config: { privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62' } }, + destination: { Config: { privateApiKey: secretApiKey } }, metadata: { jobId: 2, userId: 'u1' }, message: { channel: 'web', @@ -81,7 +83,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + Authorization: secretApiKey, }, version: '1', endpoint: 'https://api.profitwell.com/v2/subscriptions/', @@ -89,7 +91,7 @@ export const data = [ metadata: [{ jobId: 2, userId: 'u1' }], batched: false, statusCode: 200, - destination: { Config: { privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62' } }, + destination: { Config: { privateApiKey: secretApiKey } }, }, ], }, diff --git a/test/integrations/destinations/reddit/dataDelivery/business.ts b/test/integrations/destinations/reddit/dataDelivery/business.ts index cc2feccffa2..73b40dd9953 100644 --- a/test/integrations/destinations/reddit/dataDelivery/business.ts +++ b/test/integrations/destinations/reddit/dataDelivery/business.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { generateMetadata, generateProxyV0Payload, @@ -105,7 +106,7 @@ const validRequestMultipleEventsInPayload = { }; const commonHeaders = { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; @@ -233,8 +234,14 @@ export const testScenariosForV1API = [ { metadata: generateMetadata(1), statusCode: 403, - error: - '{"success":false,"error":{"reason":"UNAUTHORIZED","explanation":"JSON error unexpected type number on field events event_metadata value"}}', + error: JSON.stringify({ + success: false, + error: { + reason: 'UNAUTHORIZED', + explanation: + 'JSON error unexpected type number on field events event_metadata value', + }, + }), }, ], statTags: { @@ -286,14 +293,68 @@ export const testScenariosForV1API = [ { metadata: { ...generateMetadata(1), dontBatch: true }, statusCode: 500, - error: - '{"message":"There were 1 invalid conversion events. None were processed.","invalid_events":[{"error_message":"event_at timestamp must be less than 168h0m0s old","event":{"event_at":"2018-10-14T09:03:17.562Z","event_type":{"tracking_type":"Purchase"},"event_metadata":{"item_count":0,"products":[{}],"conversion_id":"c054005afd85a4de74638a776eb8348d44ee875184d7a401830705b7a06e7df1"},"user":{"aaid":"c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a","email":"ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2","external_id":"7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d","ip_address":"e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36","screen_dimensions":{}}}}]}', + error: JSON.stringify({ + message: 'There were 1 invalid conversion events. None were processed.', + invalid_events: [ + { + error_message: 'event_at timestamp must be less than 168h0m0s old', + event: { + event_at: '2018-10-14T09:03:17.562Z', + event_type: { tracking_type: 'Purchase' }, + event_metadata: { + item_count: 0, + products: [{}], + conversion_id: + 'c054005afd85a4de74638a776eb8348d44ee875184d7a401830705b7a06e7df1', + }, + user: { + aaid: 'c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a', + email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2', + external_id: + '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d', + ip_address: + 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + screen_dimensions: {}, + }, + }, + }, + ], + }), }, { metadata: { ...generateMetadata(2), dontBatch: true }, statusCode: 500, - error: - '{"message":"There were 1 invalid conversion events. None were processed.","invalid_events":[{"error_message":"event_at timestamp must be less than 168h0m0s old","event":{"event_at":"2018-10-14T09:03:17.562Z","event_type":{"tracking_type":"Purchase"},"event_metadata":{"item_count":0,"products":[{}],"conversion_id":"c054005afd85a4de74638a776eb8348d44ee875184d7a401830705b7a06e7df1"},"user":{"aaid":"c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a","email":"ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2","external_id":"7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d","ip_address":"e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36","screen_dimensions":{}}}}]}', + error: JSON.stringify({ + message: 'There were 1 invalid conversion events. None were processed.', + invalid_events: [ + { + error_message: 'event_at timestamp must be less than 168h0m0s old', + event: { + event_at: '2018-10-14T09:03:17.562Z', + event_type: { tracking_type: 'Purchase' }, + event_metadata: { + item_count: 0, + products: [{}], + conversion_id: + 'c054005afd85a4de74638a776eb8348d44ee875184d7a401830705b7a06e7df1', + }, + user: { + aaid: 'c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a', + email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2', + external_id: + '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d', + ip_address: + 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + screen_dimensions: {}, + }, + }, + }, + ], + }), }, ], statTags: { diff --git a/test/integrations/destinations/reddit/dataDelivery/oauth.ts b/test/integrations/destinations/reddit/dataDelivery/oauth.ts index e3c5875a062..1c39798c4ac 100644 --- a/test/integrations/destinations/reddit/dataDelivery/oauth.ts +++ b/test/integrations/destinations/reddit/dataDelivery/oauth.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { generateMetadata, generateProxyV1Payload, @@ -40,7 +41,7 @@ const authorizationRequiredRequestPayload = { }; const commonHeaders = { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; @@ -217,8 +218,14 @@ export const v1oauthScenarios = [ 'This server could not verify that you are authorized to access the document you requested. during reddit response transformation', response: [ { - error: - '{"success":false,"error":{"reason":"UNAUTHORIZED","explanation":"This server could not verify that you are authorized to access the document you requested."}}', + error: JSON.stringify({ + success: false, + error: { + reason: 'UNAUTHORIZED', + explanation: + 'This server could not verify that you are authorized to access the document you requested.', + }, + }), metadata: generateMetadata(1), statusCode: 401, }, diff --git a/test/integrations/destinations/reddit/maskedSecrets.ts b/test/integrations/destinations/reddit/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/reddit/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/reddit/network.ts b/test/integrations/destinations/reddit/network.ts index 54d7a95b73e..aeafe967608 100644 --- a/test/integrations/destinations/reddit/network.ts +++ b/test/integrations/destinations/reddit/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { @@ -38,7 +39,7 @@ export const networkCallsData = [ }, params: { destination: 'reddit' }, headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -90,7 +91,7 @@ export const networkCallsData = [ }, params: { destination: 'reddit' }, headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -136,7 +137,7 @@ export const networkCallsData = [ }, params: { destination: 'reddit' }, headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -193,7 +194,7 @@ export const networkCallsData = [ }, params: { destination: 'reddit' }, headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -279,7 +280,7 @@ export const networkCallsData = [ }, params: { destination: 'reddit' }, headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', diff --git a/test/integrations/destinations/reddit/processor/data.ts b/test/integrations/destinations/reddit/processor/data.ts index e7b36f56ff8..529d2aa3a66 100644 --- a/test/integrations/destinations/reddit/processor/data.ts +++ b/test/integrations/destinations/reddit/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'reddit', @@ -84,7 +85,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -102,7 +103,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -157,7 +158,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -251,7 +252,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -269,7 +270,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -324,7 +325,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -403,7 +404,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -421,7 +422,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -472,7 +473,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -541,7 +542,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -559,7 +560,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -607,7 +608,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -676,7 +677,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -694,7 +695,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -740,7 +741,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -809,7 +810,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -827,7 +828,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -875,7 +876,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -954,7 +955,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -972,7 +973,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1023,7 +1024,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -1102,7 +1103,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -1120,7 +1121,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1172,7 +1173,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -1249,7 +1250,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -1277,7 +1278,7 @@ export const data = [ metadata: { destinationId: 'destId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, workspaceId: 'wspId', }, @@ -1355,7 +1356,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -1383,7 +1384,7 @@ export const data = [ metadata: { destinationId: 'destId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, workspaceId: 'wspId', }, @@ -1461,7 +1462,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -1489,7 +1490,7 @@ export const data = [ metadata: { destinationId: 'destId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, workspaceId: 'wspId', }, @@ -1566,7 +1567,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -1594,7 +1595,7 @@ export const data = [ metadata: { destinationId: 'destId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, workspaceId: 'wspId', }, diff --git a/test/integrations/destinations/reddit/router/data.ts b/test/integrations/destinations/reddit/router/data.ts index f2dd887b849..4118d46191e 100644 --- a/test/integrations/destinations/reddit/router/data.ts +++ b/test/integrations/destinations/reddit/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'reddit', @@ -69,7 +70,7 @@ export const data = [ metadata: { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 1, userId: 'u1', }, @@ -127,7 +128,7 @@ export const data = [ metadata: { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 2, userId: 'u1', }, @@ -173,7 +174,7 @@ export const data = [ metadata: { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 3, userId: 'u1', }, @@ -238,7 +239,7 @@ export const data = [ metadata: { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 4, userId: 'u1', dontBatch: true, @@ -297,7 +298,7 @@ export const data = [ metadata: { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 5, userId: 'u1', dontBatch: true, @@ -410,7 +411,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -420,21 +421,21 @@ export const data = [ { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 1, userId: 'u1', }, { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 2, userId: 'u1', }, { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 3, userId: 'u1', }, @@ -490,7 +491,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -500,7 +501,7 @@ export const data = [ { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 4, userId: 'u1', dontBatch: true, @@ -564,7 +565,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -574,7 +575,7 @@ export const data = [ { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 5, userId: 'u1', dontBatch: true, @@ -657,7 +658,7 @@ export const data = [ metadata: { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 1, userId: 'u1', }, @@ -677,7 +678,7 @@ export const data = [ { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 1, userId: 'u1', }, diff --git a/test/integrations/destinations/redis/processor/data.ts b/test/integrations/destinations/redis/processor/data.ts index 999a954b59b..45846203d5f 100644 --- a/test/integrations/destinations/redis/processor/data.ts +++ b/test/integrations/destinations/redis/processor/data.ts @@ -320,7 +320,7 @@ export const data = [ Cízǔ: 'test', CamelCase123Key: 'test', '1CComega': 'test', - arrayProp: '[{"x":1,"y":2}]', + arrayProp: JSON.stringify([{ x: 1, y: 2 }]), 'nestedProp.innerProp1': 'innerPropVal1', 'nestedProp.innerProp2': 'innerPropVal2', }, @@ -449,7 +449,7 @@ export const data = [ Cízǔ: 'test', CamelCase123Key: 'test', '1CComega': 'test', - arrayProp: '[{"x":1,"y":2}]', + arrayProp: JSON.stringify([{ x: 1, y: 2 }]), 'nestedProp.innerProp1': 'innerPropVal1', 'nestedProp.innerProp2': 'innerPropVal2', }, @@ -560,7 +560,7 @@ export const data = [ fields: { country: 'USA', lastname: 'Mouse', - arrayProp: '[{"x":1,"y":2}]', + arrayProp: JSON.stringify([{ x: 1, y: 2 }]), 'nestedProp.innerProp1': 'innerPropVal1', 'nestedProp.innerProp2': 'innerPropVal2', firstname: 'Mickey', @@ -673,7 +673,7 @@ export const data = [ fields: { country: 'USA', lastname: 'Mouse', - arrayProp: '[{"x":1,"y":2}]', + arrayProp: JSON.stringify([{ x: 1, y: 2 }]), emptyKey: '', 'nestedProp.innerProp1': 'innerPropVal1', 'nestedProp.innerProp2': 'innerPropVal2', @@ -848,8 +848,13 @@ export const data = [ message: { hash: 'some-workspace-id:1WhcOCGgj9asZu850HvugU2C3Aq:some-entity:some-id-type:some-user-id', key: 'some-model', - value: - '{"MODEL_ID":"1691755780","VALID_AT":"2023-08-11T11:32:44.963062Z","USER_MAIN_ID":"rid5530313526204a95efe71d98cd17d5a1","CHURN_SCORE_7_DAYS":0.027986,"PERCENTILE_CHURN_SCORE_7_DAYS":0}', + value: JSON.stringify({ + MODEL_ID: '1691755780', + VALID_AT: '2023-08-11T11:32:44.963062Z', + USER_MAIN_ID: 'rid5530313526204a95efe71d98cd17d5a1', + CHURN_SCORE_7_DAYS: 0.027986, + PERCENTILE_CHURN_SCORE_7_DAYS: 0, + }), }, userId: 'some-user-id', }, diff --git a/test/integrations/destinations/refiner/maskedSecrets.ts b/test/integrations/destinations/refiner/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/refiner/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/refiner/processor/groupTestData.ts b/test/integrations/destinations/refiner/processor/groupTestData.ts index e3a05357f5a..d2abd03b148 100644 --- a/test/integrations/destinations/refiner/processor/groupTestData.ts +++ b/test/integrations/destinations/refiner/processor/groupTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -16,7 +17,7 @@ const destination: Destination = { Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665474171943, @@ -29,7 +30,7 @@ const destination: Destination = { }; const headers = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }; @@ -62,6 +63,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/refiner/processor/identifyTestData.ts b/test/integrations/destinations/refiner/processor/identifyTestData.ts index cc3704bb451..41948215697 100644 --- a/test/integrations/destinations/refiner/processor/identifyTestData.ts +++ b/test/integrations/destinations/refiner/processor/identifyTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -16,7 +17,7 @@ const destination: Destination = { Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665474171943, @@ -57,7 +58,7 @@ const expectedOutputUserTraits = { }; const headers = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }; @@ -88,6 +89,7 @@ export const identifyTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/refiner/processor/pageTestData.ts b/test/integrations/destinations/refiner/processor/pageTestData.ts index b6c782202eb..6249b65396e 100644 --- a/test/integrations/destinations/refiner/processor/pageTestData.ts +++ b/test/integrations/destinations/refiner/processor/pageTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -16,7 +17,7 @@ const destination: Destination = { Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665474171943, @@ -41,7 +42,7 @@ const properties = { }; const headers = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }; @@ -75,6 +76,7 @@ export const pageTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/refiner/processor/trackTestData.ts b/test/integrations/destinations/refiner/processor/trackTestData.ts index e10ac6f0f58..aa21ad6f03a 100644 --- a/test/integrations/destinations/refiner/processor/trackTestData.ts +++ b/test/integrations/destinations/refiner/processor/trackTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -16,7 +17,7 @@ const destination: Destination = { Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665474171943, @@ -53,7 +54,7 @@ const properties = { }; const headers = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }; @@ -85,6 +86,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/refiner/processor/validationTestData.ts b/test/integrations/destinations/refiner/processor/validationTestData.ts index 20a9694fdf6..4305626c1e8 100644 --- a/test/integrations/destinations/refiner/processor/validationTestData.ts +++ b/test/integrations/destinations/refiner/processor/validationTestData.ts @@ -1,3 +1,4 @@ +import { secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; @@ -12,7 +13,7 @@ const destination: Destination = { Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665474171943, @@ -83,6 +84,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -125,6 +127,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -166,6 +169,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -208,6 +212,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/refiner/router/data.ts b/test/integrations/destinations/refiner/router/data.ts index 0ff75120d6d..9de7995f711 100644 --- a/test/integrations/destinations/refiner/router/data.ts +++ b/test/integrations/destinations/refiner/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'refiner', @@ -38,7 +39,7 @@ export const data = [ metadata: { jobId: 1, userId: 'u1' }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665475307930, @@ -82,7 +83,7 @@ export const data = [ endpoint: 'https://api.refiner.io/v1/identify-user', files: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }, method: 'POST', @@ -92,7 +93,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665475307930, @@ -177,7 +178,7 @@ export const data = [ metadata: { jobId: 2, userId: 'u1' }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665475307930, @@ -210,7 +211,7 @@ export const data = [ endpoint: 'https://api.refiner.io/v1/track', files: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }, method: 'POST', @@ -220,7 +221,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665475307930, @@ -269,7 +270,7 @@ export const data = [ destination: { Config: { accountAttributesMapping: [{ from: 'email', to: 'businessEmail' }], - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665476456112, @@ -307,7 +308,7 @@ export const data = [ endpoint: 'https://api.refiner.io/v1/identify-user', files: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }, method: 'POST', @@ -318,7 +319,7 @@ export const data = [ destination: { Config: { accountAttributesMapping: [{ from: 'email', to: 'businessEmail' }], - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665476456112, diff --git a/test/integrations/destinations/revenue_cat/maskedSecrets.ts b/test/integrations/destinations/revenue_cat/maskedSecrets.ts new file mode 100644 index 00000000000..e85cee2dd65 --- /dev/null +++ b/test/integrations/destinations/revenue_cat/maskedSecrets.ts @@ -0,0 +1,11 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const authHeader1 = `Basic ${secret1}`; +export const authHeader2 = `Basic ${secret2}`; +export const authHeader3 = `Basic ${secret3}`; +export const authHeader4 = `Basic ${secret4}`; diff --git a/test/integrations/destinations/revenue_cat/processor/data.ts b/test/integrations/destinations/revenue_cat/processor/data.ts index 84b7c5975f8..bd4a86b68b7 100644 --- a/test/integrations/destinations/revenue_cat/processor/data.ts +++ b/test/integrations/destinations/revenue_cat/processor/data.ts @@ -1,3 +1,13 @@ +import { + authHeader1, + secret1, + authHeader2, + secret2, + authHeader3, + secret3, + authHeader4, + secret4, +} from '../maskedSecrets'; export const data = [ { name: 'revenue_cat', @@ -11,7 +21,7 @@ export const data = [ { destination: { Config: { - apiKey: 'as9d920a5e75a18acb4a29abd9ec1e2e', + apiKey: secret1, xPlatform: 'stripe', }, }, @@ -89,7 +99,7 @@ export const data = [ method: 'GET', endpoint: 'https://api.revenuecat.com/v1/subscribers/rudder1235678', headers: { - Authorization: 'Basic as9d920a5e75a18acb4a29abd9ec1e2e', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -111,7 +121,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes', headers: { - Authorization: 'Basic as9d920a5e75a18acb4a29abd9ec1e2e', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -178,7 +188,7 @@ export const data = [ { destination: { Config: { - apiKey: 'a5e75dfda29abd920ec1ec8a18acb42e', + apiKey: secret2, xPlatform: 'stripe', }, }, @@ -256,7 +266,7 @@ export const data = [ method: 'GET', endpoint: 'https://api.revenuecat.com/v1/subscribers/rudder1235678', headers: { - Authorization: 'Basic a5e75dfda29abd920ec1ec8a18acb42e', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -278,7 +288,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes', headers: { - Authorization: 'Basic a5e75dfda29abd920ec1ec8a18acb42e', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -438,7 +448,7 @@ export const data = [ { destination: { Config: { - apiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', + apiKey: secret3, }, }, message: { @@ -510,7 +520,7 @@ export const data = [ method: 'GET', endpoint: 'https://api.revenuecat.com/v1/subscribers/rudder1235678', headers: { - Authorization: 'Basic a5e75d99c8a18acb4a29abd920ec1e2e', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: {}, @@ -532,7 +542,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes', headers: { - Authorization: 'Basic a5e75d99c8a18acb4a29abd920ec1e2e', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: {}, @@ -581,7 +591,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret4, }, }, message: { @@ -660,7 +670,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret4, xPlatform: 'stripe', }, }, @@ -719,7 +729,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, @@ -751,7 +761,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, @@ -792,7 +802,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret4, xPlatform: 'stripe', }, }, @@ -870,7 +880,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, @@ -902,7 +912,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, @@ -934,7 +944,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, @@ -966,7 +976,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, @@ -1007,7 +1017,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret4, xPlatform: 'stripe', }, }, @@ -1051,7 +1061,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, diff --git a/test/integrations/destinations/salesforce/dataDelivery/business.ts b/test/integrations/destinations/salesforce/dataDelivery/business.ts index 5374e3fae22..76f00074492 100644 --- a/test/integrations/destinations/salesforce/dataDelivery/business.ts +++ b/test/integrations/destinations/salesforce/dataDelivery/business.ts @@ -1,9 +1,10 @@ import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; +import { authHeader1 } from '../maskedSecrets'; const commonHeaders = { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const params = { destination: 'salesforce' }; @@ -111,7 +112,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request for destination: salesforce Processed Successfully', response: [ { - error: '{"statusText":"No Content"}', + error: JSON.stringify({ statusText: 'No Content' }), metadata: proxyMetdata, statusCode: 200, }, @@ -153,8 +154,9 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed: 500 - due to "Session expired or invalid", (Retryable) during Salesforce Response Handling', response: [ { - error: - '[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]', + error: JSON.stringify([ + { message: 'Session expired or invalid', errorCode: 'INVALID_SESSION_ID' }, + ]), metadata: proxyMetdata, statusCode: 500, }, @@ -196,7 +198,9 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed: "401" due to "INVALID_HEADER_TYPE", (Aborted) during Salesforce Response Handling', response: [ { - error: '[{"message":"INVALID_HEADER_TYPE","errorCode":"INVALID_AUTH_HEADER"}]', + error: JSON.stringify([ + { message: 'INVALID_HEADER_TYPE', errorCode: 'INVALID_AUTH_HEADER' }, + ]), metadata: proxyMetdata, statusCode: 400, }, @@ -237,8 +241,9 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed - due to "REQUEST_LIMIT_EXCEEDED", (Throttled) during Salesforce Response Handling', response: [ { - error: - '[{"message":"Request limit exceeded","errorCode":"REQUEST_LIMIT_EXCEEDED"}]', + error: JSON.stringify([ + { message: 'Request limit exceeded', errorCode: 'REQUEST_LIMIT_EXCEEDED' }, + ]), metadata: proxyMetdata, statusCode: 429, }, @@ -280,7 +285,9 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed: 503 - due to Server Unavailable, during Salesforce Response Handling', response: [ { - error: '[{"message":"Server Unavailable","errorCode":"SERVER_UNAVAILABLE"}]', + error: JSON.stringify([ + { message: 'Server Unavailable', errorCode: 'SERVER_UNAVAILABLE' }, + ]), metadata: proxyMetdata, statusCode: 429, }, @@ -323,7 +330,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) during Salesforce Response Handling', response: [ { - error: '{"error":"invalid_grant","error_description":"authentication failure"}', + error: JSON.stringify({ + error: 'invalid_grant', + error_description: 'authentication failure', + }), metadata: proxyMetdata, statusCode: 400, }, @@ -365,8 +375,26 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request for destination: salesforce Processed Successfully', response: [ { - error: - '{"searchRecords":[{"attributes":{"type":"object_name","url":"/services/data/v50.0/sobjects/object_name/a0J75100002w97gEAA"},"Id":"a0J75100002w97gEAA","External_ID__c":"external_id"},{"attributes":{"type":"object_name","url":"/services/data/v50.0/sobjects/object_name/a0J75200002w9ZsEAI"},"Id":"a0J75200002w9ZsEAI","External_ID__c":"external_id TEST"}]}', + error: JSON.stringify({ + searchRecords: [ + { + attributes: { + type: 'object_name', + url: '/services/data/v50.0/sobjects/object_name/a0J75100002w97gEAA', + }, + Id: 'a0J75100002w97gEAA', + External_ID__c: 'external_id', + }, + { + attributes: { + type: 'object_name', + url: '/services/data/v50.0/sobjects/object_name/a0J75200002w9ZsEAI', + }, + Id: 'a0J75200002w9ZsEAI', + External_ID__c: 'external_id TEST', + }, + ], + }), metadata: proxyMetdata, statusCode: 200, }, diff --git a/test/integrations/destinations/salesforce/dataDelivery/data.ts b/test/integrations/destinations/salesforce/dataDelivery/data.ts index f157161751b..568a2564dd5 100644 --- a/test/integrations/destinations/salesforce/dataDelivery/data.ts +++ b/test/integrations/destinations/salesforce/dataDelivery/data.ts @@ -2,6 +2,7 @@ import { AxiosError } from 'axios'; import MockAdapter from 'axios-mock-adapter'; import { testScenariosForV1API } from './business'; import { otherSalesforceScenariosV1 } from './other'; +import { authHeader1, authHeader2 } from '../maskedSecrets'; const legacyDataValue = { Email: 'danis.archurav@sbermarket.ru', @@ -28,7 +29,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/1', @@ -83,7 +84,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/3', @@ -152,7 +153,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer Incorrect_token', + Authorization: authHeader2, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/2', @@ -221,7 +222,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/4', @@ -290,7 +291,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/5', @@ -359,7 +360,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/6', @@ -426,7 +427,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/7', @@ -493,7 +494,7 @@ const legacyTests = [ 'https://rudderstack.my.salesforce.com/services/data/v50.0/parameterizedSearch/?q=123&sobject=object_name&in=External_ID__c&object_name.fields=id,External_ID__c', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, body: { JSON: { @@ -567,7 +568,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/101', @@ -637,7 +638,7 @@ const legacyTests = [ }, { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', Accept: 'application/json, text/plain, */*', }, @@ -660,7 +661,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudder.my.salesforce.com/services/data/v50.0/sobjects/Lead/102', @@ -730,7 +731,7 @@ const legacyTests = [ }, { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', Accept: 'application/json, text/plain, */*', }, diff --git a/test/integrations/destinations/salesforce/dataDelivery/other.ts b/test/integrations/destinations/salesforce/dataDelivery/other.ts index 8bf154de9b5..2a01ad6253c 100644 --- a/test/integrations/destinations/salesforce/dataDelivery/other.ts +++ b/test/integrations/destinations/salesforce/dataDelivery/other.ts @@ -1,5 +1,6 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; +import { defaultAccessToken } from '../../../common/secrets'; const statTags = { errorCategory: 'network', @@ -19,7 +20,7 @@ const metadata = { workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }; @@ -50,8 +51,13 @@ export const otherSalesforceScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 500, metadata, }, diff --git a/test/integrations/destinations/salesforce/maskedSecrets.ts b/test/integrations/destinations/salesforce/maskedSecrets.ts new file mode 100644 index 00000000000..61db9ef38a9 --- /dev/null +++ b/test/integrations/destinations/salesforce/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/salesforce/network.ts b/test/integrations/destinations/salesforce/network.ts index b4cff85d7ba..32b9cf157a1 100644 --- a/test/integrations/destinations/salesforce/network.ts +++ b/test/integrations/destinations/salesforce/network.ts @@ -1,5 +1,6 @@ +import { authHeader1, authHeader2, secret1 } from './maskedSecrets'; const commonHeaders = { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', }; @@ -20,7 +21,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -37,7 +38,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -54,7 +55,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, method: 'POST', }, @@ -70,7 +71,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -87,7 +88,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -104,7 +105,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -121,7 +122,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, method: 'POST', }, @@ -140,7 +141,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -180,7 +181,7 @@ const transformationMocksData = [ httpRes: { status: 200, data: { - access_token: 'dummy.access.token', + access_token: secret1, instance_url: 'https://ap15.salesforce.com', id: 'https://login.salesforce.com/id/00D2v000002lXbXEAU/0052v00000ga9WqAAI', token_type: 'Bearer', @@ -197,7 +198,7 @@ const transformationMocksData = [ httpRes: { status: 200, data: { - access_token: 'dummy.access.token', + access_token: secret1, instance_url: 'https://ap15.salesforce.com', id: 'https://login.salesforce.com/id/00D2v000002lXbXEAU/0052v00000ga9WqAAI', token_type: 'Bearer', @@ -374,7 +375,7 @@ const businessMockData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer Incorrect_token', + Authorization: authHeader2, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -391,7 +392,7 @@ const businessMockData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -408,7 +409,7 @@ const businessMockData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -425,7 +426,7 @@ const businessMockData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -442,7 +443,7 @@ const businessMockData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -462,7 +463,7 @@ const businessMockData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', diff --git a/test/integrations/destinations/salesforce/processor/data.ts b/test/integrations/destinations/salesforce/processor/data.ts index b33b75b55bd..61d9a6f68db 100644 --- a/test/integrations/destinations/salesforce/processor/data.ts +++ b/test/integrations/destinations/salesforce/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2, secret2 } from '../maskedSecrets'; export const data = [ { name: 'salesforce', @@ -97,7 +98,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -224,7 +225,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -352,7 +353,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -588,7 +589,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -717,7 +718,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -850,7 +851,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Contact/sf-contact-id?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -983,7 +984,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead/sf-contact-id?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, userId: '', @@ -1110,7 +1111,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -1236,7 +1237,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -1351,7 +1352,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -1400,7 +1401,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret2, instance_url: 'http://dummyurl.com', }, }, @@ -1467,7 +1468,7 @@ export const data = [ statusCode: 200, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret2, instance_url: 'http://dummyurl.com', }, }, @@ -1479,7 +1480,7 @@ export const data = [ 'http://dummyurl.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader2, }, params: {}, body: { diff --git a/test/integrations/destinations/salesforce/router/data.ts b/test/integrations/destinations/salesforce/router/data.ts index 9e26625188f..69da683573d 100644 --- a/test/integrations/destinations/salesforce/router/data.ts +++ b/test/integrations/destinations/salesforce/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; export const data = [ { name: 'salesforce', @@ -92,7 +93,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -238,7 +239,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead/leadId?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -383,7 +384,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -453,7 +454,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -515,7 +516,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -668,7 +669,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/customobject', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -826,7 +827,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/customobject2/id1101?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -984,7 +985,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/customobject2/id1102?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/salesforce_oauth/dataDelivery/oauth.ts b/test/integrations/destinations/salesforce_oauth/dataDelivery/oauth.ts index 55eaa9cca1e..7924571524b 100644 --- a/test/integrations/destinations/salesforce_oauth/dataDelivery/oauth.ts +++ b/test/integrations/destinations/salesforce_oauth/dataDelivery/oauth.ts @@ -1,14 +1,15 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; const commonHeadersForWrongToken = { - Authorization: 'Bearer expiredAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const commonHeadersForRightToken = { - Authorization: 'Bearer correctAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const params = { destination: 'salesforce_oauth' }; @@ -57,7 +58,7 @@ export const proxyMetdataWithSecretWithWrongAccessToken: ProxyMetdata = { destinationId: 'dummyDestinationId', workspaceId: 'dummyWorkspaceId', secret: { - access_token: 'expiredAccessToken', + access_token: secret1, instanceUrl: 'https://rudderstack.my.salesforce_oauth.com', }, destInfo: { authKey: 'dummyDestinationId' }, @@ -117,8 +118,9 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed - due to "INVALID_SESSION_ID", (Retryable) during Salesforce Response Handling', response: [ { - error: - '[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]', + error: JSON.stringify([ + { message: 'Session expired or invalid', errorCode: 'INVALID_SESSION_ID' }, + ]), metadata: proxyMetdataWithSecretWithWrongAccessToken, statusCode: 500, }, @@ -161,7 +163,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request for destination: salesforce Processed Successfully', response: [ { - error: '{"statusText":"No Content"}', + error: JSON.stringify({ statusText: 'No Content' }), metadata: proxyMetdataWithSecretWithRightAccessToken, statusCode: 200, }, diff --git a/test/integrations/destinations/salesforce_oauth/maskedSecrets.ts b/test/integrations/destinations/salesforce_oauth/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/salesforce_oauth/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/salesforce_oauth/network.ts b/test/integrations/destinations/salesforce_oauth/network.ts index ae5f9d3fe49..951fac1bb3c 100644 --- a/test/integrations/destinations/salesforce_oauth/network.ts +++ b/test/integrations/destinations/salesforce_oauth/network.ts @@ -1,10 +1,11 @@ +import { authHeader1 } from './maskedSecrets'; const headerWithWrongAccessToken = { - Authorization: 'Bearer expiredAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const headerWithRightAccessToken = { - Authorization: 'Bearer correctAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; diff --git a/test/integrations/destinations/salesforce_oauth_sandbox/dataDelivery/oauth.ts b/test/integrations/destinations/salesforce_oauth_sandbox/dataDelivery/oauth.ts index 30ee516e724..f09548e7147 100644 --- a/test/integrations/destinations/salesforce_oauth_sandbox/dataDelivery/oauth.ts +++ b/test/integrations/destinations/salesforce_oauth_sandbox/dataDelivery/oauth.ts @@ -1,14 +1,15 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; const commonHeadersForWrongToken = { - Authorization: 'Bearer expiredAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const commonHeadersForRightToken = { - Authorization: 'Bearer correctAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const params = { destination: 'salesforce_oauth_sandbox' }; @@ -57,7 +58,7 @@ export const proxyMetdataWithSecretWithWrongAccessToken: ProxyMetdata = { destinationId: 'dummyDestinationId', workspaceId: 'dummyWorkspaceId', secret: { - access_token: 'expiredAccessToken', + access_token: secret1, instanceUrl: 'https://rudderstack.my.salesforce_oauth_sandbox.com', }, destInfo: { authKey: 'dummyDestinationId' }, @@ -117,8 +118,9 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed - due to "INVALID_SESSION_ID", (Retryable) during Salesforce Response Handling', response: [ { - error: - '[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]', + error: JSON.stringify([ + { message: 'Session expired or invalid', errorCode: 'INVALID_SESSION_ID' }, + ]), metadata: proxyMetdataWithSecretWithWrongAccessToken, statusCode: 500, }, @@ -161,7 +163,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request for destination: salesforce Processed Successfully', response: [ { - error: '{"statusText":"No Content"}', + error: JSON.stringify({ statusText: 'No Content' }), metadata: proxyMetdataWithSecretWithRightAccessToken, statusCode: 200, }, diff --git a/test/integrations/destinations/salesforce_oauth_sandbox/maskedSecrets.ts b/test/integrations/destinations/salesforce_oauth_sandbox/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/salesforce_oauth_sandbox/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/salesforce_oauth_sandbox/network.ts b/test/integrations/destinations/salesforce_oauth_sandbox/network.ts index 09d2c759d2e..d917d80b8c8 100644 --- a/test/integrations/destinations/salesforce_oauth_sandbox/network.ts +++ b/test/integrations/destinations/salesforce_oauth_sandbox/network.ts @@ -1,10 +1,11 @@ +import { authHeader1 } from './maskedSecrets'; const headerWithWrongAccessToken = { - Authorization: 'Bearer expiredAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const headerWithRightAccessToken = { - Authorization: 'Bearer correctAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; diff --git a/test/integrations/destinations/segment/maskedSecrets.ts b/test/integrations/destinations/segment/maskedSecrets.ts new file mode 100644 index 00000000000..ba0b28ba8a1 --- /dev/null +++ b/test/integrations/destinations/segment/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + '')}`; diff --git a/test/integrations/destinations/segment/processor/data.ts b/test/integrations/destinations/segment/processor/data.ts index 9ba9601d6ef..051c493877c 100644 --- a/test/integrations/destinations/segment/processor/data.ts +++ b/test/integrations/destinations/segment/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'segment', @@ -22,7 +23,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -102,7 +103,7 @@ export const data = [ endpoint: 'https://api.segment.io/v1/batch', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -164,7 +165,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -236,7 +237,7 @@ export const data = [ endpoint: 'https://api.segment.io/v1/batch', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -291,7 +292,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -368,7 +369,7 @@ export const data = [ endpoint: 'https://api.segment.io/v1/batch', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -428,7 +429,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -506,7 +507,7 @@ export const data = [ endpoint: 'https://api.segment.io/v1/batch', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -568,7 +569,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -639,7 +640,7 @@ export const data = [ endpoint: 'https://api.segment.io/v1/batch', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/sendgrid/deleteUsers/data.ts b/test/integrations/destinations/sendgrid/deleteUsers/data.ts index 85c6e1275f1..c7846826dc0 100644 --- a/test/integrations/destinations/sendgrid/deleteUsers/data.ts +++ b/test/integrations/destinations/sendgrid/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { secret1 } from '../maskedSecrets'; + export const data = [ { name: 'sendgrid', @@ -581,7 +583,7 @@ export const data = [ }, ], config: { - apiKey: '1234', + apiKey: secret1, }, }, ], @@ -1185,7 +1187,7 @@ export const data = [ }, ], config: { - apiKey: '1234', + apiKey: secret1, }, }, ], @@ -1254,7 +1256,7 @@ export const data = [ userId: 'eab57ccf-6322-498e-9338-7761c6dc0656', }, config: { - apiKey: '1234', + apiKey: secret1, }, }, ], diff --git a/test/integrations/destinations/sendgrid/maskedSecrets.ts b/test/integrations/destinations/sendgrid/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/sendgrid/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/sendgrid/network.ts b/test/integrations/destinations/sendgrid/network.ts index 29cfbf84463..93c3a3a5244 100644 --- a/test/integrations/destinations/sendgrid/network.ts +++ b/test/integrations/destinations/sendgrid/network.ts @@ -1,10 +1,11 @@ +import { authHeader1 } from './maskedSecrets'; const deleteNwData = [ { httpReq: { method: 'delete', url: 'https://api.sendgrid.com/v3/marketing/contacts?ids=test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id', headers: { - Authorization: 'Bearer 1234', + Authorization: authHeader1, }, }, httpRes: { @@ -22,7 +23,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.sendgrid.com/v3/marketing/contacts?ids=user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', headers: { - Authorization: 'Bearer 1234', + Authorization: authHeader1, }, }, httpRes: { @@ -39,7 +40,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.sendgrid.com/v3/marketing/contacts?ids=[user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2]', headers: { - Authorization: 'Bearer 1234', + Authorization: authHeader1, }, }, httpRes: { @@ -57,7 +58,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.sendgrid.com/v3/marketing/contacts?ids=[user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2]', headers: { - Authorization: 'Bearer 1234', + Authorization: authHeader1, }, }, httpRes: { @@ -75,7 +76,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.sendgrid.com/v3/marketing/contacts?ids=test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id', headers: { - Authorization: 'Bearer 1234', + Authorization: authHeader1, }, }, httpRes: { @@ -93,7 +94,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.sendgrid.com/v3/marketing/contacts?ids=user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', headers: { - Authorization: 'Bearer 1234', + Authorization: authHeader1, }, }, httpRes: { @@ -111,7 +112,7 @@ const deleteNwData = [ method: 'get', url: 'https://api.sendgrid.com/v3/marketing/field_definitions', headers: { - Authorization: 'Bearer apikey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, }, diff --git a/test/integrations/destinations/sendgrid/processor/data.ts b/test/integrations/destinations/sendgrid/processor/data.ts index 4c5ca7f48f6..f1e208d15b6 100644 --- a/test/integrations/destinations/sendgrid/processor/data.ts +++ b/test/integrations/destinations/sendgrid/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'sendgrid', @@ -12,7 +13,7 @@ export const data = [ destination: { Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -114,7 +115,7 @@ export const data = [ destination: { Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -196,7 +197,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -237,7 +238,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -344,7 +345,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', @@ -367,7 +368,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -466,7 +467,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/mail/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -521,7 +522,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -622,7 +623,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/mail/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -677,7 +678,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -790,7 +791,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/mail/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -849,7 +850,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -982,7 +983,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -1101,7 +1102,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/mail/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -1166,7 +1167,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -1288,7 +1289,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/mail/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -1353,7 +1354,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -1479,7 +1480,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/mail/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -1555,7 +1556,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -1663,7 +1664,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', diff --git a/test/integrations/destinations/sendgrid/router/data.ts b/test/integrations/destinations/sendgrid/router/data.ts index e9ef6712267..9db23e885bb 100644 --- a/test/integrations/destinations/sendgrid/router/data.ts +++ b/test/integrations/destinations/sendgrid/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'sendgrid', @@ -12,7 +13,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [{ event: 'testing' }, { event: 'clicked' }], subject: 'A sample subject', replyToEmail: 'ankit@rudderstack.com', @@ -101,7 +102,7 @@ export const data = [ files: {}, method: 'POST', params: {}, - headers: { Authorization: 'Bearer apikey', 'Content-Type': 'application/json' }, + headers: { Authorization: authHeader1, 'Content-Type': 'application/json' }, version: '1', endpoint: 'https://api.sendgrid.com/v3/mail/send', }, @@ -110,7 +111,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [{ event: 'testing' }, { event: 'clicked' }], subject: 'A sample subject', replyToEmail: 'ankit@rudderstack.com', @@ -152,7 +153,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -226,7 +227,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -300,7 +301,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -375,7 +376,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -451,7 +452,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -518,7 +519,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -610,7 +611,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -640,7 +641,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -692,7 +693,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -721,7 +722,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -773,7 +774,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -805,7 +806,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -857,7 +858,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -890,7 +891,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -942,7 +943,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -971,7 +972,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -1023,7 +1024,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -1058,7 +1059,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', diff --git a/test/integrations/destinations/sfmc/maskedSecrets.ts b/test/integrations/destinations/sfmc/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/sfmc/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/sfmc/network.ts b/test/integrations/destinations/sfmc/network.ts index 93854e36910..84b312206b3 100644 --- a/test/integrations/destinations/sfmc/network.ts +++ b/test/integrations/destinations/sfmc/network.ts @@ -1,3 +1,4 @@ +import { secret1 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { @@ -7,7 +8,7 @@ export const networkCallsData = [ httpRes: { status: 200, data: { - access_token: 'yourAuthToken', + access_token: secret1, }, }, }, diff --git a/test/integrations/destinations/sfmc/processor/data.ts b/test/integrations/destinations/sfmc/processor/data.ts index e8d9375e43c..c0f647c8ace 100644 --- a/test/integrations/destinations/sfmc/processor/data.ts +++ b/test/integrations/destinations/sfmc/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; export const data = [ { name: 'sfmc', @@ -210,7 +211,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/contacts/v1/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { @@ -236,7 +237,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:f3ffa19b-e0b3-4967-829f-549b781080e6/rows/Contact Key:12345', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { @@ -710,7 +711,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/contacts/v1/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { @@ -736,7 +737,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:f3ffa19b-e0b3-4967-829f-549b781080e6/rows/Contact Key:12345', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { @@ -902,7 +903,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:C500FD37-155C-49BD-A21B-AFCEF3D1A9CB/rows/Contact Key:12345', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { @@ -1106,7 +1107,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, version: '1', endpoint: @@ -1549,7 +1550,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, version: '1', endpoint: @@ -1719,7 +1720,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, version: '1', endpoint: @@ -1881,7 +1882,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, version: '1', endpoint: @@ -1986,8 +1987,15 @@ export const data = [ status: 200, body: [ { - error: - '{"message":"Could not retrieve access token","destinationResponse":{"error":"invalid_client","error_description":"Invalid client ID. Use the client ID in Marketing Cloud Installed Packages.","error_uri":"https://developer.salesforce.com/docs"}}', + error: JSON.stringify({ + message: 'Could not retrieve access token', + destinationResponse: { + error: 'invalid_client', + error_description: + 'Invalid client ID. Use the client ID in Marketing Cloud Installed Packages.', + error_uri: 'https://developer.salesforce.com/docs', + }, + }), statTags: { destType: 'SFMC', errorCategory: 'network', @@ -2058,8 +2066,15 @@ export const data = [ status: 200, body: [ { - error: - '{"message":"Could not retrieve access token","destinationResponse":{"message":"Your requests are temporarily blocked.","errorcode":50200,"documentation":"https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm"}}', + error: JSON.stringify({ + message: 'Could not retrieve access token', + destinationResponse: { + message: 'Your requests are temporarily blocked.', + errorcode: 50200, + documentation: + 'https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm', + }, + }), statTags: { destType: 'SFMC', errorCategory: 'network', @@ -2130,7 +2145,10 @@ export const data = [ status: 200, body: [ { - error: '{"message":"Could not retrieve access token","destinationResponse":{}}', + error: JSON.stringify({ + message: 'Could not retrieve access token', + destinationResponse: {}, + }), statTags: { destType: 'SFMC', errorCategory: 'network', @@ -2303,7 +2321,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:externalKey/rows/key1:someRandomEmail@test.com', files: {}, headers: { - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PUT', diff --git a/test/integrations/destinations/sfmc/router/data.ts b/test/integrations/destinations/sfmc/router/data.ts index 7707e709f43..ac2fd1e6990 100644 --- a/test/integrations/destinations/sfmc/router/data.ts +++ b/test/integrations/destinations/sfmc/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; export const data = [ { name: 'sfmc', @@ -237,7 +238,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/contacts/v1/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { @@ -259,7 +260,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:f3ffa19b-e0b3-4967-829f-549b781080e6/rows/Contact Key:12345', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/signl4/processor/data.ts b/test/integrations/destinations/signl4/processor/data.ts index 11dc6fbadb6..3a3105bdeca 100644 --- a/test/integrations/destinations/signl4/processor/data.ts +++ b/test/integrations/destinations/signl4/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'signl4', @@ -37,7 +39,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -66,7 +68,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://connect.signl4.com/webhook/dummyApiKey', + endpoint: `https://connect.signl4.com/webhook/${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -132,7 +134,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -161,7 +163,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://connect.signl4.com/webhook/dummyApiKey', + endpoint: `https://connect.signl4.com/webhook/${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -236,7 +238,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: '', s4ServiceProperty: 's4Service', s4LocationValue: '', @@ -265,7 +267,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://connect.signl4.com/webhook/dummyApiKey', + endpoint: `https://connect.signl4.com/webhook/${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -340,7 +342,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'defaultServiceValue', s4ServiceProperty: 's4Service', s4LocationValue: 'defaultLocationValue', @@ -369,7 +371,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://connect.signl4.com/webhook/dummyApiKey', + endpoint: `https://connect.signl4.com/webhook/${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -435,7 +437,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -591,7 +593,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -669,7 +671,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', diff --git a/test/integrations/destinations/signl4/router/data.ts b/test/integrations/destinations/signl4/router/data.ts index 0fcf55d0465..af93571158e 100644 --- a/test/integrations/destinations/signl4/router/data.ts +++ b/test/integrations/destinations/signl4/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'signl4', @@ -12,7 +14,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -71,7 +73,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://connect.signl4.com/webhook/dummyApiKey', + endpoint: `https://connect.signl4.com/webhook/${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -97,7 +99,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -131,7 +133,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -188,7 +190,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', diff --git a/test/integrations/destinations/singular/processor/data.ts b/test/integrations/destinations/singular/processor/data.ts index 6e749dd0a01..7daac907101 100644 --- a/test/integrations/destinations/singular/processor/data.ts +++ b/test/integrations/destinations/singular/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'singular', @@ -11,7 +13,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -135,7 +137,7 @@ export const data = [ install_time: 1630511211, update_time: 1630511211, ua: 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -159,7 +161,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -273,7 +275,7 @@ export const data = [ receipt_signature: '1234dfghnh', purchase_product_id: '789', c: 'wifi', - a: 'dummyApiKey', + a: defaultApiKey, e: { url: 'myapp%3A%2F%2Fhome%2Fpage%3Fqueryparam1%3Dvalue1', install: 'SM-G935F', @@ -320,7 +322,7 @@ export const data = [ amt: 6.9, asid: 'IISqwYJKoZIcNqts0jvcNvPc', receipt_signature: '1234dfghnh', - a: 'dummyApiKey', + a: defaultApiKey, c: 'wifi', e: { url: 'myapp%3A%2F%2Fhome%2Fpage%3Fqueryparam1%3Dvalue1', @@ -361,7 +363,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -470,7 +472,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -588,7 +590,7 @@ export const data = [ openuri: 'myapp%3A%2F%2Fhome%2Fpage%3Fqueryparam1%3Dvalue1', install_source: '', c: 'wifi', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -612,7 +614,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -721,7 +723,7 @@ export const data = [ receipt_signature: '1234dfghnh', amt: 20, is_revenue_event: true, - a: 'dummyApiKey', + a: defaultApiKey, c: 'wifi', e: { url: 'myapp%3A%2F%2Fhome%2Fpage%3Fqueryparam1%3Dvalue1', @@ -763,7 +765,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -875,7 +877,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -988,7 +990,7 @@ export const data = [ install_time: 1630511211, update_time: 1630511211, ua: 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -1012,7 +1014,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1125,7 +1127,7 @@ export const data = [ install_time: 1630511211, update_time: 1630511211, ua: 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -1149,7 +1151,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1255,7 +1257,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1376,7 +1378,7 @@ export const data = [ idfv: 'fc8d449516de0dfb', install_time: 1630511211, update_time: 1630511211, - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -1400,7 +1402,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1509,7 +1511,7 @@ export const data = [ purchase_transaction_id: '2134dfg', idfa: '8ecd7512-2864-440c-93f3-a3cabe62525b', idfv: 'fc8d449516de0dfb', - a: 'dummyApiKey', + a: defaultApiKey, c: 'carrier', e: { asid: 'IISqwYJKoZIcNqts0jvcNvPc', @@ -1554,7 +1556,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1669,7 +1671,7 @@ export const data = [ idfv: 'fc8d449516de0dfb', install_time: 1630511211, update_time: 1630511211, - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -1693,7 +1695,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1804,7 +1806,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1915,7 +1917,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1992,7 +1994,7 @@ export const data = [ endpoint: 'https://s2s.singular.net/api/v1/launch', headers: {}, params: { - a: 'dummyApiKey', + a: defaultApiKey, av: '1.1.5.581823alpha', data_sharing_options: '%7B%22limit_data_sharing%22%3Atrue%7D', i: 'com.singular.game', @@ -2028,7 +2030,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -2137,7 +2139,7 @@ export const data = [ cur: 'USD', amt: 28, purchase_product_id: '789', - a: 'dummyApiKey', + a: defaultApiKey, install_source: 'selfdistributed', os: 'metaquest_pro', p: 'metaquest', @@ -2172,7 +2174,7 @@ export const data = [ amt: 6.9, os: 'metaquest_pro', p: 'metaquest', - a: 'dummyApiKey', + a: defaultApiKey, sdid: '49c2d3a6-326e-4ec5-a16b-0a47e34ed953', ua: 'Mozilla/5.0 (Nintendo Switch; WebApplet) AppleWebKit/613.0 (KHTML, like Gecko) NF/6.0.3.25.0 NintendoBrowser/5.1.0.32061', ve: 'qst2-2023h2', diff --git a/test/integrations/destinations/singular/router/data.ts b/test/integrations/destinations/singular/router/data.ts index 9074ef2fdc8..f3aba585780 100644 --- a/test/integrations/destinations/singular/router/data.ts +++ b/test/integrations/destinations/singular/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'singular', @@ -12,7 +14,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -140,7 +142,7 @@ export const data = [ update_time: 1630511211, ua: 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', c: 'wifi', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -150,7 +152,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -177,7 +179,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -305,7 +307,7 @@ export const data = [ update_time: 1630511211, ua: 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', c: 'wifi', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -315,7 +317,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -342,7 +344,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -470,7 +472,7 @@ export const data = [ update_time: 1630511211, ua: 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', c: 'wifi', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -480,7 +482,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, diff --git a/test/integrations/destinations/slack/processor/data.ts b/test/integrations/destinations/slack/processor/data.ts index 1fcbb2ca03f..db72671a5e5 100644 --- a/test/integrations/destinations/slack/processor/data.ts +++ b/test/integrations/destinations/slack/processor/data.ts @@ -146,8 +146,11 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"Identified my-namehiji: hulala favorite color: black ","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + text: 'Identified my-namehiji: hulala favorite color: black ', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, }, files: {}, @@ -474,8 +477,11 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"identified my-name-1 with hiji: hulala-1 ","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + text: 'identified my-name-1 with hiji: hulala-1 ', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, }, files: {}, @@ -655,8 +661,9 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"my-name performed test_isent1 with test_val1 test_val2 and traits hulala"}', + payload: JSON.stringify({ + text: 'my-name performed test_isent1 with test_val1 test_val2 and traits hulala', + }), }, }, files: {}, @@ -839,8 +846,9 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"my-name performed test_eventing_testis with test_val1 test_val2"}', + payload: JSON.stringify({ + text: 'my-name performed test_eventing_testis with test_val1 test_val2', + }), }, }, files: {}, @@ -1023,7 +1031,7 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: '{"text":"my-name did test_eventing_test"}', + payload: JSON.stringify({ text: 'my-name did test_eventing_test' }), }, }, files: {}, @@ -1204,8 +1212,11 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"my-name performed test_isent1 with test_val1 test_val2 and traits hulala","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + text: 'my-name performed test_isent1 with test_val1 test_val2 and traits hulala', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, }, files: {}, @@ -1387,8 +1398,12 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"channel":"example-of-legacy","text":"my-name performed test_eventing_testis with test_val1 test_val2","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + channel: 'example-of-legacy', + text: 'my-name performed test_eventing_testis with test_val1 test_val2', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, }, files: {}, @@ -1995,8 +2010,11 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"User 12345 did black_event","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + text: 'User 12345 did black_event', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, }, files: {}, @@ -2150,8 +2168,11 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"Identified User 12345","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + text: 'Identified User 12345', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, }, files: {}, diff --git a/test/integrations/destinations/slack/router/data.ts b/test/integrations/destinations/slack/router/data.ts index 349b1a486f0..0eb0a723243 100644 --- a/test/integrations/destinations/slack/router/data.ts +++ b/test/integrations/destinations/slack/router/data.ts @@ -280,8 +280,11 @@ export const data = [ { body: { FORM: { - payload: - '{"text":"identified my-name-1 with hiji: hulala-1 ","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + text: 'identified my-name-1 with hiji: hulala-1 ', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, JSON: {}, JSON_ARRAY: {}, diff --git a/test/integrations/destinations/snapchat_conversion/maskedSecrets.ts b/test/integrations/destinations/snapchat_conversion/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/snapchat_conversion/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/snapchat_conversion/processor/data.ts b/test/integrations/destinations/snapchat_conversion/processor/data.ts index b7fde67c4e7..b7cd6f2d5c6 100644 --- a/test/integrations/destinations/snapchat_conversion/processor/data.ts +++ b/test/integrations/destinations/snapchat_conversion/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'snapchat_conversion', @@ -72,7 +73,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', }, }, @@ -103,7 +104,7 @@ export const data = [ userId: '', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -217,7 +218,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, metadata: { @@ -246,7 +247,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -365,7 +366,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, metadata: { @@ -479,7 +480,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, metadata: { @@ -592,7 +593,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, metadata: { @@ -705,7 +706,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', }, }, @@ -735,7 +736,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -841,7 +842,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', }, }, @@ -955,7 +956,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', }, @@ -1072,7 +1073,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1104,7 +1105,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1225,7 +1226,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1257,7 +1258,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1377,7 +1378,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1409,7 +1410,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1528,7 +1529,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1560,7 +1561,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1671,7 +1672,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1703,7 +1704,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1817,7 +1818,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1849,7 +1850,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1962,7 +1963,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1994,7 +1995,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2103,7 +2104,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2135,7 +2136,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2243,7 +2244,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2275,7 +2276,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2385,7 +2386,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2417,7 +2418,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2527,7 +2528,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2559,7 +2560,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2669,7 +2670,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2701,7 +2702,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2812,7 +2813,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2844,7 +2845,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2956,7 +2957,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2988,7 +2989,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -3097,7 +3098,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, metadata: { @@ -3126,7 +3127,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -3236,7 +3237,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -3268,7 +3269,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -3378,7 +3379,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, rudderEventsToSnapEvents: [ { from: 'ProdSearched', @@ -3414,7 +3415,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -3520,7 +3521,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, rudderEventsToSnapEvents: [], }, }, @@ -3629,7 +3630,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, rudderEventsToSnapEvents: [ { from: 'Product_Added_To_Cart', @@ -3664,7 +3665,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -3765,7 +3766,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, rudderEventsToSnapEvents: [ { from: 'Product Added To Cart', @@ -3801,7 +3802,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -3919,7 +3920,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', deduplicationKey: 'properties.custom_dedup_id', enableDeduplication: true, @@ -3953,7 +3954,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -4074,7 +4075,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -4106,7 +4107,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -4224,7 +4225,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -4256,7 +4257,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -4376,7 +4377,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -4408,7 +4409,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -4531,7 +4532,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -4563,7 +4564,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -4667,7 +4668,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, rudderEventsToSnapEvents: [ { from: 'Custom Event', @@ -4703,7 +4704,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -4807,7 +4808,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, rudderEventsToSnapEvents: [], }, }, diff --git a/test/integrations/destinations/snapchat_conversion/router/data.ts b/test/integrations/destinations/snapchat_conversion/router/data.ts index 685ed2e5b4e..5e1adc0f27c 100644 --- a/test/integrations/destinations/snapchat_conversion/router/data.ts +++ b/test/integrations/destinations/snapchat_conversion/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { FEATURES, IMPLEMENTATIONS, MODULES } from '../../../../../src/v0/util/tags'; export const data = [ @@ -74,7 +75,7 @@ export const data = [ destination: { Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -141,7 +142,7 @@ export const data = [ destination: { Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -208,7 +209,7 @@ export const data = [ destination: { Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -230,14 +231,65 @@ export const data = [ endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"search_string":"t-shirts","event_type":"SEARCH","user_agent":"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36","hashed_email":"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2","hashed_phone_number":"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492","hashed_idfv":"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f","hashed_mobile_ad_id":"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2","timestamp":"1650625078","event_conversion_type":"OFFLINE","pixel_id":"dummyPixelId"},{"search_string":"t-shirts","event_type":"SEARCH","user_agent":"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36","hashed_email":"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2","hashed_phone_number":"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492","hashed_idfv":"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f","hashed_mobile_ad_id":"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2","timestamp":"1650625078","event_conversion_type":"OFFLINE","pixel_id":"dummyPixelId"},{"search_string":"t-shirts","event_type":"SEARCH","user_agent":"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36","hashed_email":"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2","hashed_phone_number":"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492","hashed_idfv":"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f","hashed_mobile_ad_id":"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2","timestamp":"1650625078","event_conversion_type":"OFFLINE","pixel_id":"dummyPixelId"}]', + batch: JSON.stringify([ + { + search_string: 't-shirts', + event_type: 'SEARCH', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + hashed_email: + '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_idfv: + '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + { + search_string: 't-shirts', + event_type: 'SEARCH', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + hashed_email: + '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_idfv: + '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + { + search_string: 't-shirts', + event_type: 'SEARCH', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + hashed_email: + '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_idfv: + '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + ]), }, XML: {}, FORM: {}, @@ -263,7 +315,7 @@ export const data = [ destination: { Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -392,7 +444,7 @@ export const data = [ destination: { Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, appId: 'jahsdfjk-5487-asdfa-9957-7c74eb8d3e80', snapAppId: '', enableDeduplication: false, @@ -436,7 +488,7 @@ export const data = [ destination: { Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, appId: 'jahsdfjk-5487-asdfa-9957-7c74eb8d3e80', snapAppId: '', enableDeduplication: false, diff --git a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/business.ts b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/business.ts index 4ee646bedbf..5bdfd09bada 100644 --- a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/business.ts +++ b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/business.ts @@ -4,9 +4,10 @@ import { generateProxyV0Payload, generateProxyV1Payload, } from '../../../testUtils'; +import { authHeader1 } from '../maskedSecrets'; const commonHeaders = { - Authorization: 'Bearer abcd123', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }; diff --git a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/oauth.ts b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/oauth.ts index e4bf5d45882..9a2de350410 100644 --- a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/oauth.ts +++ b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/oauth.ts @@ -4,9 +4,10 @@ import { generateProxyV0Payload, generateProxyV1Payload, } from '../../../testUtils'; +import { authHeader1 } from '../maskedSecrets'; const commonHeaders = { - Authorization: 'Bearer abcd123', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }; @@ -23,19 +24,6 @@ const commonRequestParameters = { }, }; -const commonDeleteRequestParameters = { - headers: commonHeaders, - JSON: { - users: [ - { - id: '123456', - schema: ['EMAIL_SHA256'], - data: [['938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c']], - }, - ], - }, -}; - const retryStatTags = { destType: 'SNAPCHAT_CUSTOM_AUDIENCE', errorCategory: 'network', diff --git a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/other.ts b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/other.ts index 90508c2481c..b9fe80c0470 100644 --- a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/other.ts +++ b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/other.ts @@ -38,8 +38,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/snapchat_custom_audience/maskedSecrets.ts b/test/integrations/destinations/snapchat_custom_audience/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/snapchat_custom_audience/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/snapchat_custom_audience/network.ts b/test/integrations/destinations/snapchat_custom_audience/network.ts index 39bd46122dd..09659d4c2b2 100644 --- a/test/integrations/destinations/snapchat_custom_audience/network.ts +++ b/test/integrations/destinations/snapchat_custom_audience/network.ts @@ -1,3 +1,5 @@ +import { authHeader1 } from './maskedSecrets'; + export const networkCallsData = [ { httpReq: { @@ -12,7 +14,7 @@ export const networkCallsData = [ }, params: { destination: 'snapchat_custom_audience' }, headers: { - Authorization: 'Bearer abcd123', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -41,7 +43,7 @@ export const networkCallsData = [ }, params: { destination: 'snapchat_custom_audience' }, headers: { - Authorization: 'Bearer abcd123', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -63,7 +65,7 @@ export const networkCallsData = [ }, params: { destination: 'snapchat_custom_audience' }, headers: { - Authorization: 'Bearer abcd123', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -94,7 +96,7 @@ export const networkCallsData = [ }, params: { destination: 'snapchat_custom_audience' }, headers: { - Authorization: 'Bearer abcd123', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, diff --git a/test/integrations/destinations/snapchat_custom_audience/processor/data.ts b/test/integrations/destinations/snapchat_custom_audience/processor/data.ts index 546f056fa43..188cf16b268 100644 --- a/test/integrations/destinations/snapchat_custom_audience/processor/data.ts +++ b/test/integrations/destinations/snapchat_custom_audience/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'snapchat_custom_audience', @@ -11,7 +12,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -66,7 +67,7 @@ export const data = [ method: 'POST', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -88,7 +89,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -111,7 +112,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -166,7 +167,7 @@ export const data = [ method: 'DELETE', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -189,7 +190,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -212,7 +213,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -277,7 +278,7 @@ export const data = [ method: 'POST', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -299,7 +300,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -313,7 +314,7 @@ export const data = [ method: 'DELETE', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -336,7 +337,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -359,7 +360,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -422,7 +423,7 @@ export const data = [ method: 'POST', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -447,7 +448,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -470,7 +471,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -533,7 +534,7 @@ export const data = [ method: 'DELETE', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -559,7 +560,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -582,7 +583,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -633,7 +634,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -665,7 +666,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -715,7 +716,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -747,7 +748,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -783,7 +784,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -815,7 +816,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -854,7 +855,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -886,7 +887,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -928,7 +929,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -961,7 +962,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1019,7 +1020,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1051,7 +1052,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1113,7 +1114,7 @@ export const data = [ method: 'DELETE', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1136,7 +1137,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1159,7 +1160,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1214,7 +1215,7 @@ export const data = [ method: 'POST', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1236,7 +1237,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1259,7 +1260,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1315,7 +1316,7 @@ export const data = [ method: 'POST', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1337,7 +1338,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, diff --git a/test/integrations/destinations/snapchat_custom_audience/router/data.ts b/test/integrations/destinations/snapchat_custom_audience/router/data.ts index 44fdb4b47b2..b4c9a823655 100644 --- a/test/integrations/destinations/snapchat_custom_audience/router/data.ts +++ b/test/integrations/destinations/snapchat_custom_audience/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'snapchat_custom_audience', @@ -12,7 +13,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -62,7 +63,7 @@ export const data = [ endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, params: {}, body: { @@ -86,7 +87,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, developer_token: 'dummyDeveloperToken', refresh_token: 'dummyRefreshToken', }, diff --git a/test/integrations/destinations/splitio/maskedSecrets.ts b/test/integrations/destinations/splitio/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/splitio/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/splitio/processor/data.ts b/test/integrations/destinations/splitio/processor/data.ts index d4c3e39794e..2656ff23d0f 100644 --- a/test/integrations/destinations/splitio/processor/data.ts +++ b/test/integrations/destinations/splitio/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'splitio', @@ -41,7 +42,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'anonymous', }, @@ -62,7 +63,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -142,7 +143,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'user', }, @@ -163,7 +164,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -244,7 +245,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'production', trafficType: 'anonymous', }, @@ -265,7 +266,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -334,7 +335,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'production', trafficType: 'user', }, @@ -355,7 +356,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -418,7 +419,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'user', }, @@ -439,7 +440,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -506,7 +507,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'user', }, @@ -527,7 +528,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -590,7 +591,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'user', }, @@ -652,7 +653,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'user', }, @@ -713,7 +714,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'production', trafficType: 'user', }, @@ -775,7 +776,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'production', trafficType: 'user', }, @@ -796,7 +797,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -859,7 +860,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'anonymous', }, @@ -880,7 +881,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/splitio/router/data.ts b/test/integrations/destinations/splitio/router/data.ts index 47f8ad5cff1..43ec89f2467 100644 --- a/test/integrations/destinations/splitio/router/data.ts +++ b/test/integrations/destinations/splitio/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'splitio', @@ -36,7 +37,7 @@ export const data = [ }, metadata: { jobId: 1, userId: 'u1' }, destination: { - Config: { apiKey: 'abcde', environment: 'staging', trafficType: 'user' }, + Config: { apiKey: secret1, environment: 'staging', trafficType: 'user' }, }, }, ], @@ -56,7 +57,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://events.split.io/api/events', - headers: { 'Content-Type': 'application/json', Authorization: 'Bearer abcde' }, + headers: { 'Content-Type': 'application/json', Authorization: authHeader1 }, params: {}, body: { JSON: { @@ -77,7 +78,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'abcde', environment: 'staging', trafficType: 'user' }, + Config: { apiKey: secret1, environment: 'staging', trafficType: 'user' }, }, }, ], @@ -119,7 +120,7 @@ export const data = [ }, metadata: { jobId: 2, userId: 'u1' }, destination: { - Config: { apiKey: 'abcde', environment: 'staging', trafficType: 'user' }, + Config: { apiKey: secret1, environment: 'staging', trafficType: 'user' }, }, }, ], @@ -139,7 +140,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://events.split.io/api/events', - headers: { 'Content-Type': 'application/json', Authorization: 'Bearer abcde' }, + headers: { 'Content-Type': 'application/json', Authorization: authHeader1 }, params: {}, body: { JSON: { @@ -160,7 +161,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'abcde', environment: 'staging', trafficType: 'user' }, + Config: { apiKey: secret1, environment: 'staging', trafficType: 'user' }, }, }, ], diff --git a/test/integrations/destinations/sprig/deleteUsers/data.ts b/test/integrations/destinations/sprig/deleteUsers/data.ts index 7ab5620e66c..db5af989150 100644 --- a/test/integrations/destinations/sprig/deleteUsers/data.ts +++ b/test/integrations/destinations/sprig/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { secret1, secretInvalid } from '../maskedSecrets'; + export const data = [ { name: 'sprig', @@ -57,7 +59,7 @@ export const data = [ }, ], config: { - apiKey: 'invalidApiKey', + apiKey: secretInvalid, }, }, ], @@ -119,7 +121,7 @@ export const data = [ }, ], config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, ], @@ -154,7 +156,7 @@ export const data = [ }, ], config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, ], @@ -196,7 +198,7 @@ export const data = [ }, ], config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, ], diff --git a/test/integrations/destinations/sprig/maskedSecrets.ts b/test/integrations/destinations/sprig/maskedSecrets.ts new file mode 100644 index 00000000000..b0273d7671f --- /dev/null +++ b/test/integrations/destinations/sprig/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secretInvalid = path.basename(__dirname) + 2; +export const authHeader1 = `API-Key ${secret1}`; +export const authHeaderInvalid = `API-Key ${secretInvalid}`; diff --git a/test/integrations/destinations/sprig/network.ts b/test/integrations/destinations/sprig/network.ts index e5f2ff23b1e..67f3e877102 100644 --- a/test/integrations/destinations/sprig/network.ts +++ b/test/integrations/destinations/sprig/network.ts @@ -1,3 +1,5 @@ +import { authHeader1, authHeaderInvalid } from './maskedSecrets'; + const deleteNwData = [ { httpReq: { @@ -8,7 +10,7 @@ const deleteNwData = [ }, headers: { Accept: 'application/json', - Authorization: 'API-Key invalidApiKey', + Authorization: authHeaderInvalid, 'Content-Type': 'application/json', }, }, @@ -26,7 +28,7 @@ const deleteNwData = [ }, headers: { Accept: 'application/json', - Authorization: 'API-Key testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, }, @@ -44,7 +46,7 @@ const deleteNwData = [ }, headers: { Accept: 'application/json', - Authorization: 'API-Key testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, }, @@ -64,7 +66,7 @@ const deleteNwData = [ }, headers: { Accept: 'application/json', - Authorization: 'API-Key testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, }, diff --git a/test/integrations/destinations/sprig/processor/data.ts b/test/integrations/destinations/sprig/processor/data.ts index 6b99e5e13b6..cadddaecf9c 100644 --- a/test/integrations/destinations/sprig/processor/data.ts +++ b/test/integrations/destinations/sprig/processor/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'sprig', @@ -29,7 +31,7 @@ export const data = [ }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, metadata: { @@ -97,7 +99,7 @@ export const data = [ }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, metadata: { @@ -227,7 +229,7 @@ export const data = [ }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, metadata: { @@ -293,7 +295,7 @@ export const data = [ }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, metadata: { @@ -317,7 +319,7 @@ export const data = [ endpoint: 'https://api.sprig.com/v2/users', headers: { accept: 'application/json', - authorization: 'API-Key testApiKey', + authorization: authHeader1, 'content-type': 'application/json', }, body: { @@ -379,7 +381,7 @@ export const data = [ }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, metadata: { @@ -447,7 +449,7 @@ export const data = [ }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, metadata: { @@ -471,7 +473,7 @@ export const data = [ endpoint: 'https://api.sprig.com/v2/users', headers: { accept: 'application/json', - authorization: 'API-Key testApiKey', + authorization: authHeader1, 'content-type': 'application/json', }, body: { diff --git a/test/integrations/destinations/stormly/maskedSecrets.ts b/test/integrations/destinations/stormly/maskedSecrets.ts new file mode 100644 index 00000000000..c5a4dc839e8 --- /dev/null +++ b/test/integrations/destinations/stormly/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${secret1}`; diff --git a/test/integrations/destinations/stormly/processor/data.ts b/test/integrations/destinations/stormly/processor/data.ts index 52356ba9e09..2c5b4ee3804 100644 --- a/test/integrations/destinations/stormly/processor/data.ts +++ b/test/integrations/destinations/stormly/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'stormly', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -64,7 +65,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -100,7 +101,7 @@ export const data = [ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/identify', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -138,7 +139,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -193,7 +194,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -228,7 +229,7 @@ export const data = [ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -268,7 +269,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -297,7 +298,7 @@ export const data = [ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -331,7 +332,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -367,7 +368,7 @@ export const data = [ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -410,7 +411,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -453,7 +454,7 @@ export const data = [ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -496,7 +497,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -533,7 +534,7 @@ export const data = [ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/group', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/stormly/router/data.ts b/test/integrations/destinations/stormly/router/data.ts index 1973173795d..fb12d71db8a 100644 --- a/test/integrations/destinations/stormly/router/data.ts +++ b/test/integrations/destinations/stormly/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'stormly', @@ -10,7 +11,7 @@ export const data = [ body: { input: [ { - destination: { Config: { apiKey: 'dummyApiKey' }, ID: 'stormly123' }, + destination: { Config: { apiKey: secret1 }, ID: 'stormly123' }, metadata: { jobId: 1, userId: 'u1' }, message: { type: 'identify', @@ -24,7 +25,7 @@ export const data = [ }, }, { - destination: { Config: { apiKey: 'dummyApiKey' }, ID: 'stormly123' }, + destination: { Config: { apiKey: secret1 }, ID: 'stormly123' }, metadata: { jobId: 2, userId: 'u1' }, message: { type: 'track', @@ -68,18 +69,18 @@ export const data = [ }, endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/identify', files: {}, - headers: { Authorization: 'Basic dummyApiKey', 'Content-Type': 'application/json' }, + headers: { Authorization: authHeader1, 'Content-Type': 'application/json' }, method: 'POST', params: {}, type: 'REST', version: '1', }, - destination: { Config: { apiKey: 'dummyApiKey' }, ID: 'stormly123' }, + destination: { Config: { apiKey: secret1 }, ID: 'stormly123' }, metadata: [{ jobId: 1, userId: 'u1' }], statusCode: 200, }, { - destination: { Config: { apiKey: 'dummyApiKey' }, ID: 'stormly123' }, + destination: { Config: { apiKey: secret1 }, ID: 'stormly123' }, batched: false, error: 'Missing required value from "userIdOnly"', metadata: [{ jobId: 2, userId: 'u1' }], diff --git a/test/integrations/destinations/the_trade_desk/delivery/business.ts b/test/integrations/destinations/the_trade_desk/delivery/business.ts index 0406a5f0bc7..26336b60b4f 100644 --- a/test/integrations/destinations/the_trade_desk/delivery/business.ts +++ b/test/integrations/destinations/the_trade_desk/delivery/business.ts @@ -159,8 +159,9 @@ export const businessProxyV1: ProxyV1TestData[] = [ 'Request failed with status: 200 due to {"FailedLines":[{"ErrorCode":"MissingUserId","Message":"Invalid UID2, item #2"}]}', response: [ { - error: - '{"FailedLines":[{"ErrorCode":"MissingUserId","Message":"Invalid UID2, item #2"}]}', + error: JSON.stringify({ + FailedLines: [{ ErrorCode: 'MissingUserId', Message: 'Invalid UID2, item #2' }], + }), metadata: generateMetadata(1), statusCode: 400, }, diff --git a/test/integrations/destinations/the_trade_desk/delivery/other.ts b/test/integrations/destinations/the_trade_desk/delivery/other.ts index bed10e6ec58..51f8dd51a5f 100644 --- a/test/integrations/destinations/the_trade_desk/delivery/other.ts +++ b/test/integrations/destinations/the_trade_desk/delivery/other.ts @@ -107,8 +107,13 @@ export const otherProxyV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/tiktok_ads/dataDelivery/business.ts b/test/integrations/destinations/tiktok_ads/dataDelivery/business.ts index 895188fa3f6..865764cef3f 100644 --- a/test/integrations/destinations/tiktok_ads/dataDelivery/business.ts +++ b/test/integrations/destinations/tiktok_ads/dataDelivery/business.ts @@ -101,7 +101,7 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ message: '[TIKTOK_ADS Response Handler] - Request Processed Successfully', response: [ { - error: '{"code":0,"message":"OK"}', + error: JSON.stringify({ code: 0, message: 'OK' }), statusCode: 200, metadata: generateMetadata(1234), }, @@ -168,8 +168,10 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ response: [ { statusCode: 400, - error: - '{"code":40002,"message":"Batch.0.properties.contents.0.content_id: Not a valid string"}', + error: JSON.stringify({ + code: 40002, + message: 'Batch.0.properties.contents.0.content_id: Not a valid string', + }), metadata: generateMetadata(1234), }, ], @@ -235,8 +237,11 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ response: [ { statusCode: 400, - error: - '{"code":40001,"message":"No permission to operate pixel code: BU35TSQHT2A1QT375OMG. You must be an admin or operator of this advertiser account."}', + error: JSON.stringify({ + code: 40001, + message: + 'No permission to operate pixel code: BU35TSQHT2A1QT375OMG. You must be an admin or operator of this advertiser account.', + }), metadata: generateMetadata(1234), }, ], diff --git a/test/integrations/destinations/tiktok_ads/dataDelivery/other.ts b/test/integrations/destinations/tiktok_ads/dataDelivery/other.ts index 0675ebcd051..48c59c3ff90 100644 --- a/test/integrations/destinations/tiktok_ads/dataDelivery/other.ts +++ b/test/integrations/destinations/tiktok_ads/dataDelivery/other.ts @@ -57,7 +57,10 @@ export const v1OtherScenarios: ProxyV1TestData[] = [ message: 'Request failed with status: 40100', response: [ { - error: '{"code":40100,"message":"Too many requests. Please retry in some time."}', + error: JSON.stringify({ + code: 40100, + message: 'Too many requests. Please retry in some time.', + }), statusCode: 429, metadata: generateMetadata(1234), }, @@ -157,8 +160,13 @@ export const v1OtherScenarios: ProxyV1TestData[] = [ message: 'Request failed with status: 503', response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: generateMetadata(1234), }, diff --git a/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts b/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts index 81e125eacab..0f0559e7dd8 100644 --- a/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts +++ b/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts @@ -543,8 +543,18 @@ export const data = [ properties: { phone: 'c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05', value: 32.839999999999996, - emails: - '["efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900","078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f","","","","","","","",""]', + emails: JSON.stringify([ + 'efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900', + '078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f', + '', + '', + '', + '', + '', + '', + '', + '', + ]), eventId: '8965fb56-090f-47a5-aa7f-bbab22d9ec90', currency: 'USD', order_id: 60241286212, @@ -667,8 +677,18 @@ export const data = [ properties: { phone: 'c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05', value: 32.839999999999996, - emails: - '["efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900","078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f","","","","","","","",""]', + emails: JSON.stringify([ + 'efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900', + '078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f', + '', + '', + '', + '', + '', + '', + '', + '', + ]), eventId: '8965fb56-090f-47a5-aa7f-bbab22d9ec90', currency: 'USD', order_id: 60241286212, @@ -787,8 +807,18 @@ export const data = [ properties: { phone: 'c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05', value: 32.839999999999996, - emails: - '["efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900","078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f","","","","","","","",""]', + emails: JSON.stringify([ + 'efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900', + '078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f', + '', + '', + '', + '', + '', + '', + '', + '', + ]), eventId: '8965fb56-090f-47a5-aa7f-bbab22d9ec90', currency: 'USD', order_id: 60241286212, diff --git a/test/integrations/destinations/topsort/maskedSecrets.ts b/test/integrations/destinations/topsort/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/topsort/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/topsort/processor/trackClicksTestData.ts b/test/integrations/destinations/topsort/processor/trackClicksTestData.ts index 2cfd4589053..418f40bb919 100644 --- a/test/integrations/destinations/topsort/processor/trackClicksTestData.ts +++ b/test/integrations/destinations/topsort/processor/trackClicksTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -19,7 +20,7 @@ const destination: Destination = { }, }, Config: { - apiKey: 'test-api', + apiKey: secret1, connectionMode: { web: 'cloud', }, @@ -97,6 +98,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -109,7 +111,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -216,6 +218,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -228,7 +231,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -356,6 +359,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -477,6 +481,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -489,7 +494,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', diff --git a/test/integrations/destinations/topsort/processor/trackImpressionsTestData.ts b/test/integrations/destinations/topsort/processor/trackImpressionsTestData.ts index 2f1fc60571c..c71bc855380 100644 --- a/test/integrations/destinations/topsort/processor/trackImpressionsTestData.ts +++ b/test/integrations/destinations/topsort/processor/trackImpressionsTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -19,7 +20,7 @@ const destination: Destination = { }, }, Config: { - apiKey: 'test-api', + apiKey: secret1, connectionMode: { web: 'cloud', }, @@ -93,6 +94,7 @@ export const trackImpressionsTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -105,7 +107,7 @@ export const trackImpressionsTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -212,6 +214,7 @@ export const trackImpressionsTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -224,7 +227,7 @@ export const trackImpressionsTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -352,6 +355,7 @@ export const trackImpressionsTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/topsort/processor/trackPurchasesTestData.ts b/test/integrations/destinations/topsort/processor/trackPurchasesTestData.ts index a4736fb471b..db2fc6dcc69 100644 --- a/test/integrations/destinations/topsort/processor/trackPurchasesTestData.ts +++ b/test/integrations/destinations/topsort/processor/trackPurchasesTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -19,7 +20,7 @@ const destination: Destination = { }, }, Config: { - apiKey: 'test-api', + apiKey: secret1, connectionMode: { web: 'cloud', }, @@ -93,6 +94,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -105,7 +107,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -212,6 +214,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -224,7 +227,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -355,6 +358,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -367,7 +371,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -411,7 +415,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', diff --git a/test/integrations/destinations/topsort/router/data.ts b/test/integrations/destinations/topsort/router/data.ts index 0cabdcbac8d..7314df2c68d 100644 --- a/test/integrations/destinations/topsort/router/data.ts +++ b/test/integrations/destinations/topsort/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { RouterTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; @@ -14,7 +15,7 @@ const destination: Destination = { }, }, Config: { - apiKey: 'test-api', + apiKey: secret1, connectionMode: { web: 'cloud', }, @@ -97,6 +98,7 @@ export const data: RouterTestData[] = [ ], destType: 'topsort', }, + method: 'POST', }, }, output: { @@ -112,7 +114,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, body: { @@ -228,6 +230,7 @@ export const data: RouterTestData[] = [ ], destType: 'topsort', }, + method: 'POST', }, }, output: { @@ -243,7 +246,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, body: { @@ -353,6 +356,7 @@ export const data: RouterTestData[] = [ ], destType: 'topsort', }, + method: 'POST', }, }, output: { @@ -368,7 +372,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/trengo/maskedSecrets.ts b/test/integrations/destinations/trengo/maskedSecrets.ts new file mode 100644 index 00000000000..61db9ef38a9 --- /dev/null +++ b/test/integrations/destinations/trengo/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/trengo/network.ts b/test/integrations/destinations/trengo/network.ts index 62b50165580..caf798abe8b 100644 --- a/test/integrations/destinations/trengo/network.ts +++ b/test/integrations/destinations/trengo/network.ts @@ -1,8 +1,9 @@ +import { authHeader1, authHeader2 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -80,7 +81,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -110,7 +111,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -140,7 +141,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -152,7 +153,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -182,7 +183,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -194,7 +195,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -319,7 +320,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -453,7 +454,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -587,7 +588,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -712,7 +713,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -846,7 +847,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -980,7 +981,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -1114,7 +1115,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -1248,7 +1249,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -1326,7 +1327,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer wrong_trengo_integration_test_api_token', + Authorization: authHeader2, }, method: 'GET', diff --git a/test/integrations/destinations/trengo/processor/data.ts b/test/integrations/destinations/trengo/processor/data.ts index 6772a1b940c..0efa45ab551 100644 --- a/test/integrations/destinations/trengo/processor/data.ts +++ b/test/integrations/destinations/trengo/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'trengo', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_email_channel', channelIdentifier: 'email', enableDedup: true, @@ -71,7 +72,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -105,7 +106,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_email_channel', channelIdentifier: 'phone', enableDedup: true, @@ -186,7 +187,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: true, @@ -246,7 +247,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -280,7 +281,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: true, @@ -361,7 +362,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: true, @@ -441,7 +442,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: false, @@ -501,7 +502,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -535,7 +536,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_email_channel', channelIdentifier: 'email', enableDedup: false, @@ -600,7 +601,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -634,7 +635,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_email_channel', channelIdentifier: 'email', enableDedup: false, @@ -695,7 +696,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -729,7 +730,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: false, @@ -811,7 +812,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -878,7 +879,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -912,7 +913,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -979,7 +980,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -1009,7 +1010,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -1076,7 +1077,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -1106,7 +1107,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -1173,7 +1174,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -1207,7 +1208,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -1293,7 +1294,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: true, @@ -1353,7 +1354,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { JSON: { name: 'Thalmor Bretz 2' }, XML: {}, JSON_ARRAY: {}, FORM: {} }, @@ -1378,7 +1379,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -1443,7 +1444,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -1474,7 +1475,7 @@ export const data = [ { destination: { Config: { - apiToken: 'wrong_trengo_integration_test_api_token', + apiToken: secret2, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -1528,8 +1529,13 @@ export const data = [ body: [ { // though we are getting undefined as statusText through mocked response but we are getting that from actual response - error: - '{"message":"Inside lookupContact, failed to make request: undefined","destinationResponse":{"response":{"message":"Unauthenticated.","errors":[]},"status":401}}', + error: JSON.stringify({ + message: 'Inside lookupContact, failed to make request: undefined', + destinationResponse: { + response: { message: 'Unauthenticated.', errors: [] }, + status: 401, + }, + }), statTags: { destType: 'TRENGO', errorCategory: 'network', diff --git a/test/integrations/destinations/trengo/router/data.ts b/test/integrations/destinations/trengo/router/data.ts index f7b50220363..6e1f956e488 100644 --- a/test/integrations/destinations/trengo/router/data.ts +++ b/test/integrations/destinations/trengo/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'trengo', @@ -48,7 +49,7 @@ export const data = [ metadata: { jobId: 2, userId: 'u1' }, destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: true, @@ -125,7 +126,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -141,7 +142,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: true, @@ -245,7 +246,7 @@ export const data = [ metadata: { jobId: 2, userId: 'u1' }, destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_email_channel', channelIdentifier: 'email', enableDedup: true, @@ -322,7 +323,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -342,7 +343,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_email_channel', channelIdentifier: 'email', enableDedup: true, diff --git a/test/integrations/destinations/tune/processor/trackTestData.ts b/test/integrations/destinations/tune/processor/trackTestData.ts index d9bfab54e39..d42c4136b67 100644 --- a/test/integrations/destinations/tune/processor/trackTestData.ts +++ b/test/integrations/destinations/tune/processor/trackTestData.ts @@ -78,6 +78,7 @@ export const trackTestdata: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -140,6 +141,7 @@ export const trackTestdata: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -198,6 +200,7 @@ export const trackTestdata: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/tune/router/data.ts b/test/integrations/destinations/tune/router/data.ts index 4aee5b89673..488655a41fc 100644 --- a/test/integrations/destinations/tune/router/data.ts +++ b/test/integrations/destinations/tune/router/data.ts @@ -78,6 +78,7 @@ export const data: RouterTestData[] = [ ], destType: 'tune', }, + method: 'POST', }, }, output: { @@ -134,7 +135,6 @@ export const data: RouterTestData[] = [ destination, metadata: generateMetadata(1), message: { - type: 123, event: 'Product added', anonymousId: 'sampath', channel: 'web', @@ -156,6 +156,7 @@ export const data: RouterTestData[] = [ ], destType: 'tune', }, + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/twitter_ads/processor/data.ts b/test/integrations/destinations/twitter_ads/processor/data.ts index 0ae21ffc98e..61a03fc64b4 100644 --- a/test/integrations/destinations/twitter_ads/processor/data.ts +++ b/test/integrations/destinations/twitter_ads/processor/data.ts @@ -137,12 +137,12 @@ export const data = [ contents: [ { content_id: '12', - content_price: 123.3345, + content_price: '123.3345', num_items: 12, }, { content_id: '4', - content_price: 200, + content_price: '200.00', num_items: 11, }, ], @@ -292,7 +292,7 @@ export const data = [ }, statusCode: 400, error: - '[TWITTER ADS]: one of twclid, phone, email, ip_address or user_agent must be present in properties.', + '[TWITTER ADS]: one of twclid, phone, email or ip_address with user_agent must be present in properties.', statTags: { errorCategory: 'dataValidation', errorType: 'instrumentation', @@ -851,12 +851,12 @@ export const data = [ contents: [ { content_id: '12', - content_price: 123.3345, + content_price: '123.3345', num_items: 12, }, { content_id: '4', - content_price: 200, + content_price: '200.00', num_items: 11, }, ], @@ -969,6 +969,192 @@ export const data = [ ], }, }, + output: { + response: { + status: 200, + body: [ + { + error: + '[TWITTER ADS]: one of twclid, phone, email or ip_address with user_agent must be present in properties.', + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for track event with user_agent as an identifier', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + }, + }, + properties: { + affiliation: 'Google Store', + user_agent: + ' Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + '[TWITTER ADS]: one of twclid, phone, email or ip_address with user_agent must be present in properties.', + metadata: { + secret: { + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for track event with ip_address and user_agent as an identifier', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + ip_address: '8.25.197.25', + user_agent: + ' Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, output: { response: { status: 200, @@ -994,6 +1180,8 @@ export const data = [ identifiers: [ { ip_address: '8.25.197.25', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', }, ], }, @@ -1022,7 +1210,7 @@ export const data = [ }, { name: 'twitter_ads', - description: 'Test case for track event with user_agent as an identifier', + description: 'Test case for track event with email and ip_address as an identifier', feature: 'processor', module: 'destination', version: 'v0', @@ -1036,17 +1224,28 @@ export const data = [ channel: 'web', context: { source: 'test', + userAgent: 'chrome', traits: { anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', email: 'abc@gmail.com', phone: '+1234589947', ge: 'male', }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', properties: { affiliation: 'Google Store', - user_agent: - ' Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + ip_address: '8.25.197.25', + email: 'abc@ax.com', }, anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', integrations: { @@ -1055,6 +1254,9 @@ export const data = [ }, metadata: { secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', accessTokenSecret: 'testAccessTokenSecret', }, }, @@ -1097,11 +1299,14 @@ export const data = [ JSON: { conversions: [ { + conversion_time: '2020-08-14T05:30:30.118Z', + user_agent: 'chrome', event_id: 'tw-odt2o-odt2q', identifiers: [ { - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + ip_address: '8.25.197.25', }, ], }, @@ -1116,6 +1321,1076 @@ export const data = [ }, metadata: { secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for track event with phone and user_agent as an identifier', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + phone: '+919927455678', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + user_agent: 'chrome', + event_id: 'tw-odt2o-odt2q', + identifiers: [ + { + hashed_phone_number: + 'b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: + 'Test case for track event with twclid and ip_address with user_agent as an identifier', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + twclid: '543', + ip_address: '8.25.197.25', + user_agent: + ' Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + user_agent: 'chrome', + event_id: 'tw-odt2o-odt2q', + identifiers: [ + { + twclid: '543', + }, + { + ip_address: '8.25.197.25', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for email with only ip_address (no user_agent)', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + properties: { + email: 'test@example.com', + ip_address: '8.25.197.25', + // user_agent is intentionally missing + }, + timestamp: '2020-08-14T05:30:30.118Z', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + event_id: 'tw-odt2o-odt2q', + identifiers: [ + { + hashed_email: + '973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b', + ip_address: '8.25.197.25', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for email with only user_agent (no ip_address)', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + properties: { + email: 'test@example.com', + user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)', + // ip_address is intentionally missing + }, + timestamp: '2020-08-14T05:30:30.118Z', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + event_id: 'tw-odt2o-odt2q', + identifiers: [ + { + hashed_email: + '973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b', + user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for content transformations with missing price and quantity', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + email: 'abc@ax.com', + contents: [ + { + // No price or quantity + id: '12', + name: 'Product 1', + type: 'physical', + groupId: 'group1', + }, + { + // Only price, no quantity + id: '13', + price: '200', + name: 'Product 2', + type: 'digital', + }, + { + // Only quantity, no price + id: '14', + quantity: '3', + name: 'Product 3', + groupId: 'group2', + }, + ], + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + event_id: 'tw-234234324234', + identifiers: [ + { + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + }, + ], + contents: [ + { + content_id: '12', + content_name: 'Product 1', + content_type: 'physical', + content_group_id: 'group1', + }, + { + content_id: '13', + content_name: 'Product 2', + content_type: 'digital', + content_price: '200.00', + }, + { + content_id: '14', + content_name: 'Product 3', + content_group_id: 'group2', + num_items: 3, + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for content with no mappable fields', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + email: 'abc@ax.com', + contents: [ + { + // No mappable fields - should be filtered out + someOtherField: 'value', + anotherField: 123, + }, + { + // Valid content - should be included + id: '13', + name: 'Product 2', + }, + ], + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + event_id: 'tw-234234324234', + identifiers: [ + { + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + }, + ], + contents: [ + { + content_id: '13', + content_name: 'Product 2', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for missing eventNameToIdMappings in config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Product Viewed', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + email: 'test@example.com', + ip_address: '8.25.197.25', + user_agent: 'Mozilla/5.0', + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + // twitterAdsEventNames is intentionally missing + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: + "[TWITTER ADS]: Event - 'Product Viewed' do not have a corresponding eventId in configuration. Aborting", + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for empty string identifiers', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + email: '', + phone: '', + twclid: '', + ip_address: '', + user_agent: '', + // All identifier fields present but empty + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: + '[TWITTER ADS]: one of twclid, phone, email or ip_address with user_agent must be present in properties.', + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for all invalid contents', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + email: 'test@example.com', + value: '100', + currency: 'USD', + contents: [ + { + // No valid mappable fields + invalidField1: 'value1', + invalidField2: 'value2', + }, + { + // Another invalid content + someField: 123, + otherField: true, + }, + ], + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + event_id: 'tw-234234324234', + value: '100', + price_currency: 'USD', + identifiers: [ + { + hashed_email: + '973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b', + }, + ], + // contents field should not be present as all contents were invalid + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for content transformations with invalid content price', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + email: 'abc@ax.com', + contents: [ + { + // invalid price + id: '12', + price: 'random-price-string', + name: 'Product 1', + type: 'physical', + groupId: 'group1', + }, + { + // valid price + id: '13', + price: '0', + name: 'Product 2', + type: 'digital', + }, + ], + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + event_id: 'tw-234234324234', + identifiers: [ + { + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + }, + ], + contents: [ + { + content_id: '12', + content_name: 'Product 1', + content_type: 'physical', + content_group_id: 'group1', + }, + { + content_id: '13', + content_name: 'Product 2', + content_type: 'digital', + content_price: '0.00', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', accessTokenSecret: 'testAccessTokenSecret', }, }, diff --git a/test/integrations/destinations/twitter_ads/router/data.ts b/test/integrations/destinations/twitter_ads/router/data.ts index 7e8061dd7e5..900387a654b 100644 --- a/test/integrations/destinations/twitter_ads/router/data.ts +++ b/test/integrations/destinations/twitter_ads/router/data.ts @@ -127,8 +127,8 @@ export const data = [ conversions: [ { contents: [ - { content_id: '12', content_price: 123.3345, num_items: 12 }, - { content_id: '4', content_price: 200, num_items: 11 }, + { content_id: '12', content_price: '123.3345', num_items: 12 }, + { content_id: '4', content_price: '200.00', num_items: 11 }, ], conversion_id: '213123', conversion_time: '2023-06-01T06:03:08.739Z', @@ -193,6 +193,229 @@ export const data = [ }, }, }, + { + name: 'twitter_ads', + description: 'Test case for missing properties in message', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + destType: 'twitter_ads', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { rudderEventName: 'Home Page Viewed', twitterEventId: 'tw-odt2o-odt2q' }, + ], + }, + }, + statusCode: 400, + error: '[TWITTER ADS]: properties must be present in event. Aborting message', + metadata: [ + { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + ], + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'router', + }, + }, + ], + }, + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for missing OAuth secret', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + properties: { + email: 'test@test.com', + }, + }, + metadata: {}, // Missing secret + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + destType: 'twitter_ads', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { rudderEventName: 'Home Page Viewed', twitterEventId: 'tw-odt2o-odt2q' }, + ], + }, + }, + statusCode: 500, + error: '[TWITTER ADS]:: OAuth - access keys not found', + metadata: [{}], + statTags: { + errorCategory: 'platform', + errorType: 'oAuthSecret', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'router', + }, + }, + ], + }, + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for unsupported message type', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + type: 'identify', // Unsupported message type + properties: { + email: 'test@test.com', + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + }, + }, + }, + ], + destType: 'twitter_ads', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + destination: { + Config: { + pixelId: 'dummyPixelId', + }, + }, + statusCode: 400, + error: 'Message type identify not supported', + metadata: [ + { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + ], + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'router', + }, + }, + ], + }, + }, + }, + }, ].map((tc) => ({ ...tc, mockFns: (_) => { diff --git a/test/integrations/destinations/user/maskedSecrets.ts b/test/integrations/destinations/user/maskedSecrets.ts new file mode 100644 index 00000000000..35f0f387449 --- /dev/null +++ b/test/integrations/destinations/user/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Token ${secret1}`; diff --git a/test/integrations/destinations/user/network.ts b/test/integrations/destinations/user/network.ts index dff2e0726d8..d0a89b22821 100644 --- a/test/integrations/destinations/user/network.ts +++ b/test/integrations/destinations/user/network.ts @@ -1,8 +1,9 @@ +import { authHeader1 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -44,7 +45,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -92,7 +93,7 @@ export const networkCallsData = [ user_custom_id: 'user@123', }, headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -130,7 +131,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -167,7 +168,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -204,7 +205,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -241,7 +242,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -277,7 +278,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -313,7 +314,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -355,7 +356,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -403,7 +404,7 @@ export const networkCallsData = [ user_custom_id: 'user@123', }, headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, diff --git a/test/integrations/destinations/user/processor/data.ts b/test/integrations/destinations/user/processor/data.ts index ef8ddebfd58..a6a195d8934 100644 --- a/test/integrations/destinations/user/processor/data.ts +++ b/test/integrations/destinations/user/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'user', @@ -22,7 +23,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userEvents: [{ rsEventName: 'login', userEventName: 'product viewed' }], companyAttributesMapping: [ @@ -87,7 +88,7 @@ export const data = [ traits: { googleUrl: 'www.google.com' }, }, destination: { - Config: { apiKey: 'dummyApiKey', appSubdomain: 'commander' }, + Config: { apiKey: secret1, appSubdomain: 'commander' }, }, }, ], @@ -133,7 +134,7 @@ export const data = [ timestamp: '2020-02-02T00:23:09.544Z', }, destination: { - Config: { apiKey: 'dummyApiKey', appSubdomain: 'commander' }, + Config: { apiKey: secret1, appSubdomain: 'commander' }, }, }, ], @@ -198,7 +199,7 @@ export const data = [ userId: 'user@123', }, destination: { - Config: { apiKey: 'dummyApiKey', appSubdomain: 'commander' }, + Config: { apiKey: secret1, appSubdomain: 'commander' }, }, }, ], @@ -258,7 +259,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], }, @@ -297,7 +298,7 @@ export const data = [ files: {}, headers: { Accept: '*/*;version=2', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PUT', @@ -344,7 +345,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], }, @@ -385,7 +386,7 @@ export const data = [ headers: { Accept: '*/*;version=2', 'Content-Type': 'application/json', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://commander.user.com/api/public/users/59/', @@ -441,7 +442,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ @@ -482,7 +483,7 @@ export const data = [ headers: { Accept: '*/*;version=2', 'Content-Type': 'application/json', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://commander.user.com/api/public/events/', @@ -551,7 +552,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ @@ -592,7 +593,7 @@ export const data = [ headers: { Accept: '*/*;version=2', 'Content-Type': 'application/json', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://commander.user.com/api/public/site-views/', @@ -643,7 +644,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ @@ -683,7 +684,7 @@ export const data = [ headers: { Accept: '*/*;version=2', 'Content-Type': 'application/json', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://commander.user.com/api/public/companies/21/add_member/', diff --git a/test/integrations/destinations/user/router/data.ts b/test/integrations/destinations/user/router/data.ts index acdb5c953e4..9ad050db38b 100644 --- a/test/integrations/destinations/user/router/data.ts +++ b/test/integrations/destinations/user/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'user', @@ -40,7 +41,7 @@ export const data = [ metadata: { jobId: 1, userId: 'u1' }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ @@ -83,7 +84,7 @@ export const data = [ headers: { Accept: '*/*;version=2', 'Content-Type': 'application/json', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://commander.user.com/api/public/companies/21/add_member/', @@ -93,7 +94,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ @@ -149,7 +150,7 @@ export const data = [ metadata: { jobId: 2, userId: 'u1' }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ @@ -204,7 +205,7 @@ export const data = [ headers: { Accept: '*/*;version=2', 'Content-Type': 'application/json', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://commander.user.com/api/public/users/59/', @@ -214,7 +215,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ diff --git a/test/integrations/destinations/variance/maskedSecrets.ts b/test/integrations/destinations/variance/maskedSecrets.ts new file mode 100644 index 00000000000..74d160ff192 --- /dev/null +++ b/test/integrations/destinations/variance/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1)}`; diff --git a/test/integrations/destinations/variance/processor/data.ts b/test/integrations/destinations/variance/processor/data.ts index f4f3054296c..591d5a92503 100644 --- a/test/integrations/destinations/variance/processor/data.ts +++ b/test/integrations/destinations/variance/processor/data.ts @@ -1,3 +1,5 @@ +import { authHeader1 } from '../maskedSecrets'; + export const data = [ { name: 'variance', @@ -109,7 +111,7 @@ export const data = [ }, Config: { webhookUrl: 'http://6b0e6a60.ngrok.io', - authHeader: 'Basic MVA4dUtGOF=', + authHeader: authHeader1, }, }, metadata: { @@ -131,7 +133,7 @@ export const data = [ method: 'POST', endpoint: 'http://6b0e6a60.ngrok.io', headers: { - authorization: 'Basic MVA4dUtGOF=', + authorization: authHeader1, 'content-type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/vitally/maskedSecrets.ts b/test/integrations/destinations/vitally/maskedSecrets.ts new file mode 100644 index 00000000000..c5a4dc839e8 --- /dev/null +++ b/test/integrations/destinations/vitally/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${secret1}`; diff --git a/test/integrations/destinations/vitally/processor/data.ts b/test/integrations/destinations/vitally/processor/data.ts index 2c3fdd32979..eee043de65f 100644 --- a/test/integrations/destinations/vitally/processor/data.ts +++ b/test/integrations/destinations/vitally/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'vitally', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKeyVitally: 'abc123', + apiKeyVitally: secret1, }, DestinationDefinition: { Config: { @@ -66,7 +67,7 @@ export const data = [ method: 'POST', userId: '', headers: { - authorization: 'Basic abc123', + authorization: authHeader1, 'content-type': 'application/json', }, }, @@ -92,7 +93,7 @@ export const data = [ { destination: { Config: { - apiKeyVitally: 'abc123', + apiKeyVitally: secret1, }, DestinationDefinition: { Config: { @@ -145,7 +146,7 @@ export const data = [ method: 'POST', userId: '', headers: { - authorization: 'Basic abc123', + authorization: authHeader1, 'content-type': 'application/json', }, }, @@ -171,7 +172,7 @@ export const data = [ { destination: { Config: { - apiKeyVitally: 'abc123', + apiKeyVitally: secret1, }, DestinationDefinition: { Config: { @@ -220,7 +221,7 @@ export const data = [ method: 'POST', userId: '', headers: { - authorization: 'Basic abc123', + authorization: authHeader1, 'content-type': 'application/json', }, }, @@ -247,7 +248,7 @@ export const data = [ { destination: { Config: { - apiKeyVitally: 'abc123', + apiKeyVitally: secret1, }, DestinationDefinition: { Config: { diff --git a/test/integrations/destinations/webengage/maskedSecrets.ts b/test/integrations/destinations/webengage/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/webengage/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/webengage/processor/data.ts b/test/integrations/destinations/webengage/processor/data.ts index e4cc9bfd3df..62d43e98ce6 100644 --- a/test/integrations/destinations/webengage/processor/data.ts +++ b/test/integrations/destinations/webengage/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'webengage', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -86,7 +87,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -141,7 +142,7 @@ export const data = [ endpoint: 'https://api.in.webengage.com/v1/accounts/3bjsjdbh7/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -202,7 +203,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -256,7 +257,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -318,7 +319,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -372,7 +373,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -434,7 +435,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -489,7 +490,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -552,7 +553,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -645,7 +646,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -670,7 +671,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -763,7 +764,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -788,7 +789,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -880,7 +881,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -905,7 +906,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -959,7 +960,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1022,7 +1023,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1096,7 +1097,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1170,7 +1171,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1243,7 +1244,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'standard', }, @@ -1316,7 +1317,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'standard', }, @@ -1370,7 +1371,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1433,7 +1434,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'standard', }, @@ -1486,7 +1487,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1548,7 +1549,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1632,7 +1633,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -1657,7 +1658,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1724,7 +1725,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1764,7 +1765,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1835,7 +1836,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1878,7 +1879,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1954,7 +1955,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -2029,7 +2030,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -2118,7 +2119,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -2205,7 +2206,7 @@ export const data = [ endpoint: 'https://api.in.webengage.com/v1/accounts/3bjsjdbh7/events', files: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', diff --git a/test/integrations/destinations/webhook/processor/data.ts b/test/integrations/destinations/webhook/processor/data.ts index 7720bc683c8..c4e29e30fc7 100644 --- a/test/integrations/destinations/webhook/processor/data.ts +++ b/test/integrations/destinations/webhook/processor/data.ts @@ -1939,7 +1939,7 @@ export const data = [ test2: 'value2', dynamic_header_key_string: 'dynamic_header_value_string', dynamic_header_key_num: '10', - dynamic_header_key_object: '{"k1":"v1"}', + dynamic_header_key_object: JSON.stringify({ k1: 'v1' }), }, params: {}, files: {}, @@ -3355,9 +3355,14 @@ export const data = [ files: {}, headers: { 'content-type': 'application/json', - ijkl: '{"int":1234,"string":"abcd","array":[1,2,"a",true],"object":{"key1":"value"}}', + ijkl: JSON.stringify({ + int: 1234, + string: 'abcd', + array: [1, 2, 'a', true], + object: { key1: 'value' }, + }), key1: 'abcd', - key2: '{"key1":"","key2":""}', + key2: JSON.stringify({ key1: '', key2: '' }), key3: 'true', key4: 'null', key5: 'undefined', diff --git a/test/integrations/destinations/wootric/maskedSecrets.ts b/test/integrations/destinations/wootric/maskedSecrets.ts new file mode 100644 index 00000000000..4fcad9f777b --- /dev/null +++ b/test/integrations/destinations/wootric/maskedSecrets.ts @@ -0,0 +1,10 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secretPassword = path.basename(__dirname) + 1; +export const secretAccountToken = path.basename(__dirname) + 2; +export const secretInvalidToken = path.basename(__dirname) + 3; +export const secretAccessToken = path.basename(__dirname) + 4; +export const secretRefreshToken = path.basename(__dirname) + 5; + +export const authHeaderAccessToken = `Bearer ${secretAccessToken}`; diff --git a/test/integrations/destinations/wootric/network.ts b/test/integrations/destinations/wootric/network.ts index 1b51cc700c2..5b89680b365 100644 --- a/test/integrations/destinations/wootric/network.ts +++ b/test/integrations/destinations/wootric/network.ts @@ -1,3 +1,10 @@ +import { + secretInvalidToken, + secretAccountToken, + secretAccessToken, + secretRefreshToken, +} from './maskedSecrets'; + export const networkCallsData = [ { httpReq: { @@ -134,15 +141,15 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://api.wootric.com/oauth/token?account_token=NPS-dummyToken', + url: `https://api.wootric.com/oauth/token?account_token=${secretAccountToken}`, method: 'POST', }, httpRes: { data: { - access_token: '2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + access_token: secretAccessToken, token_type: 'Bearer', expires_in: 7200, - refresh_token: 'f4033a61742e84405a5ef8b2e09b82395dc041f0259fd5fb715fc196a1b9cd52', + refresh_token: secretRefreshToken, scope: 'delete_account admin respond export read survey invalidate_response', created_at: 1660292389, }, @@ -169,7 +176,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://api.wootric.com/oauth/token?account_token=NPS-dummyToken12', + url: `https://api.wootric.com/oauth/token?account_token=${secretInvalidToken}`, method: 'POST', }, httpRes: { diff --git a/test/integrations/destinations/wootric/processor/data.ts b/test/integrations/destinations/wootric/processor/data.ts index ae747e982d5..94d005e6261 100644 --- a/test/integrations/destinations/wootric/processor/data.ts +++ b/test/integrations/destinations/wootric/processor/data.ts @@ -1,3 +1,10 @@ +import { + secretPassword, + secretAccountToken, + authHeaderAccessToken, + secretInvalidToken, +} from '../maskedSecrets'; + export const data = [ { name: 'wootric', @@ -12,8 +19,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken12', + password: secretPassword, + accountToken: secretInvalidToken, }, ID: 'wootric-1234', }, @@ -40,8 +47,11 @@ export const data = [ status: 200, body: [ { - error: - '{"message":"Access token could not be generated due to {\\"error\\":\\"Not found\\",\\"status\\":404}","destinationResponse":{"response":{"error":"Not found","status":404},"status":500}}', + error: JSON.stringify({ + message: + 'Access token could not be generated due to {"error":"Not found","status":404}', + destinationResponse: { response: { error: 'Not found', status: 404 }, status: 500 }, + }), statTags: { destType: 'WOOTRIC', errorCategory: 'network', @@ -69,8 +79,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -151,8 +161,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -194,8 +203,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -275,8 +284,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -317,8 +325,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -398,8 +406,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -440,8 +447,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -533,8 +540,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -634,8 +641,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -716,8 +723,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/490635419', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -756,8 +762,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -832,8 +838,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -871,8 +876,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -950,8 +955,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -989,8 +993,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1078,8 +1082,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462/responses', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1121,8 +1124,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1222,8 +1225,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1329,8 +1332,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1430,8 +1433,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1509,8 +1512,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462/declines', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1543,8 +1545,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1643,8 +1645,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1754,8 +1756,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, diff --git a/test/integrations/destinations/wootric/router/data.ts b/test/integrations/destinations/wootric/router/data.ts index 9af28f4f483..1c29dcfae24 100644 --- a/test/integrations/destinations/wootric/router/data.ts +++ b/test/integrations/destinations/wootric/router/data.ts @@ -1,3 +1,5 @@ +import { secretPassword, secretAccountToken, authHeaderAccessToken } from '../maskedSecrets'; + export const data = [ { name: 'wootric', @@ -13,8 +15,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -77,8 +79,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -140,8 +142,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -203,8 +205,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -257,8 +259,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -319,8 +321,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -374,8 +376,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -429,8 +431,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -490,8 +492,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -558,8 +560,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -617,8 +619,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -676,8 +678,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -734,8 +736,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -792,8 +794,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -861,8 +863,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -942,8 +944,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -972,8 +973,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -985,8 +986,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1014,8 +1014,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1027,8 +1027,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1056,8 +1055,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1065,8 +1064,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -1087,8 +1086,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -1113,8 +1112,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1132,8 +1130,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1145,8 +1143,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1164,8 +1161,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1177,8 +1174,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1203,8 +1199,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1216,8 +1212,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462/responses', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1246,8 +1241,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1256,8 +1251,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -1277,8 +1272,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -1303,8 +1298,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462/declines', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1324,8 +1318,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1333,8 +1327,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -1355,8 +1349,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -1378,8 +1372,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, diff --git a/test/integrations/destinations/wunderkind/processor/validation.ts b/test/integrations/destinations/wunderkind/processor/validation.ts index aeabdd497b0..38c94ecef1e 100644 --- a/test/integrations/destinations/wunderkind/processor/validation.ts +++ b/test/integrations/destinations/wunderkind/processor/validation.ts @@ -30,6 +30,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/wunderkind/router/data.ts b/test/integrations/destinations/wunderkind/router/data.ts index 8081bdf456f..8597901dd4d 100644 --- a/test/integrations/destinations/wunderkind/router/data.ts +++ b/test/integrations/destinations/wunderkind/router/data.ts @@ -111,8 +111,127 @@ export const data = [ }, { batchedRequest: { - payload: - '{"account":{"account_id":"test-account-id","account_settings":{"instance_id":"test-instance-id","key":"test-api-key"}},"type":"event_processing_request","id":"a2a5575b-d3b0-4a14-96a5-79f8e38b0778","timestamp_ms":1718893923387,"source_id":"test-source-id","source_channel":"native","device_application_stamp":"test-device-application-stamp","user_identities":[{"type":"customer","encoding":"raw","value":"eb3f565d-49bd-418c-ae31-801f25da0ce2"},{"type":"email","encoding":"raw","value":"johndoe@gmail.com"},{"type":"other","encoding":"raw","value":"7c2c3abd-62bf-473e-998d-034df0f25ea3"}],"user_attribute_lists":{},"runtime_environment":{"sdk_version":"8.8.0","type":"ios","identities":[{"type":"apple_push_notification_token","encoding":"raw","value":"9e3dba8db39f9d130f3d1584c8aab674e9f4b06d0b1b52867e128d3e7b1130f1"},{"type":"ios_vendor_id","encoding":"raw","value":"78c53c15-32a1-4b65-adac-bec2d7bb8fab"}],"build_id":"20E12","brand":"iPhone14,7","product":"iPhone14,7","name":"iPhone","manufacturer":"Apple","os_version":"16.3.1","model":"iPhone14,7","screen_height":2532,"screen_width":1170,"locale_language":"en-US","locale_country":"US","network_country":"us","network_carrier":"Verizon","network_code":"480","network_mobile_country_code":"311","timezone_offset":-7,"timezone_name":"America/Phoenix","cpu_architecture":"arm64","radio_access_technology":"LTE","application_name":"Abc.com - New Account","application_version":"8.8.0","application_package":"com.abc","apple_search_ads_attribution":{},"client_ip_address":"192.0.2.0"},"user_attributes":{"firstName":"john","lastName":"doe"},"events":[{"screen_name":"shopping/vehicle-details","type":"custom_event","id":"1393f120-53b8-4126-8deb-874c26b5b06d","timestamp_ms":1703685306737,"source_id":"test-source-id","session_id":1688982077105115000,"name":"srp-screen-view","custom_event_type":"other","attributes":{"profileLoginType":"logged-in","launchType":"organic","platform":"iphone-app","fuelType":"Gasoline","makeName":"Volvo","vehicleAdCategory":"multi_cat","searchInstanceId":"test-search-instance-id","customerId":"test-customer-id","drivetrain":"All-wheel Drive","year":"2024","canonical_mmt":"volvo:xc90:b5_core_bright_theme","mileage":"5","make":"volvo","pushNotification":"disabled","advertiserId":"00000000-0000-0000-0000-000000000000","exteriorColor":"Crystal White","adobeId":"test-adobe-id","pageChannel":"shopping","bodyStyle":"suv","tripId":"test-trip-id","stockType":"new","makeModelTrim":"volvo:xc90:b5_core_bright_theme","pageName":"shopping/vehicle-details","model":"xc90","deviceType":"mobile","listingId":"test-listing-id","dealerZip":"30341","cpoIndicator":"false","trim":"b5_core_bright_theme","canonical_mmty":"volvo:xc90:b5_core_bright_theme:2024","sellerType":"franchise","price":"56002","vin":"test-vin","resultSelected":"89","zip":"85381","stockSubStock":"new","profileUserId":"test-profile-user-id","pageKey":"vehicle-details","badges":"homeDelivery,virtualAppointment","modelName":"XC90"}}]}', + payload: JSON.stringify({ + account: { + account_id: 'test-account-id', + account_settings: { instance_id: 'test-instance-id', key: 'test-api-key' }, + }, + type: 'event_processing_request', + id: 'a2a5575b-d3b0-4a14-96a5-79f8e38b0778', + timestamp_ms: 1718893923387, + source_id: 'test-source-id', + source_channel: 'native', + device_application_stamp: 'test-device-application-stamp', + user_identities: [ + { + type: 'customer', + encoding: 'raw', + value: 'eb3f565d-49bd-418c-ae31-801f25da0ce2', + }, + { type: 'email', encoding: 'raw', value: 'johndoe@gmail.com' }, + { + type: 'other', + encoding: 'raw', + value: '7c2c3abd-62bf-473e-998d-034df0f25ea3', + }, + ], + user_attribute_lists: {}, + runtime_environment: { + sdk_version: '8.8.0', + type: 'ios', + identities: [ + { + type: 'apple_push_notification_token', + encoding: 'raw', + value: '9e3dba8db39f9d130f3d1584c8aab674e9f4b06d0b1b52867e128d3e7b1130f1', + }, + { + type: 'ios_vendor_id', + encoding: 'raw', + value: '78c53c15-32a1-4b65-adac-bec2d7bb8fab', + }, + ], + build_id: '20E12', + brand: 'iPhone14,7', + product: 'iPhone14,7', + name: 'iPhone', + manufacturer: 'Apple', + os_version: '16.3.1', + model: 'iPhone14,7', + screen_height: 2532, + screen_width: 1170, + locale_language: 'en-US', + locale_country: 'US', + network_country: 'us', + network_carrier: 'Verizon', + network_code: '480', + network_mobile_country_code: '311', + timezone_offset: -7, + timezone_name: 'America/Phoenix', + cpu_architecture: 'arm64', + radio_access_technology: 'LTE', + application_name: 'Abc.com - New Account', + application_version: '8.8.0', + application_package: 'com.abc', + apple_search_ads_attribution: {}, + client_ip_address: '192.0.2.0', + }, + user_attributes: { firstName: 'john', lastName: 'doe' }, + events: [ + { + screen_name: 'shopping/vehicle-details', + type: 'custom_event', + id: '1393f120-53b8-4126-8deb-874c26b5b06d', + timestamp_ms: 1703685306737, + source_id: 'test-source-id', + session_id: 1688982077105115000, + name: 'srp-screen-view', + custom_event_type: 'other', + attributes: { + profileLoginType: 'logged-in', + launchType: 'organic', + platform: 'iphone-app', + fuelType: 'Gasoline', + makeName: 'Volvo', + vehicleAdCategory: 'multi_cat', + searchInstanceId: 'test-search-instance-id', + customerId: 'test-customer-id', + drivetrain: 'All-wheel Drive', + year: '2024', + canonical_mmt: 'volvo:xc90:b5_core_bright_theme', + mileage: '5', + make: 'volvo', + pushNotification: 'disabled', + advertiserId: '00000000-0000-0000-0000-000000000000', + exteriorColor: 'Crystal White', + adobeId: 'test-adobe-id', + pageChannel: 'shopping', + bodyStyle: 'suv', + tripId: 'test-trip-id', + stockType: 'new', + makeModelTrim: 'volvo:xc90:b5_core_bright_theme', + pageName: 'shopping/vehicle-details', + model: 'xc90', + deviceType: 'mobile', + listingId: 'test-listing-id', + dealerZip: '30341', + cpoIndicator: 'false', + trim: 'b5_core_bright_theme', + canonical_mmty: 'volvo:xc90:b5_core_bright_theme:2024', + sellerType: 'franchise', + price: '56002', + vin: 'test-vin', + resultSelected: '89', + zip: '85381', + stockSubStock: 'new', + profileUserId: 'test-profile-user-id', + pageKey: 'vehicle-details', + badges: 'homeDelivery,virtualAppointment', + modelName: 'XC90', + }, + }, + ], + }), }, metadata: [generateMetadata(2)], destination, diff --git a/test/integrations/destinations/x_audience/common.ts b/test/integrations/destinations/x_audience/common.ts index 547e04ba848..8a16c8c6fc2 100644 --- a/test/integrations/destinations/x_audience/common.ts +++ b/test/integrations/destinations/x_audience/common.ts @@ -2,7 +2,7 @@ export const authHeaderConstant = 'OAuth oauth_consumer_key="qwe", oauth_nonce="V1kMh028kZLLhfeYozuL0B45Pcx6LvuW", oauth_signature="Di4cuoGv4PnCMMEeqfWTcqhvdwc%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1685603652", oauth_token="dummyAccessToken", oauth_version="1.0"'; export const destination = { Config: { - accountId: '{"Dummy Name":"1234"}', + accountId: JSON.stringify({ 'Dummy Name': '1234' }), audienceId: 'dummyId', }, ID: 'xpixel-1234', diff --git a/test/integrations/destinations/zendesk/maskedSecrets.ts b/test/integrations/destinations/zendesk/maskedSecrets.ts new file mode 100644 index 00000000000..472f605b9c5 --- /dev/null +++ b/test/integrations/destinations/zendesk/maskedSecrets.ts @@ -0,0 +1,13 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const authHeader1 = `Basic ${base64Convertor('myDummyUserName1/token' + ':' + secret1)}`; +export const authHeader2 = `Basic ${base64Convertor('rudderlabtest2@email.com/token' + ':' + secret2)}`; +export const authHeader3 = `Basic ${base64Convertor('test@rudder.com/token' + ':' + secret1)}`; +export const authHeader4 = `Basic ${base64Convertor('test@rudder.com/token' + ':' + secret3)}`; +export const authHeader5 = `Basic ${base64Convertor('myDummyUserName2/token' + ':' + secret4)}`; +export const authHeader6 = `Basic ${base64Convertor('rudderlabtest1@email.com/token' + ':' + secret2)}`; diff --git a/test/integrations/destinations/zendesk/network.ts b/test/integrations/destinations/zendesk/network.ts index bc80f0cd0a7..8e015f313cf 100644 --- a/test/integrations/destinations/zendesk/network.ts +++ b/test/integrations/destinations/zendesk/network.ts @@ -1,8 +1,16 @@ +import { + authHeader1, + authHeader2, + authHeader3, + authHeader4, + authHeader5, + authHeader6, +} from './maskedSecrets'; export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -70,7 +78,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -114,7 +122,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -145,7 +153,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -205,7 +213,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -216,7 +224,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDJAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'GET', @@ -235,7 +243,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDJAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'POST', @@ -246,7 +254,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -314,7 +322,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -382,7 +390,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -426,7 +434,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -457,7 +465,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -517,7 +525,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -528,7 +536,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -588,7 +596,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -656,7 +664,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -716,7 +724,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -745,7 +753,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -813,7 +821,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -873,7 +881,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -902,7 +910,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'GET', @@ -973,7 +981,7 @@ export const networkCallsData = [ user_field: { active: true, description: 'country', key: 'country', title: 'country' }, }, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'POST', @@ -1041,7 +1049,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'GET', @@ -1112,7 +1120,7 @@ export const networkCallsData = [ user_field: { active: true, description: 'country', key: 'country', title: 'country' }, }, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'POST', @@ -1180,7 +1188,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'GET', @@ -1251,7 +1259,7 @@ export const networkCallsData = [ user_field: { active: true, description: 'country', key: 'country', title: 'country' }, }, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'POST', @@ -1319,7 +1327,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'GET', @@ -1338,7 +1346,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + Authorization: authHeader4, 'Content-Type': 'application/json', }, method: 'POST', @@ -1393,7 +1401,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + Authorization: authHeader4, 'Content-Type': 'application/json', }, method: 'GET', @@ -1412,7 +1420,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + Authorization: authHeader4, 'Content-Type': 'application/json', }, method: 'POST', @@ -1467,7 +1475,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMi90b2tlbjpteUR1bW15QXBpVG9rZW4y', + Authorization: authHeader5, 'Content-Type': 'application/json', }, method: 'GET', @@ -1478,7 +1486,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -1546,7 +1554,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -1614,7 +1622,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -1675,7 +1683,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -1721,7 +1729,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDFAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader6, 'Content-Type': 'application/json', }, method: 'GET', @@ -1740,7 +1748,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDFAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader6, 'Content-Type': 'application/json', }, method: 'POST', @@ -1795,7 +1803,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDJAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'GET', @@ -1814,7 +1822,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDJAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'POST', @@ -1822,4 +1830,351 @@ export const networkCallsData = [ }, httpRes: { data: { user: {} }, status: 200 }, }, + // network call to get id for userId = test-user-id + { + httpReq: { + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=test-user-id', + }, + httpRes: { + data: { + count: 1, + facets: null, + next_page: null, + previous_page: null, + users: [ + { + active: true, + alias: null, + created_at: '2022-11-24T09:03:54Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'test1000@email.com', + external_id: 'test-user-id', + iana_time_zone: 'Asia/Kolkata', + id: 911113780483, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'name-1000 user', + notes: null, + only_private_comments: false, + organization_id: null, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + result_type: 'user', + role: 'end-user', + role_type: null, + shared: false, + shared_agent: false, + shared_phone_number: null, + signature: null, + suspended: false, + tags: [], + ticket_restriction: 'requested', + time_zone: 'Asia/Kolkata', + two_factor_auth_enabled: false, + updated_at: '2022-11-24T09:03:54Z', + url: 'https://rudderstack6787.zendesk.com/api/v2/users/10865192864273.json', + user_fields: {}, + verified: true, + }, + ], + }, + status: 200, + }, + }, + // network call to get identities for user test-user-id + { + httpReq: { + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/911113780483/identities', + }, + httpRes: { + data: { + count: 2, + identities: [ + { + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/25465855449501.json', + id: 25465855449501, + user_id: 25465855448733, + type: 'phone_number', + value: '+910123456789', + verified: true, + primary: true, + created_at: '2025-02-27T14:14:58Z', + updated_at: '2025-02-27T14:14:58Z', + }, + { + created_at: '2022-11-02T08:03:28Z', + deliverable_state: 'deliverable', + id: 7535981118877, + primary: false, + type: 'email', + undeliverable_count: 0, + updated_at: '2022-11-02T10:23:28Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/7535981118877.json', + user_id: 900113780483, + value: 'example119@email.com', + verified: false, + }, + { + created_at: '2022-11-02T04:23:46Z', + deliverable_state: 'deliverable', + id: 7534173321117, + primary: true, + type: 'email', + undeliverable_count: 0, + updated_at: '2022-11-02T10:23:28Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/7534173321117.json', + user_id: 900113780483, + value: 'example115@email.com', + verified: true, + }, + ], + next_page: null, + previous_page: null, + }, + status: 200, + }, + }, + // network call to get id for user-id = test-user-id-no-primary-email + { + httpReq: { + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=test-user-id-no-primary-email', + }, + httpRes: { + data: { + count: 1, + facets: null, + next_page: null, + previous_page: null, + users: [ + { + active: true, + alias: null, + created_at: '2022-11-24T09:03:54Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'test1000@email.com', + external_id: 'test-user-id', + iana_time_zone: 'Asia/Kolkata', + id: 911113781483, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'name-1000 user', + notes: null, + only_private_comments: false, + organization_id: null, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + result_type: 'user', + role: 'end-user', + role_type: null, + shared: false, + shared_agent: false, + shared_phone_number: null, + signature: null, + suspended: false, + tags: [], + ticket_restriction: 'requested', + time_zone: 'Asia/Kolkata', + two_factor_auth_enabled: false, + updated_at: '2022-11-24T09:03:54Z', + url: 'https://rudderstack6787.zendesk.com/api/v2/users/10865192864273.json', + user_fields: {}, + verified: true, + }, + ], + }, + status: 200, + }, + }, + // network call to get identities for user test-user-id-no-primary-email + { + httpReq: { + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/911113781483/identities', + }, + httpRes: { + data: { + count: 2, + identities: [ + { + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/25465855449501.json', + id: 25465855449501, + user_id: 25465855448733, + type: 'phone_number', + value: '+910123456789', + verified: true, + primary: true, + created_at: '2025-02-27T14:14:58Z', + updated_at: '2025-02-27T14:14:58Z', + }, + { + created_at: '2022-11-02T08:03:28Z', + deliverable_state: 'deliverable', + id: 7535981118877, + primary: false, + type: 'email', + undeliverable_count: 0, + updated_at: '2022-11-02T10:23:28Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/7535981118877.json', + user_id: 900113780483, + value: 'example119@email.com', + verified: false, + }, + ], + next_page: null, + previous_page: null, + }, + status: 200, + }, + }, + // network call to get id for user-id = test-user-id-with-same-primary-email + { + httpReq: { + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=test-user-id-with-same-primary-email', + }, + httpRes: { + data: { + count: 1, + facets: null, + next_page: null, + previous_page: null, + users: [ + { + active: true, + alias: null, + created_at: '2022-11-24T09:03:54Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'test1000@email.com', + external_id: 'test-user-id', + iana_time_zone: 'Asia/Kolkata', + id: 911113781481, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'name-1000 user', + notes: null, + only_private_comments: false, + organization_id: null, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + result_type: 'user', + role: 'end-user', + role_type: null, + shared: false, + shared_agent: false, + shared_phone_number: null, + signature: null, + suspended: false, + tags: [], + ticket_restriction: 'requested', + time_zone: 'Asia/Kolkata', + two_factor_auth_enabled: false, + updated_at: '2022-11-24T09:03:54Z', + url: 'https://rudderstack6787.zendesk.com/api/v2/users/10865192864273.json', + user_fields: {}, + verified: true, + }, + ], + }, + status: 200, + }, + }, + // network call to get identities for user test-user-id-with-same-primary-email + { + httpReq: { + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/911113781481/identities', + }, + httpRes: { + data: { + count: 2, + identities: [ + { + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/25465855449501.json', + id: 25465855449501, + user_id: 25465855448733, + type: 'phone_number', + value: '+910123456789', + verified: true, + primary: true, + created_at: '2025-02-27T14:14:58Z', + updated_at: '2025-02-27T14:14:58Z', + }, + { + created_at: '2022-11-02T08:03:28Z', + deliverable_state: 'deliverable', + id: 7535981118877, + primary: true, + type: 'email', + undeliverable_count: 0, + updated_at: '2022-11-02T10:23:28Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/7535981118877.json', + user_id: 900113780483, + value: 'example@email.com', + verified: false, + }, + { + created_at: '2022-11-02T08:03:28Z', + deliverable_state: 'deliverable', + id: 7535981118877, + primary: false, + type: 'email', + undeliverable_count: 0, + updated_at: '2022-11-02T10:23:28Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/7535981118877.json', + user_id: 900113780483, + value: 'example119@email.com', + verified: false, + }, + ], + next_page: null, + previous_page: null, + }, + status: 200, + }, + }, ]; diff --git a/test/integrations/destinations/zendesk/processor/data.ts b/test/integrations/destinations/zendesk/processor/data.ts index d84cdba15a7..be0907026c4 100644 --- a/test/integrations/destinations/zendesk/processor/data.ts +++ b/test/integrations/destinations/zendesk/processor/data.ts @@ -1,3 +1,14 @@ +import { + authHeader1, + secret1, + authHeader3, + authHeader4, + secret3, + authHeader5, + secret4, + authHeader6, + secret2, +} from '../maskedSecrets'; export const data = [ { name: 'zendesk', @@ -11,7 +22,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -183,7 +194,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiToken: 'myDummyApiToken3', + apiToken: secret3, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'test@rudder.com', @@ -244,7 +255,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -307,7 +318,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -349,7 +360,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -418,7 +429,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/organization_memberships.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -454,7 +465,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -520,7 +531,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/events', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -566,7 +577,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -631,7 +642,7 @@ export const data = [ endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/organization_memberships/900004877903.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -651,7 +662,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -693,7 +704,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -758,7 +769,7 @@ export const data = [ endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/organization_memberships/900004877903.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -778,7 +789,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -906,7 +917,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: false, domain: 'rudderlabshelp', email: 'test@rudder.com', @@ -935,7 +946,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -1073,7 +1084,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: false, domain: 'rudderlabshelp', email: 'test@rudder.com', @@ -1102,7 +1113,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -1240,7 +1251,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'test@rudder.com', @@ -1269,7 +1280,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -1414,7 +1425,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiToken: 'myDummyApiToken3', + apiToken: secret3, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'test@rudder.com', @@ -1464,7 +1475,7 @@ export const data = [ endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/events', files: {}, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -1597,7 +1608,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiToken: 'myDummyApiToken3', + apiToken: secret3, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'test@rudder.com', @@ -1647,7 +1658,7 @@ export const data = [ endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/events', files: {}, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -1687,7 +1698,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken2', + apiToken: secret4, createUsersAsVerified: true, domain: 'blendohelp', email: 'myDummyUserName2', @@ -1776,7 +1787,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken2', + apiToken: secret4, createUsersAsVerified: true, domain: 'blendohelp', email: 'myDummyUserName2', @@ -1865,7 +1876,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken2', + apiToken: secret4, createUsersAsVerified: true, domain: 'blendohelp', email: 'myDummyUserName2', @@ -1933,7 +1944,7 @@ export const data = [ method: 'POST', endpoint: 'https://blendohelp.zendesk.com/api/v2/organizations/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMi90b2tlbjpteUR1bW15QXBpVG9rZW4y', + Authorization: authHeader5, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -1974,7 +1985,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -2037,7 +2048,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -2078,7 +2089,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -2144,7 +2155,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -2163,7 +2174,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -2233,7 +2244,7 @@ export const data = [ ID: 'xxxXXXXXXXXXXXxxxxxxxxxorpz', Name: 'Zendesk', Config: { - apiToken: 'dummyApiToken', + apiToken: secret2, createUsersAsVerified: true, domain: 'rudderlabtest1', email: 'rudderlabtest1@email.com', @@ -2278,7 +2289,7 @@ export const data = [ endpoint: 'https://rudderlabtest1.zendesk.com/api/v2/users/900113780483/events', files: {}, headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDFAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader6, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -2336,7 +2347,7 @@ export const data = [ ID: 'xxxXXXXXXXXXXXxxxxxxxxxorpz', Name: 'Zendesk', Config: { - apiToken: 'dummyApiToken', + apiToken: secret2, createUsersAsVerified: true, domain: 'rudderlabtest2', email: 'rudderlabtest2@email.com', @@ -2382,7 +2393,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -2455,4 +2466,336 @@ export const data = [ }, }, }, + { + name: 'zendesk', + description: + 'scenario when searchByExternalId (Update user’s primary email) is true and there are different primary key i.e. phone, email', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: secret1, + createUsersAsVerified: true, + domain: 'rudderlabshelp', + email: 'myDummyUserName1', + password: 'myDummyPwd1', + removeUsersFromOrganization: true, + sendGroupCallsWithoutUserId: true, + searchByExternalId: true, + }, + DestinationDefinition: { + DisplayName: 'Zendesk', + ID: '1YknZ1ENqB8UurJQJE2VrEA61tr', + Name: 'ZENDESK', + }, + Enabled: true, + ID: 'xxxxxxxxxxxxxxxxxxxxxxxO51P', + Name: 'zendesk', + Transformations: [], + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.0-beta.2', + }, + ip: '0.0.0.0', + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.0-beta.2' }, + locale: 'en-GB', + os: { name: '', version: '' }, + screen: { density: 2 }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + }, + integrations: { All: true }, + messageId: '0bab70e8-bf2f-449a-a19b-ca6e3bfed9b7', + request_ip: '[::1]:51573', + type: 'identify', + userId: 'test-user-id', + traits: { email: 'example@email.com', name: 'test-user-name' }, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { identity: { type: 'email', value: 'example@email.com' } }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'PUT', + params: {}, + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + 'X-Zendesk-Marketplace-Name': 'RudderStack', + 'X-Zendesk-Marketplace-App-Id': '263241', + 'X-Zendesk-Marketplace-Organization-Id': '3339', + }, + version: '1', + endpoint: + 'https://rudderlabshelp.zendesk.com/api/v2/users/911113780483/identities/7534173321117', + userId: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + 'X-Zendesk-Marketplace-Name': 'RudderStack', + 'X-Zendesk-Marketplace-Organization-Id': '3339', + 'X-Zendesk-Marketplace-App-Id': '263241', + }, + params: {}, + body: { + JSON: { + user: { + email: 'example@email.com', + name: 'test-user-name', + external_id: 'test-user-id', + user_fields: { id: 'test-user-id' }, + verified: true, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'zendesk', + description: + 'scenario when searchByExternalId (Update user’s primary email) is true and there are no primary email', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: secret1, + createUsersAsVerified: true, + domain: 'rudderlabshelp', + email: 'myDummyUserName1', + password: 'myDummyPwd1', + removeUsersFromOrganization: true, + sendGroupCallsWithoutUserId: true, + searchByExternalId: true, + }, + DestinationDefinition: { + DisplayName: 'Zendesk', + ID: '1YknZ1ENqB8UurJQJE2VrEA61tr', + Name: 'ZENDESK', + }, + Enabled: true, + ID: 'xxxxxxxxxxxxxxxxxxxxxxxO51P', + Name: 'zendesk', + Transformations: [], + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.0-beta.2', + }, + ip: '0.0.0.0', + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.0-beta.2' }, + locale: 'en-GB', + os: { name: '', version: '' }, + screen: { density: 2 }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + }, + integrations: { All: true }, + messageId: '0bab70e8-bf2f-449a-a19b-ca6e3bfed9b7', + request_ip: '[::1]:51573', + type: 'identify', + userId: 'test-user-id-no-primary-email', + traits: { email: 'example@email.com', name: 'test-user-name' }, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + 'X-Zendesk-Marketplace-Name': 'RudderStack', + 'X-Zendesk-Marketplace-Organization-Id': '3339', + 'X-Zendesk-Marketplace-App-Id': '263241', + }, + params: {}, + body: { + JSON: { + user: { + email: 'example@email.com', + name: 'test-user-name', + external_id: 'test-user-id-no-primary-email', + user_fields: { id: 'test-user-id-no-primary-email' }, + verified: true, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'zendesk', + description: + 'scenario when searchByExternalId (Update user’s primary email) is true and primary email is same', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: secret1, + createUsersAsVerified: true, + domain: 'rudderlabshelp', + email: 'myDummyUserName1', + password: 'myDummyPwd1', + removeUsersFromOrganization: true, + sendGroupCallsWithoutUserId: true, + searchByExternalId: true, + }, + DestinationDefinition: { + DisplayName: 'Zendesk', + ID: '1YknZ1ENqB8UurJQJE2VrEA61tr', + Name: 'ZENDESK', + }, + Enabled: true, + ID: 'xxxxxxxxxxxxxxxxxxxxxxxO51P', + Name: 'zendesk', + Transformations: [], + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.0-beta.2', + }, + ip: '0.0.0.0', + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.0-beta.2' }, + locale: 'en-GB', + os: { name: '', version: '' }, + screen: { density: 2 }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + }, + integrations: { All: true }, + messageId: '0bab70e8-bf2f-449a-a19b-ca6e3bfed9b7', + request_ip: '[::1]:51573', + type: 'identify', + userId: 'test-user-id-with-same-primary-email', + traits: { email: 'example@email.com', name: 'test-user-name' }, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + 'X-Zendesk-Marketplace-Name': 'RudderStack', + 'X-Zendesk-Marketplace-Organization-Id': '3339', + 'X-Zendesk-Marketplace-App-Id': '263241', + }, + params: {}, + body: { + JSON: { + user: { + email: 'example@email.com', + name: 'test-user-name', + external_id: 'test-user-id-with-same-primary-email', + user_fields: { id: 'test-user-id-with-same-primary-email' }, + verified: true, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/zendesk/router/data.ts b/test/integrations/destinations/zendesk/router/data.ts index 4e7aacd1d1f..371b256b077 100644 --- a/test/integrations/destinations/zendesk/router/data.ts +++ b/test/integrations/destinations/zendesk/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'zendesk', @@ -12,7 +13,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -80,7 +81,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -110,7 +111,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -147,7 +148,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -220,7 +221,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/organization_memberships.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -246,7 +247,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -283,7 +284,7 @@ export const data = [ { destination: { Config: { - apiToken: 'dummyApiToken', + apiToken: secret2, createUsersAsVerified: true, domain: 'rudderlabtest2', email: 'rudderlabtest2@email.com', @@ -355,7 +356,7 @@ export const data = [ batched: false, destination: { Config: { - apiToken: 'dummyApiToken', + apiToken: secret2, createUsersAsVerified: true, domain: 'rudderlabtest2', email: 'rudderlabtest2@email.com', diff --git a/test/integrations/destinations/zoho/common.ts b/test/integrations/destinations/zoho/common.ts index 1d89dbce6d7..272040ce118 100644 --- a/test/integrations/destinations/zoho/common.ts +++ b/test/integrations/destinations/zoho/common.ts @@ -1,4 +1,4 @@ -import { Destination } from '../../../../src/types'; +import { Destination, Connection } from '../../../../src/types'; const destType = 'zoho'; const destTypeInUpperCase = 'ZOHO'; @@ -13,7 +13,7 @@ const deletionPayload1 = { externalId: [ { type: 'ZOHO-Leads', - identifierType: 'email', + identifierType: 'Email', }, ], mappedToDestination: 'true', @@ -34,6 +34,55 @@ const deletionPayload1 = { type: 'record', }; +const deletionPayload2 = { + action: 'delete', + context: { + externalId: [ + { + type: 'ZOHO-Contacts', + identifierType: 'Email', + }, + ], + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + Email: 'tobedeleted@gmail.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + type: 'record', +}; + +const deletionPayload1V2 = { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed', + Last_Name: ' User', + }, + identifiers: { + Email: 'tobedeleted@gmail.com', + }, + type: 'record', +}; + const commonDeletionDestConfig: Destination = { ID: '345', Name: 'Test', @@ -68,6 +117,65 @@ const commonDeletionDestConfig: Destination = { }, }; +const commonDeletionDestConfig2: Destination = { + ID: '345', + Name: 'Test', + Enabled: true, + WorkspaceID: '', + Transformations: [], + DestinationDefinition: { + ID: '345', + Name: 'Test', + DisplayName: 'ZOHO', + Config: { + cdkV2Enabled: true, + excludeKeys: [], + includeKeys: [], + }, + }, + Config: { + region: 'IN', + module: 'Contacts', + trigger: 'None', + addDefaultDuplicateCheck: true, + multiSelectFieldLevelDecision: [ + { + from: 'multi-language', + to: 'true', + }, + { + from: 'multi class', + to: 'false', + }, + ], + }, +}; + +const commonDeletionConnectionConfigV2: Connection = { + sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', + destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', + enabled: true, + processorEnabled: true, + config: { + destination: { + object: 'Leads', + trigger: 'None', + schemaVersion: '1.1', + identifierMappings: [ + { + from: 'email', + to: 'Email', + }, + ], + addDefaultDuplicateCheck: true, + multiSelectFieldLevelDecision: [ + { from: 'multi-language', to: 'true' }, + { from: 'multi class', to: 'false' }, + ], + }, + }, +}; + const upsertPayload1 = { action: 'insert', context: { @@ -95,6 +203,28 @@ const upsertPayload1 = { type: 'record', }; +const upsertPayload1V2 = { + action: 'insert', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed', + Last_Name: ' User', + }, + identifiers: { + Email: 'subscribed@eewrfrd.com', + }, + type: 'record', +}; + const upsertPayload2 = { action: 'insert', context: { @@ -123,6 +253,29 @@ const upsertPayload2 = { type: 'record', }; +const upsertPayload2V2 = { + action: 'insert', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed', + Last_Name: ' User', + 'multi-language': 'Bengali', + }, + identifiers: { + Email: 'subscribed@eewrfrd.com', + }, + type: 'record', +}; + const upsertPayload3 = { action: 'insert', context: { @@ -150,6 +303,28 @@ const upsertPayload3 = { type: 'record', }; +const upsertPayload3V2 = { + action: 'insert', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed', + Last_Name: ' User', + }, + identifiers: { + Email: 'subscribed@eewrfrd.com', + }, + type: 'record', +}; + const commonUpsertDestConfig: Destination = { ID: '345', Name: 'Test', @@ -289,6 +464,127 @@ const commonOutput1 = { trigger: ['workflow'], }; +const commonConnectionConfigV2: Connection = { + sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', + destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', + enabled: true, + processorEnabled: true, + config: { + destination: { + object: 'Leads', + trigger: 'workflow', + schemaVersion: '1.1', + addDefaultDuplicateCheck: true, + identifierMappings: [ + { + from: 'email', + to: 'email', + }, + ], + multiSelectFieldLevelDecision: [ + { from: 'multi-language', to: 'true' }, + { from: 'multi class', to: 'false' }, + ], + }, + }, +}; + +const commonConnectionConfigV2_2: Connection = { + sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', + destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', + enabled: true, + processorEnabled: true, + config: { + destination: { + object: 'Leads', + trigger: 'None', + schemaVersion: '1.1', + addDefaultDuplicateCheck: true, + identifierMappings: [ + { + from: 'email', + to: 'email', + }, + ], + multiSelectFieldLevelDecision: [ + { from: 'multi-language', to: 'true' }, + { from: 'multi class', to: 'false' }, + ], + }, + }, +}; + +const commonConnectionConfigCustomModuleV2: Connection = { + sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', + destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', + enabled: true, + processorEnabled: true, + config: { + destination: { + object: 'CUSTOM', + trigger: 'None', + schemaVersion: '1.1', + addDefaultDuplicateCheck: true, + identifierMappings: [ + { + from: 'email', + to: 'Email', + }, + ], + multiSelectFieldLevelDecision: [ + { from: 'multi-language', to: 'true' }, + { from: 'multi class', to: 'false' }, + ], + }, + }, +}; + +const commonConnectionConfigV2_3: Connection = { + sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', + destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', + enabled: true, + processorEnabled: true, + config: { + destination: { + object: 'Leads', + trigger: 'workflow', + schemaVersion: '1.1', + addDefaultDuplicateCheck: true, + identifierMappings: [ + { + from: 'email', + to: 'Email', + }, + ], + }, + }, +}; + +const commonConnectionConfigV2_4: Connection = { + sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', + destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', + enabled: true, + processorEnabled: true, + config: { + destination: { + object: 'Contacts', + trigger: 'None', + schemaVersion: '1.1', + addDefaultDuplicateCheck: true, + identifierMappings: [ + { + from: 'email', + to: 'email', + }, + ], + multiSelectFieldLevelDecision: [ + { from: 'multi-language', to: 'true' }, + { from: 'multi class', to: 'false' }, + ], + }, + }, +}; + export { destType, destTypeInUpperCase, @@ -297,13 +593,25 @@ export { segmentName, leadUpsertEndpoint, deletionPayload1, + deletionPayload2, + deletionPayload1V2, commonDeletionDestConfig, + commonDeletionDestConfig2, upsertPayload1, + upsertPayload1V2, upsertPayload2, + upsertPayload2V2, upsertPayload3, + upsertPayload3V2, commonUpsertDestConfig, commonUpsertDestConfig2, commonOutput1, commonUpsertDestConfig3, commonUpsertDestConfig2CustomModule, + commonConnectionConfigV2, + commonConnectionConfigV2_2, + commonConnectionConfigV2_3, + commonConnectionConfigV2_4, + commonConnectionConfigCustomModuleV2, + commonDeletionConnectionConfigV2, }; diff --git a/test/integrations/destinations/zoho/dataDelivery/business.ts b/test/integrations/destinations/zoho/dataDelivery/business.ts index 89c3ca214b1..003c8f3d538 100644 --- a/test/integrations/destinations/zoho/dataDelivery/business.ts +++ b/test/integrations/destinations/zoho/dataDelivery/business.ts @@ -1,5 +1,6 @@ import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; +import { defaultAccessToken } from '../../../common/secrets'; export const headerBlockWithCorrectAccessToken = { 'Content-Type': 'application/json', @@ -39,7 +40,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -51,7 +52,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -63,7 +64,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -78,7 +79,7 @@ export const singleMetadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -236,8 +237,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: - '{"code":"INVALID_MODULE","details":{"resource_path_index":0},"message":"the module name given seems to be invalid","status":"error"}', + error: JSON.stringify({ + code: 'INVALID_MODULE', + details: { resource_path_index: 0 }, + message: 'the module name given seems to be invalid', + status: 'error', + }), }, ], }, @@ -278,8 +283,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ authErrorCategory: 'REFRESH_TOKEN', response: [ { - error: - '{"code":"INVALID_TOKEN","details":{},"message":"invalid oauth token","status":"error"}', + error: JSON.stringify({ + code: 'INVALID_TOKEN', + details: {}, + message: 'invalid oauth token', + status: 'error', + }), statusCode: 500, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/zoho/network.ts b/test/integrations/destinations/zoho/network.ts index b37a56d1239..2324fb364dd 100644 --- a/test/integrations/destinations/zoho/network.ts +++ b/test/integrations/destinations/zoho/network.ts @@ -212,109 +212,106 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://www.zohoapis.in/crm/v6/Leads/search?criteria=(Email:equals:tobedeleted3%40gmail.com)and(First_Name:equals:subcribed3)and(Last_Name:equals:%20User3)', + url: 'https://www.zohoapis.in/crm/v6/coql', headers: { Authorization: 'Zoho-oauthtoken correct-access-token', }, - method: 'GET', + data: { + select_query: "SELECT id FROM Leads WHERE Email = 'tobedeleted@gmail.com'", + }, + method: 'POST', }, httpRes: { data: { - data: '', + data: [ + { + id: '', + }, + ], }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + url: 'https://www.zohoapis.in/crm/v6/coql', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + data: { + select_query: "SELECT id FROM Leads WHERE Email = 'tobedeleted2@gmail.com'", + }, + method: 'POST', + }, + httpRes: { + data: { + data: [ + { + id: '', + }, + ], + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + url: 'https://www.zohoapis.in/crm/v6/coql', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + data: { + select_query: "SELECT id FROM Leads WHERE Email = 'tobedeleted3@gmail.com'", + }, + method: 'POST', + }, + httpRes: { + data: '', status: 204, statusText: 'OK', }, }, { httpReq: { - url: 'https://www.zohoapis.in/crm/v6/Leads/search?criteria=(Email:equals:tobedeleted%40gmail.com)and(First_Name:equals:subcribed)and(Last_Name:equals:%20User)', + url: 'https://www.zohoapis.in/crm/v6/coql', + headers: { + Authorization: 'Zoho-oauthtoken expired-access-token', + }, + data: { + select_query: "SELECT id FROM Leads WHERE Email = 'tobedeleted3@gmail.com'", + }, + method: 'POST', + }, + httpRes: { + data: { + code: 'INVALID_TOKEN', + details: {}, + message: 'invalid oauth token', + status: 'error', + }, + status: 401, + statusText: 'Bad Request', + }, + }, + { + httpReq: { + url: 'https://www.zohoapis.in/crm/v6/coql', headers: { Authorization: 'Zoho-oauthtoken correct-access-token', }, - method: 'GET', + data: { + select_query: + "SELECT id FROM Leads WHERE ((Email = 'tobedeleted2@gmail.com' AND First_Name = 'subcribed2') AND Last_Name = ' User2')", + }, + method: 'POST', }, httpRes: { data: { data: [ { - Owner: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - Company: null, - Email: 'tobedeleted@gmail.com', - $currency_symbol: '$', - $field_states: null, - $sharing_permission: 'full_access', - Last_Activity_Time: '2024-07-18T23:55:42+05:30', - Industry: null, - Unsubscribed_Mode: null, - $process_flow: false, - Street: null, - Zip_Code: null, - id: '', - $approval: { - delegate: false, - approve: false, - reject: false, - resubmit: false, - }, - Created_Time: '2024-07-18T19:34:50+05:30', - $editable: true, - City: null, - No_of_Employees: null, - Converted_Account: null, - State: null, - Country: null, - Created_By: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - $zia_owner_assignment: 'owner_recommendation_unavailable', - Annual_Revenue: null, - Secondary_Email: null, - Description: null, - Rating: null, - $review_process: { - approve: false, - reject: false, - resubmit: false, - }, - Website: null, - Twitter: null, - Salutation: null, - First_Name: 'subcribed', - Full_Name: 'subcribed User', - Lead_Status: null, - Record_Image: null, - Modified_By: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - Converted_Deal: null, - $review: null, - Lead_Conversion_Time: null, - Skype_ID: null, - Phone: null, - Email_Opt_Out: false, - $zia_visions: null, - Designation: null, - Modified_Time: '2024-07-18T23:55:42+05:30', - $converted_detail: {}, - Unsubscribed_Time: null, - Converted_Contact: null, - Mobile: null, - $orchestration: null, - Last_Name: 'User', - $in_merge: false, - Lead_Source: null, - Fax: null, - $approval_state: 'approved', - $pathfinder: null, + id: '', }, ], }, @@ -324,93 +321,20 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://www.zohoapis.in/crm/v6/Leads/search?criteria=(Email:equals:tobedeleted2%40gmail.com)and(First_Name:equals:subcribed2)and(Last_Name:equals:%20User2)', + url: 'https://www.zohoapis.in/crm/v6/coql', headers: { Authorization: 'Zoho-oauthtoken correct-access-token', }, - method: 'GET', + data: { + select_query: "SELECT id FROM Contacts WHERE Email = 'tobedeleted2@gmail.com'", + }, + method: 'POST', }, httpRes: { data: { data: [ { - Owner: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - Company: null, - Email: 'tobedeleted2@gmail.com', - $currency_symbol: '$', - $field_states: null, - $sharing_permission: 'full_access', - Last_Activity_Time: '2024-07-18T23:55:42+05:30', - Industry: null, - Unsubscribed_Mode: null, - $process_flow: false, - Street: null, - Zip_Code: null, id: '', - $approval: { - delegate: false, - approve: false, - reject: false, - resubmit: false, - }, - Created_Time: '2024-07-18T19:34:50+05:30', - $editable: true, - City: null, - No_of_Employees: null, - Converted_Account: null, - State: null, - Country: null, - Created_By: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - $zia_owner_assignment: 'owner_recommendation_unavailable', - Annual_Revenue: null, - Secondary_Email: null, - Description: null, - Rating: null, - $review_process: { - approve: false, - reject: false, - resubmit: false, - }, - Website: null, - Twitter: null, - Salutation: null, - First_Name: 'subcribed2', - Full_Name: 'subcribed2 User', - Lead_Status: null, - Record_Image: null, - Modified_By: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - Converted_Deal: null, - $review: null, - Lead_Conversion_Time: null, - Skype_ID: null, - Phone: null, - Email_Opt_Out: false, - $zia_visions: null, - Designation: null, - Modified_Time: '2024-07-18T23:55:42+05:30', - $converted_detail: {}, - Unsubscribed_Time: null, - Converted_Contact: null, - Mobile: null, - $orchestration: null, - Last_Name: 'User2', - $in_merge: false, - Lead_Source: null, - Fax: null, - $approval_state: 'approved', - $pathfinder: null, }, ], }, diff --git a/test/integrations/destinations/zoho/router/deletion.ts b/test/integrations/destinations/zoho/router/deletion.ts index 5e922bc7944..50bd66a45a2 100644 --- a/test/integrations/destinations/zoho/router/deletion.ts +++ b/test/integrations/destinations/zoho/router/deletion.ts @@ -1,5 +1,13 @@ import { defaultMockFns } from '../mocks'; -import { commonDeletionDestConfig, deletionPayload1, destType } from '../common'; +import { + commonDeletionDestConfig, + commonDeletionDestConfig2, + deletionPayload1, + deletionPayload1V2, + commonDeletionConnectionConfigV2, + commonConnectionConfigV2_4, + destType, +} from '../common'; export const deleteData = [ { @@ -118,8 +126,8 @@ export const deleteData = [ }, { name: destType, - id: 'zoho_deletion_2', - description: 'Batch containing already existing and non existing records for deletion', + id: 'zoho_deletion_1', + description: 'Happy flow record deletion with Contacts module', feature: 'router', module: 'destination', version: 'v0', @@ -128,7 +136,195 @@ export const deleteData = [ body: { input: [ { - message: deletionPayload1, + message: { + action: 'delete', + context: { + externalId: [ + { + type: 'ZOHO-Contacts', + identifierType: 'Email', + }, + ], + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + Email: 'tobedeleted2@gmail.com', + First_Name: 'subcribed2', + Last_Name: ' User2', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'DELETE', + endpoint: + 'https://www.zohoapis.in/crm/v6/Contacts?ids=&wf_trigger=false', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonDeletionDestConfig2, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + id: 'zoho_deletion_1', + description: 'Happy flow record deletion with Contacts module V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + identifiers: { + Email: 'tobedeleted2@gmail.com', + }, + fields: { + First_Name: 'subcribed2', + Last_Name: ' User2', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig2, + connection: commonConnectionConfigV2_4, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'DELETE', + endpoint: + 'https://www.zohoapis.in/crm/v6/Contacts?ids=&wf_trigger=false', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonDeletionDestConfig2, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + id: 'zoho_deletion_1_v2', + description: 'Happy flow record deletion with Leads module V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: deletionPayload1V2, metadata: { jobId: 1, userId: 'u1', @@ -137,18 +333,12 @@ export const deleteData = [ }, }, destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, }, { message: { action: 'delete', context: { - externalId: [ - { - type: 'ZOHO-Leads', - identifierType: 'email', - }, - ], - mappedToDestination: 'true', sources: { job_run_id: 'cgiiurt8um7k7n5dq480', task_run_id: 'cgiiurt8um7k7n5dq48g', @@ -159,9 +349,11 @@ export const deleteData = [ recordId: '2', rudderId: '2', fields: { - Email: 'tobedeleted3@gmail.com', - First_Name: 'subcribed3', - Last_Name: ' User3', + First_Name: 'subcribed2', + Last_Name: ' User2', + }, + identifiers: { + Email: 'tobedeleted2@gmail.com', }, type: 'record', }, @@ -173,6 +365,7 @@ export const deleteData = [ }, }, destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, }, ], destType, @@ -190,7 +383,8 @@ export const deleteData = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://www.zohoapis.in/crm/v6/Leads?ids=&wf_trigger=false', + endpoint: + 'https://www.zohoapis.in/crm/v6/Leads?ids=,&wf_trigger=false', headers: { Authorization: 'Zoho-oauthtoken correct-access-token', }, @@ -211,11 +405,588 @@ export const deleteData = [ accessToken: 'correct-access-token', }, }, + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, ], batched: true, statusCode: 200, destination: commonDeletionDestConfig, }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + id: 'zoho_deletion_2', + description: 'Batch containing already existing and non existing records for deletion', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: deletionPayload1, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + }, + { + message: { + action: 'delete', + context: { + externalId: [ + { + type: 'ZOHO-Leads', + identifierType: 'Email', + }, + ], + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + Email: 'tobedeleted3@gmail.com', + First_Name: 'subcribed3', + Last_Name: ' User3', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'DELETE', + endpoint: 'https://www.zohoapis.in/crm/v6/Leads?ids=&wf_trigger=false', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonDeletionDestConfig, + }, + { + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: false, + statusCode: 400, + error: + 'failed to fetch zoho id for record for "No Leads is found with record details"', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'ZOHO', + module: 'destination', + implementation: 'cdkV2', + feature: 'router', + }, + destination: commonDeletionDestConfig, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + id: 'zoho_deletion_2_v2', + description: 'Batch containing already existing and non existing records for deletion V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: deletionPayload1V2, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, + }, + { + message: { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed3', + Last_Name: ' User3', + }, + identifiers: { + Email: 'tobedeleted3@gmail.com', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'DELETE', + endpoint: 'https://www.zohoapis.in/crm/v6/Leads?ids=&wf_trigger=false', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonDeletionDestConfig, + }, + { + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: false, + statusCode: 400, + error: + 'failed to fetch zoho id for record for "No Leads is found with record details"', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'ZOHO', + module: 'destination', + implementation: 'cdkV2', + feature: 'router', + }, + destination: commonDeletionDestConfig, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + id: 'zoho_deletion_2_v2', + description: 'Delete with invalid access token V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed3', + Last_Name: 'User3', + }, + identifiers: { + Email: 'tobedeleted3@gmail.com', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'expired-access-token', + }, + }, + destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + authErrorCategory: 'REFRESH_TOKEN', + statusCode: 500, + error: `{\"message\":\"[Zoho]:: {\\\"code\\\":\\\"INVALID_TOKEN\\\",\\\"details\\\":{},\\\"message\\\":\\\"invalid oauth token\\\",\\\"status\\\":\\\"error\\\"} during zoho record search\",\"destinationResponse\":{\"code\":\"INVALID_TOKEN\",\"details\":{},\"message\":\"invalid oauth token\",\"status\":\"error\"}}`, + destination: commonDeletionDestConfig, + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'expired-access-token', + }, + }, + ], + statTags: { + errorType: 'retryable', + errorCategory: 'network', + destType: 'ZOHO', + module: 'destination', + implementation: 'cdkV2', + feature: 'router', + }, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + id: 'zoho_deletion_2_v2', + description: 'Test empty identifier in deletion payload V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed3', + Last_Name: ' User3', + }, + identifiers: {}, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: false, + statusCode: 400, + error: '`identifiers` cannot be empty', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ZOHO', + module: 'destination', + implementation: 'cdkV2', + feature: 'router', + }, + destination: commonDeletionDestConfig, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + id: 'zoho_deletion_1_v2', + description: 'Instrumentation error when the identifiers are empty in the payload V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed2', + Last_Name: ' User2', + }, + identifiers: { + Email: '', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: false, + statusCode: 400, + error: + 'failed to fetch zoho id for record for "Identifier values are not provided for Leads"', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'ZOHO', + module: 'destination', + implementation: 'cdkV2', + feature: 'router', + }, + destination: commonDeletionDestConfig, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + id: 'zoho_deletion_2', + description: 'Instrumentation error when the identifiers are empty in the payload', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'delete', + context: { + externalId: [ + { + type: 'ZOHO-Leads', + identifierType: 'Email', + }, + ], + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + Email: '', + First_Name: 'subcribed3', + Last_Name: ' User3', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ { metadata: [ { @@ -229,7 +1000,7 @@ export const deleteData = [ batched: false, statusCode: 400, error: - 'failed to fetch zoho id for record for "No contact is found with record details"', + 'failed to fetch zoho id for record for "Identifier values are not provided for Leads"', statTags: { errorCategory: 'dataValidation', errorType: 'configuration', diff --git a/test/integrations/destinations/zoho/router/upsert.ts b/test/integrations/destinations/zoho/router/upsert.ts index a2b898970d4..1b5d584f7ab 100644 --- a/test/integrations/destinations/zoho/router/upsert.ts +++ b/test/integrations/destinations/zoho/router/upsert.ts @@ -2,13 +2,20 @@ import { defaultMockFns } from '../mocks'; import { commonOutput1, commonUpsertDestConfig, + commonConnectionConfigV2, + commonConnectionConfigV2_2, + commonConnectionConfigV2_3, + commonConnectionConfigCustomModuleV2, commonUpsertDestConfig2, commonUpsertDestConfig2CustomModule, commonUpsertDestConfig3, destType, upsertPayload1, + upsertPayload1V2, upsertPayload2, + upsertPayload2V2, upsertPayload3, + upsertPayload3V2, } from '../common'; export const upsertData = [ @@ -119,6 +126,115 @@ export const upsertData = [ }, mockFns: defaultMockFns, }, + { + name: destType, + description: 'Happy flow with Leads module V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: upsertPayload1V2, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig, + connection: commonConnectionConfigV2, + }, + { + message: upsertPayload2V2, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig, + connection: commonConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: { + duplicate_check_fields: ['email', 'Email'], + data: [ + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + 'multi-language': ['Bengali'], + }, + ], + $append_values: { + 'multi-language': 'true', + 'multi class': 'false', + }, + trigger: ['workflow'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, { name: destType, description: 'Happy flow with Trigger None', @@ -226,6 +342,115 @@ export const upsertData = [ }, mockFns: defaultMockFns, }, + { + name: destType, + description: 'Happy flow with Trigger None V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: upsertPayload1V2, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig2, + connection: commonConnectionConfigV2_2, + }, + { + message: upsertPayload2V2, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig2, + connection: commonConnectionConfigV2_2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: { + duplicate_check_fields: ['email', 'Email'], + data: [ + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + 'multi-language': ['Bengali'], + }, + ], + $append_values: { + 'multi-language': 'true', + 'multi class': 'false', + }, + trigger: [], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig2, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, { name: destType, description: 'Happy flow with custom Module', @@ -390,7 +615,7 @@ export const upsertData = [ }, { name: destType, - description: 'If module specific mandatory field is absent, event will fail', + description: 'Happy flow with custom Module V2', feature: 'router', module: 'destination', version: 'v0', @@ -402,12 +627,6 @@ export const upsertData = [ message: { action: 'insert', context: { - externalId: [ - { - type: 'ZOHO-Leads', - identifierType: 'Email', - }, - ], mappedToDestination: 'true', sources: { job_run_id: 'cgiiurt8um7k7n5dq480', @@ -419,9 +638,12 @@ export const upsertData = [ recordId: '2', rudderId: '2', fields: { - Email: 'subscribed@eewrfrd.com', First_Name: 'subcribed', Last_Name: ' User', + Name: 'ABC', + }, + identifiers: { + Email: 'subscribed@eewrfrd.com', }, type: 'record', }, @@ -432,18 +654,13 @@ export const upsertData = [ accessToken: 'correct-access-token', }, }, - destination: commonUpsertDestConfig, + destination: commonUpsertDestConfig2CustomModule, + connection: commonConnectionConfigCustomModuleV2, }, { message: { action: 'insert', context: { - externalId: [ - { - type: 'ZOHO-Leads', - identifierType: 'Email', - }, - ], mappedToDestination: 'true', sources: { job_run_id: 'cgiiurt8um7k7n5dq480', @@ -455,7 +672,13 @@ export const upsertData = [ recordId: '2', rudderId: '2', fields: { + First_Name: 'subcribed', + Last_Name: ' User', 'multi-language': 'Bengali', + Name: 'ABC', + }, + identifiers: { + Email: 'subscribed@eewrfrd.com', }, type: 'record', }, @@ -466,7 +689,8 @@ export const upsertData = [ accessToken: 'correct-access-token', }, }, - destination: commonUpsertDestConfig, + destination: commonUpsertDestConfig2, + connection: commonConnectionConfigCustomModuleV2, }, ], destType, @@ -484,26 +708,34 @@ export const upsertData = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + endpoint: 'https://www.zohoapis.com/crm/v6/CUSTOM/upsert', headers: { Authorization: 'Zoho-oauthtoken correct-access-token', }, params: {}, body: { JSON: { - duplicate_check_fields: ['Email'], + duplicate_check_fields: ['Email', 'Name'], data: [ { Email: 'subscribed@eewrfrd.com', First_Name: 'subcribed', Last_Name: ' User', + Name: 'ABC', + }, + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + 'multi-language': ['Bengali'], + Name: 'ABC', }, ], $append_values: { 'multi-language': 'true', 'multi class': 'false', }, - trigger: ['workflow'], + trigger: [], }, JSON_ARRAY: {}, XML: {}, @@ -511,7 +743,6 @@ export const upsertData = [ }, files: {}, }, - metadata: [ { jobId: 1, @@ -520,13 +751,324 @@ export const upsertData = [ accessToken: 'correct-access-token', }, }, - ], - batched: true, - statusCode: 200, - destination: commonUpsertDestConfig, - }, - { - metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig2CustomModule, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + description: 'If module specific mandatory field is absent, event will fail', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'insert', + context: { + externalId: [ + { + type: 'ZOHO-Leads', + identifierType: 'Email', + }, + ], + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + type: 'record', + }, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig, + }, + { + message: { + action: 'insert', + context: { + externalId: [ + { + type: 'ZOHO-Leads', + identifierType: 'Email', + }, + ], + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + 'multi-language': 'Bengali', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: { + duplicate_check_fields: ['Email'], + data: [ + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + ], + $append_values: { + 'multi-language': 'true', + 'multi class': 'false', + }, + trigger: ['workflow'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig, + }, + { + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: false, + statusCode: 400, + error: 'Leads object must have the Last_Name property(ies).', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'ZOHO', + module: 'destination', + implementation: 'cdkV2', + feature: 'router', + }, + destination: commonUpsertDestConfig, + }, + ], + }, + }, + }, + }, + { + name: destType, + description: 'If module specific mandatory field is absent, event will fail V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'insert', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed', + Last_Name: ' User', + }, + type: 'record', + identifiers: { + Email: 'subscribed@eewrfrd.com', + }, + }, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig, + connection: commonConnectionConfigV2, + }, + { + message: { + action: 'insert', + context: { + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + 'multi-language': 'Bengali', + First_Name: 'subcribed', + Last_Name: null, + }, + identifiers: { + email: 'subscribed@eewrfrd.com', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig, + connection: commonConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: { + duplicate_check_fields: ['email', 'Email'], + data: [ + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + ], + $append_values: { + 'multi-language': 'true', + 'multi class': 'false', + }, + trigger: ['workflow'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig, + }, + { + metadata: [ { jobId: 2, userId: 'u1', @@ -546,17 +1088,87 @@ export const upsertData = [ implementation: 'cdkV2', feature: 'router', }, - destination: commonUpsertDestConfig, + destination: commonUpsertDestConfig, + }, + ], + }, + }, + }, + }, + { + name: destType, + description: + 'If multiselect key decision is not set from UI, Rudderstack will consider those as normal fields', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: upsertPayload3, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig3, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: commonOutput1, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig3, }, ], }, }, }, + mockFns: defaultMockFns, }, { name: destType, description: - 'If multiselect key decision is not set from UI, Rudderstack will consider those as normal fields', + 'If multiselect key decision is not set from UI, Rudderstack will consider those as normal fields V2', feature: 'router', module: 'destination', version: 'v0', @@ -565,7 +1177,7 @@ export const upsertData = [ body: { input: [ { - message: upsertPayload3, + message: upsertPayload3V2, metadata: { jobId: 1, userId: 'u1', @@ -574,6 +1186,7 @@ export const upsertData = [ }, }, destination: commonUpsertDestConfig3, + connection: commonConnectionConfigV2_3, }, ], destType, @@ -768,4 +1381,249 @@ export const upsertData = [ }, mockFns: defaultMockFns, }, + { + name: destType, + description: 'Test Batching V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: upsertPayload3V2, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig3, + connection: commonConnectionConfigV2_3, + }, + { + message: upsertPayload3V2, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig3, + connection: commonConnectionConfigV2_3, + }, + { + message: upsertPayload3V2, + metadata: { + jobId: 3, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig3, + connection: commonConnectionConfigV2_3, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: { + duplicate_check_fields: ['Email'], + data: [ + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + ], + $append_values: {}, + trigger: ['workflow'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig3, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: commonOutput1, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 3, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig3, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + description: 'Test fields can be empty V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: upsertPayload3V2, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig3, + connection: commonConnectionConfigV2_3, + }, + { + message: { + action: 'insert', + context: {}, + fields: {}, + identifiers: {}, + type: 'record', + }, + metadata: {}, + destination: commonUpsertDestConfig, + connection: commonConnectionConfigV2_3, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: commonOutput1, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig3, + }, + { + batched: false, + destination: commonUpsertDestConfig, + error: '`fields` cannot be empty', + metadata: [{}], + statTags: { + destType: 'ZOHO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, ]; diff --git a/test/integrations/sources/adjust/data.ts b/test/integrations/sources/adjust/data.ts index 107bb444c43..bb81450e9d5 100644 --- a/test/integrations/sources/adjust/data.ts +++ b/test/integrations/sources/adjust/data.ts @@ -10,29 +10,32 @@ export const data = [ name: 'adjust', description: 'Simple track call', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - id: 'adjust', - query_parameters: { - gps_adid: ['38400000-8cf0-11bd-b23e-10b96e40000d'], - adid: ['18546f6171f67e29d1cb983322ad1329'], - tracker_token: ['abc'], - custom: ['custom'], - tracker_name: ['dummy'], - created_at: ['1404214665'], - event_name: ['Click'], + request: { + body: JSON.stringify({ + id: 'adjust', + updated_at: '2023-02-10T12:16:07.251Z', + created_at: '2023-02-10T12:05:04.402Z', + }), + query_parameters: { + gps_adid: ['38400000-8cf0-11bd-b23e-10b96e40000d'], + adid: ['18546f6171f67e29d1cb983322ad1329'], + tracker_token: ['abc'], + custom: ['custom'], + tracker_name: ['dummy'], + created_at: ['1404214665'], + event_name: ['Click'], + }, }, - updated_at: '2023-02-10T12:16:07.251Z', - created_at: '2023-02-10T12:05:04.402Z', + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -46,20 +49,11 @@ export const data = [ { anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'Adjust', - }, - device: { - 'id ': '18546f6171f67e29d1cb983322ad1329', - }, - }, - integrations: { - Adjust: false, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Adjust' }, + device: { 'id ': '18546f6171f67e29d1cb983322ad1329' }, }, + integrations: { Adjust: false }, type: 'track', event: 'Click', originalTimestamp: '2014-07-01T11:37:45.000Z', @@ -85,21 +79,25 @@ export const data = [ name: 'adjust', description: 'Simple track call with no query parameters', module: 'source', - version: 'v0', + version: 'v2', skipGo: 'FIXME', input: { request: { body: [ { - id: 'adjust', - updated_at: '2023-02-10T12:16:07.251Z', - created_at: '2023-02-10T12:05:04.402Z', + request: { + body: JSON.stringify({ + id: 'adjust', + updated_at: '2023-02-10T12:16:07.251Z', + created_at: '2023-02-10T12:05:04.402Z', + }), + query_parameters: undefined, + }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -114,6 +112,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'adjust', workspaceId: 'Non determinable', }, statusCode: 400, @@ -129,30 +128,33 @@ export const data = [ name: 'adjust', description: 'Simple track call with wrong created at', module: 'source', - version: 'v0', + version: 'v2', skipGo: 'FIXME', input: { request: { body: [ { - id: 'adjust', - query_parameters: { - gps_adid: ['38400000-8cf0-11bd-b23e-10b96e40000d'], - adid: ['18546f6171f67e29d1cb983322ad1329'], - tracker_token: ['abc'], - custom: ['custom'], - tracker_name: ['dummy'], - created_at: ['test'], - event_name: ['Click'], + request: { + body: JSON.stringify({ + id: 'adjust', + updated_at: '2023-02-10T12:16:07.251Z', + created_at: 'test', + }), + query_parameters: { + gps_adid: ['38400000-8cf0-11bd-b23e-10b96e40000d'], + adid: ['18546f6171f67e29d1cb983322ad1329'], + tracker_token: ['abc'], + custom: ['custom'], + tracker_name: ['dummy'], + created_at: ['test'], + event_name: ['Click'], + }, }, - updated_at: '2023-02-10T12:16:07.251Z', - created_at: 'test', + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -167,6 +169,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'adjust', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/appcenter/data.ts b/test/integrations/sources/appcenter/data.ts index 0342b622d2a..79f1b8ef7b4 100644 --- a/test/integrations/sources/appcenter/data.ts +++ b/test/integrations/sources/appcenter/data.ts @@ -5,14 +5,19 @@ export const data = [ name: 'appcenter', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -39,26 +44,31 @@ export const data = [ name: 'appcenter', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -117,26 +127,31 @@ export const data = [ name: 'appcenter', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -195,34 +210,39 @@ export const data = [ name: 'appcenter', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -292,27 +312,32 @@ export const data = [ name: 'appcenter', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/appsflyer/data.ts b/test/integrations/sources/appsflyer/data.ts index 5ec64a07a87..7f84fc0577f 100644 --- a/test/integrations/sources/appsflyer/data.ts +++ b/test/integrations/sources/appsflyer/data.ts @@ -9,123 +9,128 @@ export const data = [ name: 'appsflyer', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -160,10 +165,19 @@ export const data = [ network: { wifi: true }, os: { name: 'ios', version: '12.3.1' }, traits: { - address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, userId: 'hi.from@appsflyer.example.com', }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, properties: { @@ -267,7 +281,13 @@ export const data = [ 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' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -281,123 +301,128 @@ export const data = [ name: 'appsflyer', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -432,10 +457,19 @@ export const data = [ network: { wifi: true }, os: { name: 'android', version: '12.3.1' }, traits: { - address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, userId: 'hi.from@appsflyer.example.com', }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, properties: { @@ -539,7 +573,13 @@ export const data = [ 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' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -553,122 +593,127 @@ export const data = [ name: 'appsflyer', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -687,6 +732,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'appsflyer', workspaceId: 'Non determinable', }, statusCode: 400, @@ -699,122 +745,127 @@ export const data = [ name: 'appsflyer', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -848,8 +899,19 @@ export const data = [ }, 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' }], + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, type: 'track', @@ -952,7 +1014,13 @@ export const data = [ 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' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -966,122 +1034,127 @@ export const data = [ name: 'appsflyer', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -1115,10 +1188,19 @@ export const data = [ network: { wifi: true }, os: { name: 'ios', version: '12.3.1' }, traits: { - address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, userId: 'hi.from@appsflyer.example.com', }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, properties: { @@ -1222,7 +1304,13 @@ export const data = [ 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' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -1236,122 +1324,127 @@ export const data = [ name: 'appsflyer', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -1385,10 +1478,19 @@ export const data = [ network: { wifi: true }, os: { name: 'watchos', version: '12.3.1' }, traits: { - address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, userId: 'hi.from@appsflyer.example.com', }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, properties: { @@ -1492,7 +1594,13 @@ export const data = [ 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' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -1506,122 +1614,127 @@ export const data = [ name: 'appsflyer', description: 'test-6', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -1655,10 +1768,19 @@ export const data = [ network: { wifi: true }, os: { name: 'ipados', version: '12.3.1' }, traits: { - address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, userId: 'hi.from@appsflyer.example.com', }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, properties: { @@ -1762,7 +1884,13 @@ export const data = [ 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' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -1776,122 +1904,127 @@ export const data = [ name: 'appsflyer', description: 'test-7', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -1925,10 +2058,19 @@ export const data = [ network: { wifi: true }, os: { name: 'tvos', version: '12.3.1' }, traits: { - address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, userId: 'hi.from@appsflyer.example.com', }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, properties: { @@ -2032,7 +2174,13 @@ export const data = [ 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' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], diff --git a/test/integrations/sources/auth0/data.ts b/test/integrations/sources/auth0/data.ts index b012887bc43..0772311d81a 100644 --- a/test/integrations/sources/auth0/data.ts +++ b/test/integrations/sources/auth0/data.ts @@ -9,240 +9,116 @@ export const data = [ name: 'auth0', description: 'successful signup', module: 'source', - version: 'v0', - + version: 'v2', input: { request: { body: [ { - log_id: '90020221031055712103169676686005480714681762668315934738', - data: { - date: '2022-10-31T05:57:06.859Z', - type: 'ss', - description: '', - connection: 'Username-Password-Authentication', - connection_id: 'con_djwCjiwyID0vZy1S', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: 'All Applications', - ip: '35.166.202.113', - user_agent: 'unknown', - details: { - body: { - email: 'testRudderlabs+21@gmail.com', - tenant: 'dev-cu4jy2zgao6yx15x', - password: 'dummyPassword', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + request: { + body: JSON.stringify({ + log_id: '90020221031055712103169676686005480714681762668315934738', + data: { + date: '2022-10-31T05:57:06.859Z', + type: 'ss', + description: '', connection: 'Username-Password-Authentication', + connection_id: 'con_djwCjiwyID0vZy1S', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: 'All Applications', + ip: '35.166.202.113', + user_agent: 'unknown', + details: { + body: { + email: 'testRudderlabs+21@gmail.com', + tenant: 'dev-cu4jy2zgao6yx15x', + password: 'dummyPassword', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + connection: 'Username-Password-Authentication', + }, + }, + user_id: 'auth0|dummyPassword', + user_name: 'testRudderlabs+21@gmail.com', + strategy: 'auth0', + strategy_type: 'database', + log_id: '90020221031055712103169676686005480714681762668315934738', }, - }, - user_id: 'auth0|dummyPassword', - user_name: 'testRudderlabs+21@gmail.com', - strategy: 'auth0', - strategy_type: 'database', - log_id: '90020221031055712103169676686005480714681762668315934738', + }), }, + source: {}, }, { - log_id: '90020221031055712103169676686007898566320991926665347090', - data: { - date: '2022-10-31T05:57:06.874Z', - type: 'sapi', - description: 'Create a User', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: '', - ip: '35.166.202.113', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', - details: { - request: { + request: { + body: JSON.stringify({ + log_id: '90020221031055712103169676686007898566320991926665347090', + data: { + date: '2022-10-31T05:57:06.874Z', + type: 'sapi', + description: 'Create a User', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: '', ip: '35.166.202.113', - auth: { - user: { - name: 'rudder test', - email: 'test@rudderstack.com', - user_id: 'auth0|dummyPassword', - }, - strategy: 'jwt', - credentials: { - jti: '571921bf7833a97efabf08d765a0ec8f', - scopes: [ - 'create:actions', - 'create:actions_log_sessions', - 'create:client_credentials', - 'create:client_grants', - 'create:clients', - 'create:connections', - 'create:custom_domains', - 'create:email_provider', - 'create:email_templates', - 'create:guardian_enrollment_tickets', - 'create:integrations', - 'create:log_streams', - 'create:organization_connections', - 'create:organization_invitations', - 'create:organization_member_roles', - 'create:organization_members', - 'create:organizations', - 'create:requested_scopes', - 'create:resource_servers', - 'create:roles', - 'create:rules', - 'create:shields', - 'create:signing_keys', - 'create:tenant_invitations', - 'create:test_email_dispatch', - 'create:users', - 'delete:actions', - 'delete:anomaly_blocks', - 'delete:branding', - 'delete:client_credentials', - 'delete:client_grants', - 'delete:clients', - 'delete:connections', - 'delete:custom_domains', - 'delete:device_credentials', - 'delete:email_provider', - 'delete:email_templates', - 'delete:grants', - 'delete:guardian_enrollments', - 'delete:integrations', - 'delete:log_streams', - 'delete:organization_connections', - 'delete:organization_invitations', - 'delete:organization_member_roles', - 'delete:organization_members', - 'delete:organizations', - 'delete:owners', - 'delete:requested_scopes', - 'delete:resource_servers', - 'delete:roles', - 'delete:rules', - 'delete:rules_configs', - 'delete:shields', - 'delete:tenant_invitations', - 'delete:tenant_members', - 'delete:tenants', - 'delete:users', - 'read:actions', - 'read:anomaly_blocks', - 'read:attack_protection', - 'read:branding', - 'read:checks', - 'read:client_credentials', - 'read:client_grants', - 'read:client_keys', - 'read:clients', - 'read:connections', - 'read:custom_domains', - 'read:device_credentials', - 'read:email_provider', - 'read:email_templates', - 'read:email_triggers', - 'read:entity_counts', - 'read:grants', - 'read:guardian_factors', - 'read:insights', - 'read:integrations', - 'read:log_streams', - 'read:logs', - 'read:mfa_policies', - 'read:organization_connections', - 'read:organization_invitations', - 'read:organization_member_roles', - 'read:organization_members', - 'read:organizations', - 'read:prompts', - 'read:requested_scopes', - 'read:resource_servers', - 'read:roles', - 'read:rules', - 'read:rules_configs', - 'read:shields', - 'read:signing_keys', - 'read:stats', - 'read:tenant_invitations', - 'read:tenant_members', - 'read:tenant_settings', - 'read:triggers', - 'read:users', - 'run:checks', - 'update:actions', - 'update:attack_protection', - 'update:branding', - 'update:client_credentials', - 'update:client_grants', - 'update:client_keys', - 'update:clients', - 'update:connections', - 'update:custom_domains', - 'update:email_provider', - 'update:email_templates', - 'update:email_triggers', - 'update:guardian_factors', - 'update:integrations', - 'update:log_streams', - 'update:mfa_policies', - 'update:organization_connections', - 'update:organizations', - 'update:prompts', - 'update:requested_scopes', - 'update:resource_servers', - 'update:roles', - 'update:rules', - 'update:rules_configs', - 'update:shields', - 'update:signing_keys', - 'update:tenant_members', - 'update:tenant_settings', - 'update:triggers', - 'update:users', - ], - }, - }, - body: { - email: 'testRudderlabs+21@gmail.com', - password: 'dummyPassword', - connection: 'Username-Password-Authentication', - }, - path: '/api/v2/users', - query: {}, - method: 'post', - channel: 'https://manage.auth0.com/', - userAgent: + user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', - }, - response: { - body: { - name: 'testRudderlabs+21@gmail.com', - email: 'testRudderlabs+21@gmail.com', - picture: - 'https://s.gravatar.com/avatar/0902f9d02b92aed9f0ac59aaf9475b60?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fbh.png', - user_id: 'auth0|dummyPassword', - nickname: 'testRudderlabs+21', - created_at: '2022-10-31T05:57:06.864Z', - identities: [ - { - user_id: 'auth0|dummyPassword', - isSocial: false, - provider: 'auth0', + details: { + request: { + ip: '35.166.202.113', + auth: { + user: { + name: 'rudder test', + email: 'test@rudderstack.com', + user_id: 'auth0|dummyPassword', + }, + strategy: 'jwt', + credentials: { + jti: '571921bf7833a97efabf08d765a0ec8f', + scopes: ['create:actions'], + }, + }, + body: { + email: 'testRudderlabs+21@gmail.com', + password: 'dummyPassword', connection: 'Username-Password-Authentication', }, - ], - updated_at: '2022-10-31T05:57:06.864Z', - email_verified: false, + path: '/api/v2/users', + query: {}, + method: 'post', + channel: 'https://manage.auth0.com/', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + }, + response: { + body: { + name: 'testRudderlabs+21@gmail.com', + email: 'testRudderlabs+21@gmail.com', + picture: + 'https://s.gravatar.com/avatar/0902f9d02b92aed9f0ac59aaf9475b60?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fbh.png', + user_id: 'auth0|dummyPassword', + nickname: 'testRudderlabs+21', + created_at: '2022-10-31T05:57:06.864Z', + identities: [ + { + user_id: 'auth0|dummyPassword', + isSocial: false, + provider: 'auth0', + connection: 'Username-Password-Authentication', + }, + ], + updated_at: '2022-10-31T05:57:06.864Z', + email_verified: false, + }, + statusCode: 201, + }, }, - statusCode: 201, + user_id: 'auth0|dummyPassword', + log_id: '90020221031055712103169676686007898566320991926665347090', }, - }, - user_id: 'auth0|dummyPassword', - log_id: '90020221031055712103169676686007898566320991926665347090', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -267,15 +143,10 @@ export const data = [ userId: 'auth0|dummyPassword', user_name: 'testRudderlabs+21@gmail.com', }, - library: { - name: 'unknown', - version: 'unknown', - }, + library: { name: 'unknown', version: 'unknown' }, userAgent: 'unknown', request_ip: '35.166.202.113', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031055712103169676686005480714681762668315934738', @@ -293,9 +164,7 @@ export const data = [ description: '', source_type: 'ss', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T05:57:06.859Z', }, ], @@ -311,19 +180,12 @@ export const data = [ userId: 'auth0|dummyPassword', anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - library: { - name: 'unknown', - version: 'unknown', - }, - traits: { - userId: 'auth0|dummyPassword', - }, + library: { name: 'unknown', version: 'unknown' }, + traits: { userId: 'auth0|dummyPassword' }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', request_ip: '35.166.202.113', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031055712103169676686007898566320991926665347090', @@ -339,138 +201,7 @@ export const data = [ strategy: 'jwt', credentials: { jti: '571921bf7833a97efabf08d765a0ec8f', - scopes: [ - 'create:actions', - 'create:actions_log_sessions', - 'create:client_credentials', - 'create:client_grants', - 'create:clients', - 'create:connections', - 'create:custom_domains', - 'create:email_provider', - 'create:email_templates', - 'create:guardian_enrollment_tickets', - 'create:integrations', - 'create:log_streams', - 'create:organization_connections', - 'create:organization_invitations', - 'create:organization_member_roles', - 'create:organization_members', - 'create:organizations', - 'create:requested_scopes', - 'create:resource_servers', - 'create:roles', - 'create:rules', - 'create:shields', - 'create:signing_keys', - 'create:tenant_invitations', - 'create:test_email_dispatch', - 'create:users', - 'delete:actions', - 'delete:anomaly_blocks', - 'delete:branding', - 'delete:client_credentials', - 'delete:client_grants', - 'delete:clients', - 'delete:connections', - 'delete:custom_domains', - 'delete:device_credentials', - 'delete:email_provider', - 'delete:email_templates', - 'delete:grants', - 'delete:guardian_enrollments', - 'delete:integrations', - 'delete:log_streams', - 'delete:organization_connections', - 'delete:organization_invitations', - 'delete:organization_member_roles', - 'delete:organization_members', - 'delete:organizations', - 'delete:owners', - 'delete:requested_scopes', - 'delete:resource_servers', - 'delete:roles', - 'delete:rules', - 'delete:rules_configs', - 'delete:shields', - 'delete:tenant_invitations', - 'delete:tenant_members', - 'delete:tenants', - 'delete:users', - 'read:actions', - 'read:anomaly_blocks', - 'read:attack_protection', - 'read:branding', - 'read:checks', - 'read:client_credentials', - 'read:client_grants', - 'read:client_keys', - 'read:clients', - 'read:connections', - 'read:custom_domains', - 'read:device_credentials', - 'read:email_provider', - 'read:email_templates', - 'read:email_triggers', - 'read:entity_counts', - 'read:grants', - 'read:guardian_factors', - 'read:insights', - 'read:integrations', - 'read:log_streams', - 'read:logs', - 'read:mfa_policies', - 'read:organization_connections', - 'read:organization_invitations', - 'read:organization_member_roles', - 'read:organization_members', - 'read:organizations', - 'read:prompts', - 'read:requested_scopes', - 'read:resource_servers', - 'read:roles', - 'read:rules', - 'read:rules_configs', - 'read:shields', - 'read:signing_keys', - 'read:stats', - 'read:tenant_invitations', - 'read:tenant_members', - 'read:tenant_settings', - 'read:triggers', - 'read:users', - 'run:checks', - 'update:actions', - 'update:attack_protection', - 'update:branding', - 'update:client_credentials', - 'update:client_grants', - 'update:client_keys', - 'update:clients', - 'update:connections', - 'update:custom_domains', - 'update:email_provider', - 'update:email_templates', - 'update:email_triggers', - 'update:guardian_factors', - 'update:integrations', - 'update:log_streams', - 'update:mfa_policies', - 'update:organization_connections', - 'update:organizations', - 'update:prompts', - 'update:requested_scopes', - 'update:resource_servers', - 'update:roles', - 'update:rules', - 'update:rules_configs', - 'update:shields', - 'update:signing_keys', - 'update:tenant_members', - 'update:tenant_settings', - 'update:triggers', - 'update:users', - ], + scopes: ['create:actions'], }, }, body: { @@ -513,9 +244,7 @@ export const data = [ description: 'Create a User', source_type: 'sapi', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T05:57:06.874Z', }, ], @@ -524,68 +253,60 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'auth0', description: 'add member to an organization', module: 'source', - version: 'v0', - + version: 'v2', input: { request: { body: [ { - log_id: '90020221031061004280169676882609459981150114445973782546', - data: { - date: '2022-10-31T06:09:59.135Z', - type: 'sapi', - description: 'Add members to an organization', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: '', - ip: '35.167.74.121', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', - details: { - request: { + request: { + body: JSON.stringify({ + log_id: '90020221031061004280169676882609459981150114445973782546', + data: { + date: '2022-10-31T06:09:59.135Z', + type: 'sapi', + description: 'Add members to an organization', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: '', ip: '35.167.74.121', - auth: { - user: { - name: 'rudder test', - email: 'test@rudderstack.com', - user_id: 'google-oauth2|123456', - }, - strategy: 'jwt', - credentials: { - jti: '571921bf7833a97efabf08d765a0ec8f', - }, - }, - body: { - members: ['auth0|123456'], - }, - path: '/api/v2/organizations/org_eoe8p2atZ7furBxg/members', - query: {}, - method: 'post', - channel: 'https://manage.auth0.com/', - userAgent: + user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + details: { + request: { + ip: '35.167.74.121', + auth: { + user: { + name: 'rudder test', + email: 'test@rudderstack.com', + user_id: 'google-oauth2|123456', + }, + strategy: 'jwt', + credentials: { jti: '571921bf7833a97efabf08d765a0ec8f' }, + }, + body: { members: ['auth0|123456'] }, + path: '/api/v2/organizations/org_eoe8p2atZ7furBxg/members', + query: {}, + method: 'post', + channel: 'https://manage.auth0.com/', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + }, + response: { body: {}, statusCode: 204 }, + }, + user_id: 'google-oauth2|123456', + log_id: '90020221031061004280169676882609459981150114445973782546', }, - response: { - body: {}, - statusCode: 204, - }, - }, - user_id: 'google-oauth2|123456', - log_id: '90020221031061004280169676882609459981150114445973782546', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -602,19 +323,12 @@ export const data = [ userId: 'google-oauth2|123456', anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - library: { - name: 'unknown', - version: 'unknown', - }, - traits: { - userId: 'google-oauth2|123456', - }, + library: { name: 'unknown', version: 'unknown' }, + traits: { userId: 'google-oauth2|123456' }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', request_ip: '35.167.74.121', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, groupId: 'org_eoe8p2atZ7furBxg', properties: { @@ -629,13 +343,9 @@ export const data = [ user_id: 'google-oauth2|123456', }, strategy: 'jwt', - credentials: { - jti: '571921bf7833a97efabf08d765a0ec8f', - }, - }, - body: { - members: ['auth0|123456'], + credentials: { jti: '571921bf7833a97efabf08d765a0ec8f' }, }, + body: { members: ['auth0|123456'] }, path: '/api/v2/organizations/org_eoe8p2atZ7furBxg/members', query: {}, method: 'post', @@ -643,19 +353,14 @@ export const data = [ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', }, - response: { - body: {}, - statusCode: 204, - }, + response: { body: {}, statusCode: 204 }, }, client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', client_name: '', description: 'Add members to an organization', source_type: 'sapi', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T06:09:59.135Z', }, ], @@ -664,272 +369,132 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'auth0', description: 'update tenant settings', module: 'source', - version: 'v0', - + version: 'v2', input: { request: { body: [ { - log_id: '90020221031061527239169676960191065529099349299958906898', - data: { - date: '2022-10-31T06:15:25.201Z', - type: 'sapi', - description: 'Update tenant settings', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: '', - ip: '35.160.3.103', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', - details: { - request: { + request: { + body: JSON.stringify({ + log_id: '90020221031061527239169676960191065529099349299958906898', + data: { + date: '2022-10-31T06:15:25.201Z', + type: 'sapi', + description: 'Update tenant settings', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: '', ip: '35.160.3.103', - auth: { - user: { - name: 'rudder test', - email: 'test@rudderstack.com', - user_id: 'google-oauth2|123456', - }, - strategy: 'jwt', - credentials: { - jti: '571921bf7833a97efabf08d765a0ec8f', - scopes: [ - 'create:actions', - 'create:actions_log_sessions', - 'create:client_credentials', - 'create:client_grants', - 'create:clients', - 'create:connections', - 'create:custom_domains', - 'create:email_provider', - 'create:email_templates', - 'create:guardian_enrollment_tickets', - 'create:integrations', - 'create:log_streams', - 'create:organization_connections', - 'create:organization_invitations', - 'create:organization_member_roles', - 'create:organization_members', - 'create:organizations', - 'create:requested_scopes', - 'create:resource_servers', - 'create:roles', - 'create:rules', - 'create:shields', - 'create:signing_keys', - 'create:tenant_invitations', - 'create:test_email_dispatch', - 'create:users', - 'delete:actions', - 'delete:anomaly_blocks', - 'delete:branding', - 'delete:client_credentials', - 'delete:client_grants', - 'delete:clients', - 'delete:connections', - 'delete:custom_domains', - 'delete:device_credentials', - 'delete:email_provider', - 'delete:email_templates', - 'delete:grants', - 'delete:guardian_enrollments', - 'delete:integrations', - 'delete:log_streams', - 'delete:organization_connections', - 'delete:organization_invitations', - 'delete:organization_member_roles', - 'delete:organization_members', - 'delete:organizations', - 'delete:owners', - 'delete:requested_scopes', - 'delete:resource_servers', - 'delete:roles', - 'delete:rules', - 'delete:rules_configs', - 'delete:shields', - 'delete:tenant_invitations', - 'delete:tenant_members', - 'delete:tenants', - 'delete:users', - 'read:actions', - 'read:anomaly_blocks', - 'read:attack_protection', - 'read:branding', - 'read:checks', - 'read:client_credentials', - 'read:client_grants', - 'read:client_keys', - 'read:clients', - 'read:connections', - 'read:custom_domains', - 'read:device_credentials', - 'read:email_provider', - 'read:email_templates', - 'read:email_triggers', - 'read:entity_counts', - 'read:grants', - 'read:guardian_factors', - 'read:insights', - 'read:integrations', - 'read:log_streams', - 'read:logs', - 'read:mfa_policies', - 'read:organization_connections', - 'read:organization_invitations', - 'read:organization_member_roles', - 'read:organization_members', - 'read:organizations', - 'read:prompts', - 'read:requested_scopes', - 'read:resource_servers', - 'read:roles', - 'read:rules', - 'read:rules_configs', - 'read:shields', - 'read:signing_keys', - 'read:stats', - 'read:tenant_invitations', - 'read:tenant_members', - 'read:tenant_settings', - 'read:triggers', - 'read:users', - 'run:checks', - 'update:actions', - 'update:attack_protection', - 'update:branding', - 'update:client_credentials', - 'update:client_grants', - 'update:client_keys', - 'update:clients', - 'update:connections', - 'update:custom_domains', - 'update:email_provider', - 'update:email_templates', - 'update:email_triggers', - 'update:guardian_factors', - 'update:integrations', - 'update:log_streams', - 'update:mfa_policies', - 'update:organization_connections', - 'update:organizations', - 'update:prompts', - 'update:requested_scopes', - 'update:resource_servers', - 'update:roles', - 'update:rules', - 'update:rules_configs', - 'update:shields', - 'update:signing_keys', - 'update:tenant_members', - 'update:tenant_settings', - 'update:triggers', - 'update:users', - ], - }, - }, - body: { - picture_url: '', - support_url: '', - friendly_name: 'mecro-action', - support_email: 'support@test.com', - }, - path: '/api/v2/tenants/settings', - query: {}, - method: 'patch', - channel: 'https://manage.auth0.com/', - userAgent: + user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', - }, - response: { - body: { - flags: { - enable_sso: true, - universal_login: true, - disable_impersonation: true, - allow_changing_enable_sso: false, - revoke_refresh_token_grant: false, - disable_clickjack_protection_headers: false, - new_universal_login_experience_enabled: true, - enforce_client_authentication_on_passwordless_start: true, - cannot_change_enforce_client_authentication_on_passwordless_start: true, + details: { + request: { + ip: '35.160.3.103', + auth: { + user: { + name: 'rudder test', + email: 'test@rudderstack.com', + user_id: 'google-oauth2|123456', + }, + strategy: 'jwt', + credentials: { + jti: '571921bf7833a97efabf08d765a0ec8f', + scopes: ['create:actions'], + }, + }, + body: { + picture_url: '', + support_url: '', + friendly_name: 'mecro-action', + support_email: 'support@test.com', + }, + path: '/api/v2/tenants/settings', + query: {}, + method: 'patch', + channel: 'https://manage.auth0.com/', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + }, + response: { + body: { + flags: { + enable_sso: true, + universal_login: true, + disable_impersonation: true, + allow_changing_enable_sso: false, + revoke_refresh_token_grant: false, + disable_clickjack_protection_headers: false, + new_universal_login_experience_enabled: true, + enforce_client_authentication_on_passwordless_start: true, + cannot_change_enforce_client_authentication_on_passwordless_start: true, + }, + picture_url: '', + support_url: '', + friendly_name: 'mecro-action', + support_email: 'support@test.com', + enabled_locales: ['en'], + sandbox_version: '16', + universal_login: {}, + }, + statusCode: 200, }, - picture_url: '', - support_url: '', - friendly_name: 'mecro-action', - support_email: 'support@test.com', - enabled_locales: ['en'], - sandbox_version: '16', - universal_login: {}, }, - statusCode: 200, + user_id: 'google-oauth2|123456', + log_id: '90020221031061527239169676960191065529099349299958906898', }, - }, - user_id: 'google-oauth2|123456', - log_id: '90020221031061527239169676960191065529099349299958906898', + }), }, + source: {}, }, { - log_id: '90020221031061530247169676961198100736838335677367058450', - data: { - date: '2022-10-31T06:15:25.196Z', - type: 'gd_tenant_update', - description: 'Guardian - Updates tenant settings', - ip: '35.160.3.103', - details: { - request: { + request: { + body: JSON.stringify({ + log_id: '90020221031061530247169676961198100736838335677367058450', + data: { + date: '2022-10-31T06:15:25.196Z', + type: 'gd_tenant_update', + description: 'Guardian - Updates tenant settings', ip: '35.160.3.103', - auth: { - scopes: [ - 'read:authenticators', - 'remove:authenticators', - 'update:authenticators', - 'create:authenticators', - 'read:enrollments', - 'delete:enrollments', - 'read:factors', - 'update:factors', - 'update:tenant_settings', - 'update:users', - 'create:enrollment_tickets', - 'create:users', - ], - subject: 'google-oauth2|123456', - strategy: 'jwt_api2_internal_token', - }, - body: { - picture_url: '[REDACTED]', - friendly_name: '[REDACTED]', - }, - path: '/api/tenants/settings', - query: {}, - method: 'PATCH', - }, - response: { - body: { - name: 'dev-cu4jy2zgao6yx15x', - picture_url: '[REDACTED]', - friendly_name: '[REDACTED]', - guardian_mfa_page: '[REDACTED]', + details: { + request: { + ip: '35.160.3.103', + auth: { + scopes: ['read:authenticators'], + subject: 'google-oauth2|123456', + strategy: 'jwt_api2_internal_token', + }, + body: { + picture_url: '[REDACTED]', + friendly_name: '[REDACTED]', + }, + path: '/api/tenants/settings', + query: {}, + method: 'PATCH', + }, + response: { + body: { + name: 'dev-cu4jy2zgao6yx15x', + picture_url: '[REDACTED]', + friendly_name: '[REDACTED]', + guardian_mfa_page: '[REDACTED]', + }, + statusCode: 200, + }, }, - statusCode: 200, + user_id: 'google-oauth2|123456', + log_id: '90020221031061530247169676961198100736838335677367058450', }, - }, - user_id: 'google-oauth2|123456', - log_id: '90020221031061530247169676961198100736838335677367058450', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -947,19 +512,12 @@ export const data = [ userId: 'google-oauth2|123456', anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - library: { - name: 'unknown', - version: 'unknown', - }, - traits: { - userId: 'google-oauth2|123456', - }, + library: { name: 'unknown', version: 'unknown' }, + traits: { userId: 'google-oauth2|123456' }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', request_ip: '35.160.3.103', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031061527239169676960191065529099349299958906898', @@ -975,138 +533,7 @@ export const data = [ strategy: 'jwt', credentials: { jti: '571921bf7833a97efabf08d765a0ec8f', - scopes: [ - 'create:actions', - 'create:actions_log_sessions', - 'create:client_credentials', - 'create:client_grants', - 'create:clients', - 'create:connections', - 'create:custom_domains', - 'create:email_provider', - 'create:email_templates', - 'create:guardian_enrollment_tickets', - 'create:integrations', - 'create:log_streams', - 'create:organization_connections', - 'create:organization_invitations', - 'create:organization_member_roles', - 'create:organization_members', - 'create:organizations', - 'create:requested_scopes', - 'create:resource_servers', - 'create:roles', - 'create:rules', - 'create:shields', - 'create:signing_keys', - 'create:tenant_invitations', - 'create:test_email_dispatch', - 'create:users', - 'delete:actions', - 'delete:anomaly_blocks', - 'delete:branding', - 'delete:client_credentials', - 'delete:client_grants', - 'delete:clients', - 'delete:connections', - 'delete:custom_domains', - 'delete:device_credentials', - 'delete:email_provider', - 'delete:email_templates', - 'delete:grants', - 'delete:guardian_enrollments', - 'delete:integrations', - 'delete:log_streams', - 'delete:organization_connections', - 'delete:organization_invitations', - 'delete:organization_member_roles', - 'delete:organization_members', - 'delete:organizations', - 'delete:owners', - 'delete:requested_scopes', - 'delete:resource_servers', - 'delete:roles', - 'delete:rules', - 'delete:rules_configs', - 'delete:shields', - 'delete:tenant_invitations', - 'delete:tenant_members', - 'delete:tenants', - 'delete:users', - 'read:actions', - 'read:anomaly_blocks', - 'read:attack_protection', - 'read:branding', - 'read:checks', - 'read:client_credentials', - 'read:client_grants', - 'read:client_keys', - 'read:clients', - 'read:connections', - 'read:custom_domains', - 'read:device_credentials', - 'read:email_provider', - 'read:email_templates', - 'read:email_triggers', - 'read:entity_counts', - 'read:grants', - 'read:guardian_factors', - 'read:insights', - 'read:integrations', - 'read:log_streams', - 'read:logs', - 'read:mfa_policies', - 'read:organization_connections', - 'read:organization_invitations', - 'read:organization_member_roles', - 'read:organization_members', - 'read:organizations', - 'read:prompts', - 'read:requested_scopes', - 'read:resource_servers', - 'read:roles', - 'read:rules', - 'read:rules_configs', - 'read:shields', - 'read:signing_keys', - 'read:stats', - 'read:tenant_invitations', - 'read:tenant_members', - 'read:tenant_settings', - 'read:triggers', - 'read:users', - 'run:checks', - 'update:actions', - 'update:attack_protection', - 'update:branding', - 'update:client_credentials', - 'update:client_grants', - 'update:client_keys', - 'update:clients', - 'update:connections', - 'update:custom_domains', - 'update:email_provider', - 'update:email_templates', - 'update:email_triggers', - 'update:guardian_factors', - 'update:integrations', - 'update:log_streams', - 'update:mfa_policies', - 'update:organization_connections', - 'update:organizations', - 'update:prompts', - 'update:requested_scopes', - 'update:resource_servers', - 'update:roles', - 'update:rules', - 'update:rules_configs', - 'update:shields', - 'update:signing_keys', - 'update:tenant_members', - 'update:tenant_settings', - 'update:triggers', - 'update:users', - ], + scopes: ['create:actions'], }, }, body: { @@ -1151,9 +578,7 @@ export const data = [ description: 'Update tenant settings', source_type: 'sapi', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T06:15:25.201Z', }, ], @@ -1169,17 +594,10 @@ export const data = [ userId: 'google-oauth2|123456', anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - library: { - name: 'unknown', - version: 'unknown', - }, - traits: { - userId: 'google-oauth2|123456', - }, + library: { name: 'unknown', version: 'unknown' }, + traits: { userId: 'google-oauth2|123456' }, request_ip: '35.160.3.103', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031061530247169676961198100736838335677367058450', @@ -1187,20 +605,7 @@ export const data = [ request: { ip: '35.160.3.103', auth: { - scopes: [ - 'read:authenticators', - 'remove:authenticators', - 'update:authenticators', - 'create:authenticators', - 'read:enrollments', - 'delete:enrollments', - 'read:factors', - 'update:factors', - 'update:tenant_settings', - 'update:users', - 'create:enrollment_tickets', - 'create:users', - ], + scopes: ['read:authenticators'], subject: 'google-oauth2|123456', strategy: 'jwt_api2_internal_token', }, @@ -1225,9 +630,7 @@ export const data = [ description: 'Guardian - Updates tenant settings', source_type: 'gd_tenant_update', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T06:15:25.196Z', }, ], @@ -1236,52 +639,51 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'auth0', description: 'missing userId', module: 'source', - version: 'v0', - + version: 'v2', input: { request: { body: [ { - log_id: '90020221031055712103169676686005480714681762668315934738', - data: { - date: '2022-10-31T05:57:06.859Z', - type: 'ss', - description: '', - connection: 'Username-Password-Authentication', - connection_id: 'con_djwCjiwyID0vZy1S', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: 'All Applications', - ip: '35.166.202.113', - user_agent: 'unknown', - details: { - body: { - email: 'testRudderlabs+21@gmail.com', - tenant: 'dev-cu4jy2zgao6yx15x', - password: 'dummyPassword', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + request: { + body: JSON.stringify({ + log_id: '90020221031055712103169676686005480714681762668315934738', + data: { + date: '2022-10-31T05:57:06.859Z', + type: 'ss', + description: '', connection: 'Username-Password-Authentication', + connection_id: 'con_djwCjiwyID0vZy1S', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: 'All Applications', + ip: '35.166.202.113', + user_agent: 'unknown', + details: { + body: { + email: 'testRudderlabs+21@gmail.com', + tenant: 'dev-cu4jy2zgao6yx15x', + password: 'dummyPassword', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + connection: 'Username-Password-Authentication', + }, + }, + user_id: '', + user_name: 'testRudderlabs+21@gmail.com', + strategy: 'auth0', + strategy_type: 'database', + log_id: '90020221031055712103169676686005480714681762668315934738', }, - }, - user_id: '', - user_name: 'testRudderlabs+21@gmail.com', - strategy: 'auth0', - strategy_type: 'database', - log_id: '90020221031055712103169676686005480714681762668315934738', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -1306,15 +708,10 @@ export const data = [ userId: '', user_name: 'testRudderlabs+21@gmail.com', }, - library: { - name: 'unknown', - version: 'unknown', - }, + library: { name: 'unknown', version: 'unknown' }, userAgent: 'unknown', request_ip: '35.166.202.113', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031055712103169676686005480714681762668315934738', @@ -1332,9 +729,7 @@ export const data = [ description: '', source_type: 'ss', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T05:57:06.859Z', }, ], @@ -1343,66 +738,70 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'auth0', description: 'missing userId for all the requests in a batch', module: 'source', - version: 'v0', - + version: 'v2', input: { request: { body: [ { - log_id: '90020221031055712103169676686005480714681762668315934738', - data: { - date: '2022-10-31T05:57:06.859Z', - type: 'ss', - description: '', - connection: 'Username-Password-Authentication', - connection_id: 'con_djwCjiwyID0vZy1S', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: 'All Applications', - ip: '35.166.202.113', - user_agent: 'unknown', - details: { - body: { - email: 'testRudderlabs+21@gmail.com', - tenant: 'dev-cu4jy2zgao6yx15x', - password: 'dummyPassword', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + request: { + body: JSON.stringify({ + log_id: '90020221031055712103169676686005480714681762668315934738', + data: { + date: '2022-10-31T05:57:06.859Z', + type: 'ss', + description: '', connection: 'Username-Password-Authentication', + connection_id: 'con_djwCjiwyID0vZy1S', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: 'All Applications', + ip: '35.166.202.113', + user_agent: 'unknown', + details: { + body: { + email: 'testRudderlabs+21@gmail.com', + tenant: 'dev-cu4jy2zgao6yx15x', + password: 'dummyPassword', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + connection: 'Username-Password-Authentication', + }, + }, + user_id: '', + user_name: 'testRudderlabs+21@gmail.com', + strategy: 'auth0', + strategy_type: 'database', + log_id: '90020221031055712103169676686005480714681762668315934738', }, - }, - user_id: '', - user_name: 'testRudderlabs+21@gmail.com', - strategy: 'auth0', - strategy_type: 'database', - log_id: '90020221031055712103169676686005480714681762668315934738', + }), }, + source: {}, }, { - log_id: '90020221031055712103169676686007898566320991926665347090', - data: { - date: '2022-10-31T05:57:06.874Z', - type: 'sapi', - description: 'Create a User', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: '', - ip: '35.166.202.113', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', - log_id: '90020221031055712103169676686007898566320991926665347090', + request: { + body: JSON.stringify({ + log_id: '90020221031055712103169676686007898566320991926665347090', + data: { + date: '2022-10-31T05:57:06.874Z', + type: 'sapi', + description: 'Create a User', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: '', + ip: '35.166.202.113', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + log_id: '90020221031055712103169676686007898566320991926665347090', + }, + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -1427,15 +826,10 @@ export const data = [ userId: '', user_name: 'testRudderlabs+21@gmail.com', }, - library: { - name: 'unknown', - version: 'unknown', - }, + library: { name: 'unknown', version: 'unknown' }, userAgent: 'unknown', request_ip: '35.166.202.113', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031055712103169676686005480714681762668315934738', @@ -1453,9 +847,7 @@ export const data = [ description: '', source_type: 'ss', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T05:57:06.859Z', }, ], @@ -1470,16 +862,11 @@ export const data = [ sentAt: '2022-10-31T05:57:06.874Z', anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - library: { - name: 'unknown', - version: 'unknown', - }, + library: { name: 'unknown', version: 'unknown' }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', request_ip: '35.166.202.113', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031055712103169676686007898566320991926665347090', @@ -1488,9 +875,7 @@ export const data = [ description: 'Create a User', source_type: 'sapi', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T05:57:06.874Z', }, ], @@ -1499,34 +884,26 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'auth0', description: 'empty batch', module: 'source', - version: 'v0', + version: 'v2', skipGo: 'Created this case manually', input: { request: { body: [], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, - output: { - response: { - status: 200, - body: [], - }, - }, - mockFns: () => { - defaultMockFns(); - }, + output: { response: { status: 200, body: [] } }, + }, +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); }, -]; +})); diff --git a/test/integrations/sources/braze/data.ts b/test/integrations/sources/braze/data.ts index a4031e1bd04..d3642099aaa 100644 --- a/test/integrations/sources/braze/data.ts +++ b/test/integrations/sources/braze/data.ts @@ -10,25 +10,25 @@ export const data = [ name: 'braze', description: 'event mapping done in UI', module: 'source', - version: 'v1', + version: 'v2', skipGo: 'Custom source config', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.inappmessage.Click', - properties: { - device_model: 'samsung', - }, - user: { - user_id: 'user_id', - external_user_id: 'externalUserId', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.inappmessage.Click', + properties: { device_model: 'samsung' }, + user: { + user_id: 'user_id', + external_user_id: 'externalUserId', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -48,9 +48,7 @@ export const data = [ }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -64,21 +62,12 @@ export const data = [ { anonymousId: 'user_id', context: { - device: { - model: 'samsung', - }, - integration: { - name: 'Braze', - }, - library: { - name: 'unknown', - version: 'unknown', - }, + device: { model: 'samsung' }, + integration: { name: 'Braze' }, + library: { name: 'unknown', version: 'unknown' }, }, event: 'In-App Message Clicked', - integrations: { - Braze: false, - }, + integrations: { Braze: false }, type: 'track', userId: 'externalUserId', }, @@ -93,25 +82,24 @@ export const data = [ name: 'braze', description: 'The event is not mapped in the UI', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.inappmessage.Click', - properties: { - device_model: 'samsung', - }, - user: { - user_id: 'user_id', - external_user_id: 'externalUserId', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.inappmessage.Click', + properties: { device_model: 'samsung' }, + user: { + user_id: 'user_id', + external_user_id: 'externalUserId', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -119,21 +107,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -147,21 +128,12 @@ export const data = [ { anonymousId: 'user_id', context: { - device: { - model: 'samsung', - }, - integration: { - name: 'Braze', - }, - library: { - name: 'unknown', - version: 'unknown', - }, + device: { model: 'samsung' }, + integration: { name: 'Braze' }, + library: { name: 'unknown', version: 'unknown' }, }, event: 'users.messages.inappmessage.Click', - integrations: { - Braze: false, - }, + integrations: { Braze: false }, type: 'track', userId: 'externalUserId', }, @@ -176,37 +148,38 @@ export const data = [ name: 'braze', description: 'users.messages.inappmessage.Click event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.inappmessage.Click', - id: 'a1234567-89ab-cdef-0123-456789abcdef', - time: 1607988752, - 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', - campaign_id: '11234567-89ab-cdef-0123-456789abcdef', - campaign_name: 'Test Campaign', - message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', - platform: 'android', - os_version: 'Android (N)', - device_model: 'Nexus 5X', - button_id: '0', - send_id: 'f123456789abcdef01234567', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.inappmessage.Click', + id: 'a1234567-89ab-cdef-0123-456789abcdef', + time: 1607988752, + 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', + campaign_id: '11234567-89ab-cdef-0123-456789abcdef', + campaign_name: 'Test Campaign', + message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', + platform: 'android', + os_version: 'Android (N)', + device_model: 'Nexus 5X', + button_id: '0', + send_id: 'f123456789abcdef01234567', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -214,21 +187,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -277,35 +243,36 @@ export const data = [ name: 'braze', description: 'users.messages.pushnotification.Send event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - 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', - campaign_id: '11234567-89ab-cdef-0123-456789abcdef', - campaign_name: 'Test Campaign', - message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', - send_id: 'f123456789abcdef01234567', - dispatch_id: '01234567-89ab-cdef-0123-456789abcdef', + request: { + body: JSON.stringify({ + 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', + campaign_id: '11234567-89ab-cdef-0123-456789abcdef', + campaign_name: 'Test Campaign', + message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', + send_id: 'f123456789abcdef01234567', + dispatch_id: '01234567-89ab-cdef-0123-456789abcdef', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -313,21 +280,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -373,35 +333,36 @@ export const data = [ name: 'braze', description: 'users.messages.email.Open event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - 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: { - campaign_id: '11234567-89ab-cdef-0123-456789abcdef', - campaign_name: 'Test Campaign', - dispatch_id: '12345qwert', - message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', - email_address: 'test@test.com', - send_id: 'f123456789abcdef01234567', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', + request: { + body: JSON.stringify({ + 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: { + campaign_id: '11234567-89ab-cdef-0123-456789abcdef', + campaign_name: 'Test Campaign', + dispatch_id: '12345qwert', + message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', + email_address: 'test@test.com', + send_id: 'f123456789abcdef01234567', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -409,21 +370,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -469,34 +423,35 @@ export const data = [ name: 'braze', description: 'users.messages.sms.Delivery send', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - 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', + request: { + body: JSON.stringify({ + 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', @@ -504,21 +459,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -563,38 +511,39 @@ export const data = [ name: 'braze', description: 'users.messages.inappmessage.Click event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - 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', + request: { + body: JSON.stringify({ + 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', @@ -602,21 +551,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -666,36 +608,37 @@ export const data = [ name: 'braze', description: 'users.messages.pushnotification.Send event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - 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', + request: { + body: JSON.stringify({ + 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', @@ -703,21 +646,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -764,36 +700,37 @@ export const data = [ name: 'braze', description: 'users.messages.email.Open event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - 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', + request: { + body: JSON.stringify({ + 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', @@ -801,21 +738,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -862,35 +792,36 @@ export const data = [ name: 'braze', description: 'users.messages.sms.Delivery event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - 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', + request: { + body: JSON.stringify({ + 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', @@ -898,21 +829,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -958,41 +882,42 @@ export const data = [ name: 'braze', description: 'users.behaviors.CustomEvent any custom event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - 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'], + request: { + body: JSON.stringify({ + 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', @@ -1000,21 +925,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -1067,43 +985,44 @@ export const data = [ name: 'braze', description: 'users.behaviors.Purchase event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - 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'], + request: { + body: JSON.stringify({ + 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', @@ -1111,21 +1030,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -1180,33 +1092,155 @@ export const data = [ name: 'braze', description: 'users.behaviors.app.SessionStart event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ + request: { + body: JSON.stringify({ + 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: commonSourceDefinition, + Config: { + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], + }, + ...commonSourceConfigProperties, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ { - 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', + 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', - platform: 'ios', - os_version: 'iOS10.3.1', - device_model: 'iPhone7Plus', session_id: 'b1234567-89ab-cdef-0123-456789abcdef', }, + timestamp: '2016-10-26T17:26:23.000Z', }, ], }, + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'event.events is not available in required format', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({}), + }, + source: { + ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', + OriginalID: '', + Name: 'Braze source', + SourceDefinition: commonSourceDefinition, + Config: { + customMapping: [ + { + from: 'randomEvent', + to: 'In-App Message Clicked', + }, + ], + }, + ...commonSourceConfigProperties, + }, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventList should be an array', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'braze', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'event is null in request', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify(null), + }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', OriginalID: '', @@ -1231,6 +1265,238 @@ export const data = [ }, pathSuffix: '', }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventList should be an array', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'braze', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'event is empty array in request', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify([]), + }, + source: { + ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', + OriginalID: '', + Name: 'Braze source', + SourceDefinition: commonSourceDefinition, + Config: { + customMapping: [ + { + from: 'randomEvent', + to: 'In-App Message Clicked', + }, + ], + }, + ...commonSourceConfigProperties, + }, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventList should be an array', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'braze', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'event[0] is null/undefined in request', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify([null]), + }, + source: { + ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', + OriginalID: '', + Name: 'Braze source', + SourceDefinition: commonSourceDefinition, + Config: { + customMapping: [ + { + from: 'randomEvent', + to: 'In-App Message Clicked', + }, + ], + }, + ...commonSourceConfigProperties, + }, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventList should be an array', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'braze', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'event[0].events is undefined or null', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify([{}]), + }, + source: { + ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', + OriginalID: '', + Name: 'Braze source', + SourceDefinition: commonSourceDefinition, + Config: { + customMapping: [ + { + from: 'randomEvent', + to: 'In-App Message Clicked', + }, + ], + }, + ...commonSourceConfigProperties, + }, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventList should be an array', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'braze', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'success scenario when event[0].events is valid request', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify([ + { + 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: commonSourceDefinition, + Config: { + customMapping: [], + }, + ...commonSourceConfigProperties, + }, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, output: { response: { status: 200, @@ -1239,26 +1505,16 @@ export const data = [ output: { batch: [ { + anonymousId: 'user_id', context: { - library: { name: 'unknown', version: 'unknown' }, + device: { model: 'samsung' }, integration: { name: 'Braze' }, - device: { - id: 'fedcba87-6543-210f-edc-ba9876543210', - model: 'iPhone7Plus', - }, - os: { version: 'iOS10.3.1', name: 'ios' }, + library: { name: 'unknown', version: 'unknown' }, }, + event: 'users.messages.inappmessage.Click', 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', + userId: 'externalUserId', }, ], }, diff --git a/test/integrations/sources/canny/data.ts b/test/integrations/sources/canny/data.ts index ac471904f93..de626abf19f 100644 --- a/test/integrations/sources/canny/data.ts +++ b/test/integrations/sources/canny/data.ts @@ -9,50 +9,61 @@ export const data = [ name: 'canny', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - objectType: 'post', - type: 'post.created', + source: {}, }, ], method: 'POST', @@ -81,7 +92,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-28T10:52:46.294Z', originalTimestamp: '2022-07-28T10:52:46.294Z', @@ -98,7 +114,13 @@ export const data = [ category: null, commentCount: 0, created: '2022-07-28T10:52:46.172Z', - customFields: [{ id: '62e13820d7949d44b92d3876', name: 'abc', value: '123' }], + customFields: [ + { + id: '62e13820d7949d44b92d3876', + name: 'abc', + value: '123', + }, + ], details: 'Array of images', eta: null, id: '62e26a7e1d4ea13c124337bd', @@ -126,55 +148,60 @@ export const data = [ name: 'canny', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - objectType: 'post', - type: 'post.deleted', + source: {}, }, ], method: 'POST', @@ -203,7 +230,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T10:35:16.390Z', originalTimestamp: '2022-07-26T10:35:16.390Z', @@ -253,55 +285,62 @@ export const data = [ name: 'canny', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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" + + '\n' + + 'https://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', + }), }, - objectType: 'post', - type: 'post.jira_issue_linked', + source: {}, }, ], method: 'POST', @@ -330,7 +369,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T18:32:28.337Z', originalTimestamp: '2022-07-26T18:32:28.337Z', @@ -353,7 +397,9 @@ export const data = [ imageURLs: [], issue: { description: - "This is the post's details\n\nhttps://rudder.canny.io/admin/board/features/p/post-title-8", + "This is the post's details\n" + + '\n' + + 'https://rudder.canny.io/admin/board/features/p/post-title-8', id: '10001', key: 'TES-2', status: 'To Do', @@ -380,55 +426,62 @@ export const data = [ name: 'canny', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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' + + '\n' + + 'https://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', + }), }, - objectType: 'post', - type: 'post.jira_issue_unlinked', + source: {}, }, ], method: 'POST', @@ -457,7 +510,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-27T04:08:24.377Z', originalTimestamp: '2022-07-27T04:08:24.377Z', @@ -481,7 +539,9 @@ export const data = [ imageURLs: [], issue: { description: - 'Array of images\n\nhttps://rudder.canny.io/admin/board/features/p/images-testing-2', + 'Array of images\n' + + '\n' + + 'https://rudder.canny.io/admin/board/features/p/images-testing-2', id: '10002', key: 'TES-3', status: 'To Do', @@ -507,63 +567,68 @@ export const data = [ name: 'canny', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - objectType: 'post', - type: 'post.status_changed', + source: {}, }, ], method: 'POST', @@ -593,7 +658,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T18:07:03.143Z', originalTimestamp: '2022-07-26T18:07:03.143Z', @@ -650,64 +720,69 @@ export const data = [ name: 'canny', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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', }, - 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', + }), }, - objectType: 'comment', - type: 'comment.created', + source: {}, }, ], method: 'POST', @@ -736,7 +811,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T10:52:17.712Z', originalTimestamp: '2022-07-26T10:52:17.712Z', @@ -795,62 +875,67 @@ export const data = [ name: 'canny', description: 'test-6', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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', }, - 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', + }), }, - objectType: 'comment', - type: 'comment.deleted', + source: {}, }, ], method: 'POST', @@ -879,7 +964,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-27T04:12:09.290Z', originalTimestamp: '2022-07-27T04:12:09.290Z', @@ -936,62 +1026,67 @@ export const data = [ name: 'canny', description: 'test-7', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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, + }, }, - 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', + }), }, - objectType: 'vote', - type: 'vote.created', + source: {}, }, ], method: 'POST', @@ -1021,7 +1116,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T11:32:31.378Z', originalTimestamp: '2022-07-26T11:32:31.378Z', @@ -1077,69 +1177,74 @@ export const data = [ name: 'canny', description: 'test-8', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', }, - ], - 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, - }, + 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', + }), }, - objectType: 'vote', - type: 'vote.deleted', + source: {}, }, ], method: 'POST', @@ -1169,7 +1274,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T18:09:27.358Z', originalTimestamp: '2022-07-26T18:09:27.358Z', @@ -1232,50 +1342,61 @@ export const data = [ name: 'canny', description: 'test-9', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - objectType: 'post', - type: 'post.created', + source: {}, }, ], method: 'POST', @@ -1304,7 +1425,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-28T10:52:46.294Z', originalTimestamp: '2022-07-28T10:52:46.294Z', @@ -1321,7 +1447,13 @@ export const data = [ category: null, commentCount: 0, created: '2022-07-28T10:52:46.172Z', - customFields: [{ id: '62e13820d7949d44b92d3876', name: 'abc', value: '123' }], + customFields: [ + { + id: '62e13820d7949d44b92d3876', + name: 'abc', + value: '123', + }, + ], details: 'Array of images', eta: null, id: '62e26a7e1d4ea13c124337bd', @@ -1349,62 +1481,67 @@ export const data = [ name: 'canny', description: 'test-10', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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', + }, }, - 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', + }), }, - objectType: 'vote', - type: 'vote.created', + source: {}, }, ], method: 'POST', @@ -1434,7 +1571,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T11:32:31.378Z', originalTimestamp: '2022-07-26T11:32:31.378Z', @@ -1490,69 +1632,74 @@ export const data = [ name: 'canny', description: 'test-11', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', }, - ], - 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, - }, + 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', + }), }, - objectType: 'vote', - type: 'vote.deleted', + source: {}, }, ], method: 'POST', @@ -1573,6 +1720,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'canny', workspaceId: 'Non determinable', }, }, @@ -1584,53 +1732,58 @@ export const data = [ name: 'canny', description: 'test-12', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - objectType: 'post', + source: {}, }, ], method: 'POST', @@ -1650,6 +1803,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'canny', workspaceId: 'Non determinable', }, }, diff --git a/test/integrations/sources/close_crm/data.ts b/test/integrations/sources/close_crm/data.ts index 08b9d13a1b0..66c8841d1eb 100644 --- a/test/integrations/sources/close_crm/data.ts +++ b/test/integrations/sources/close_crm/data.ts @@ -9,78 +9,78 @@ export const data = [ name: 'close_crm', description: 'lead update', module: 'source', - version: 'v1', + version: 'v2', input: { 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', + request: { + body: JSON.stringify({ + 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', - 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', + 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', + user_id: 'user_123', + object_type: 'opportunity', lead_id: 'lead_123', - confidence: 100, }, - request_id: 'req_123', - object_id: 'object_id', - user_id: 'user_123', - object_type: 'opportunity', - lead_id: 'lead_123', - }, - subscription_id: 'whsub_123', + subscription_id: 'whsub_123', + }), }, source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -93,17 +93,10 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'CloseCRM', - }, - }, - integrations: { - CloseCRM: false, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'CloseCRM' }, }, + integrations: { CloseCRM: false }, type: 'track', event: 'opportunity updated', messageId: 'ev_123', @@ -159,59 +152,52 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'close_crm', description: 'group creation', module: 'source', - version: 'v1', + version: 'v2', input: { request: { body: [ { - 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', - }, - ], + request: { + body: JSON.stringify({ + 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: {}, }, - previous_data: {}, - }, + }), }, source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -225,29 +211,18 @@ export const data = [ { anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - integration: { - name: 'CloseCRM', - }, - library: { - name: 'unknown', - version: 'unknown', - }, + integration: { name: 'CloseCRM' }, + library: { name: 'unknown', version: 'unknown' }, }, event: 'group created', - integrations: { - CloseCRM: false, - }, + integrations: { CloseCRM: false }, messageId: 'ev_123', originalTimestamp: '2024-06-ThT03:53:33.917+00:00', properties: { action: 'created', data: { id: 'group_123', - members: [ - { - user_id: 'user_123', - }, - ], + members: [{ user_id: 'user_123' }], name: 'Test group', }, date_created: '2024-06-13T03:53:33.917000', @@ -272,68 +247,65 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'close_crm', description: 'lead deletion', module: 'source', - version: 'v1', + version: 'v2', input: { request: { body: [ { - 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', - 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', + request: { + body: JSON.stringify({ + subscription_id: 'whsub_123', + event: { + id: 'ev_123', + date_created: '2024-06-14T05:16:04.138000', + date_updated: '2024-06-14T05:16:04.138000', organization_id: 'orga_123', - updated_by: 'user_123', - created_by: 'user_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', + }, }, - }, + }), }, source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -346,17 +318,10 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'CloseCRM', - }, - }, - integrations: { - CloseCRM: false, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'CloseCRM' }, }, + integrations: { CloseCRM: false }, type: 'track', event: 'lead deleted', userId: 'lead_123', @@ -388,8 +353,10 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, -]; +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/cordial/data.ts b/test/integrations/sources/cordial/data.ts index acb02e9fbfc..4da265a9ca2 100644 --- a/test/integrations/sources/cordial/data.ts +++ b/test/integrations/sources/cordial/data.ts @@ -9,61 +9,59 @@ export const data = [ name: 'cordial', description: 'Simple Single object Input event with normal channel and action', module: 'source', - version: 'v1', + version: 'v2', input: { request: { body: [ { - event: { - contact: { - _id: '6690fe3655e334xx028xxx', - channels: { - email: { - address: 'jondoe@example.com', - subscribeStatus: 'subscribed', - subscribedAt: '2024-07-12T09:58:14+0000', + request: { + body: JSON.stringify({ + 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', }, - 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', + 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', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -76,13 +74,8 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'Cordial', - }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Cordial' }, traits: { userId: '6690fe3655e334xx028xxx', email: 'jondoe@example.com', @@ -95,20 +88,21 @@ export const data = [ }, }, createdAt: '2024-07-12T09:58:14+0000', - address: { - city: 'San Miego', - }, + 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, + externalId: [ + { + id: '6690fe3655e334xx028xxx', + type: 'cordialContactId', + }, + ], }, + integrations: { Cordial: false }, type: 'track', event: 'browse', originalTimestamp: '2024-07-12T14:45:25+00:00', @@ -142,154 +136,147 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'cordial', description: 'Multiple object Input event with batched payload', module: 'source', - version: 'v1', + version: 'v2', input: { request: { body: [ { - event: [ - { - contact: { - _id: '633b2fd70a12be027e0b0xxx', - lang_locale: 'EN-US', - channels: { - email: { - address: 'johndoe@example.com', - subscribeStatus: 'none', + request: { + body: JSON.stringify([ + { + 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', }, - 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, + 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', }, - 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', + 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'], }, }, - 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, + { + contact: { + _id: '633b2fd12312be027e0b0xxx', + lang_locale: 'EN-US', + channels: { + email: { + address: 'johndoe1@example.com', + subscribeStatus: 'none', + }, }, - 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', + 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', }, - 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'], + 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', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -302,13 +289,8 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'Cordial', - }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Cordial' }, traits: { userId: '633b2fd70a12be027e0b0xxx', email: 'johndoe@example.com', @@ -336,11 +318,14 @@ export const data = [ browser: 'Chrome', robot: false, }, - externalId: [{ id: '633b2fd70a12be027e0b0xxx', type: 'cordialContactId' }], - }, - integrations: { - Cordial: false, + externalId: [ + { + id: '633b2fd70a12be027e0b0xxx', + type: 'cordialContactId', + }, + ], }, + integrations: { Cordial: false }, type: 'track', event: 'browse', properties: { @@ -367,9 +352,7 @@ export const data = [ }, a: 'browse', UID: '471af949fffe749c2ebfxxx950ea73c', - sp: { - bid: 'cf6de7f1-cce5-40xx-ac9c-7c82a2xxc09e', - }, + sp: { bid: 'cf6de7f1-cce5-40xx-ac9c-7c82a2xxc09e' }, tzo: -7, rl: '6', time: '2024-07-24T07:52:39+0000', @@ -384,13 +367,8 @@ export const data = [ }, { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'Cordial', - }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Cordial' }, traits: { userId: '633b2fd12312be027e0b0xxx', email: 'johndoe1@example.com', @@ -418,11 +396,14 @@ export const data = [ browser: 'Chrome', robot: false, }, - externalId: [{ id: '633b2fd12312be027e0b0xxx', type: 'cordialContactId' }], - }, - integrations: { - Cordial: false, + externalId: [ + { + id: '633b2fd12312be027e0b0xxx', + type: 'cordialContactId', + }, + ], }, + integrations: { Cordial: false }, type: 'track', event: 'browse', properties: { @@ -449,9 +430,7 @@ export const data = [ }, a: 'browse', UID: '471af949fffe74sdh382ebfxxx950ea73c', - sp: { - bid: 'cf6de7f1-123ce5-20xx-ac9c-7c82a2xxc09e', - }, + sp: { bid: 'cf6de7f1-123ce5-20xx-ac9c-7c82a2xxc09e' }, tzo: -7, rl: '6', time: '2024-07-24T07:52:39+0000', @@ -470,74 +449,69 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'cordial', description: 'Simple Single object Input event with no CId', module: 'source', - version: 'v1', + version: 'v2', input: { request: { body: [ { - event: { - contact: { - _id: '6690fe3655e334xx028xx1', - channels: { - email: { - address: 'jondoe@example.com', - subscribeStatus: 'subscribed', - subscribedAt: '2024-07-12T09:58:14+0000', + request: { + body: JSON.stringify({ + 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', }, - 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', + 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', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -550,13 +524,8 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'Cordial', - }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Cordial' }, traits: { userId: '6690fe3655e334xx028xx1', email: 'jondoe@example.com', @@ -569,9 +538,7 @@ export const data = [ }, }, createdAt: '2024-07-12T09:58:14+0000', - address: { - city: 'San Miego', - }, + address: { city: 'San Miego' }, first_name: 'John', last_name: 'Doe', lastUpdateSource: 'api', @@ -586,9 +553,7 @@ export const data = [ }, externalId: [], }, - integrations: { - Cordial: false, - }, + integrations: { Cordial: false }, type: 'track', event: 'browse', originalTimestamp: '2024-07-12T14:45:25+00:00', @@ -621,8 +586,10 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, -]; +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/customerio/data.ts b/test/integrations/sources/customerio/data.ts index b831b1d0b07..ee4df648619 100644 --- a/test/integrations/sources/customerio/data.ts +++ b/test/integrations/sources/customerio/data.ts @@ -9,20 +9,25 @@ export const data = [ name: 'customerio', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - customer_id: '0200102', - identifiers: { id: '0200102' }, - email_address: 'test@example.com', + request: { + body: JSON.stringify({ + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', + object_type: 'customer', + metric: 'subscribed', + timestamp: 'abc', + }), }, - event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', - object_type: 'customer', - metric: 'subscribed', - timestamp: 'abc', + source: {}, }, ], method: 'POST', @@ -60,20 +65,25 @@ export const data = [ name: 'customerio', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - customer_id: '0200102', - identifiers: { id: '0200102' }, - email_address: 'test@example.com', + request: { + body: JSON.stringify({ + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', + object_type: 'customer', + metric: 'subscribed', + timestamp: '1585250199', + }), }, - event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', - object_type: 'customer', - metric: 'subscribed', - timestamp: '1585250199', + source: {}, }, ], method: 'POST', @@ -111,20 +121,25 @@ export const data = [ name: 'customerio', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - customer_id: '0200102', - identifiers: { id: '0200102' }, - email_address: 'test@example.com', + request: { + body: JSON.stringify({ + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', + object_type: 'customer', + metric: 'subscribed', + timestamp: 1585250199, + }), }, - event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', - object_type: 'customer', - metric: 'subscribed', - timestamp: 1585250199, + source: {}, }, ], method: 'POST', @@ -164,20 +179,25 @@ export const data = [ name: 'customerio', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - customer_id: '0200102', - identifiers: { id: '0200102' }, - email_address: 'test@example.com', + request: { + body: JSON.stringify({ + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4C6P79C12J5A6KPE6XNFD', + object_type: 'customer', + metric: 'unsubscribed', + timestamp: 1585250179, + }), }, - event_id: '01E4C4C6P79C12J5A6KPE6XNFD', - object_type: 'customer', - metric: 'unsubscribed', - timestamp: 1585250179, + source: {}, }, ], method: 'POST', @@ -217,22 +237,27 @@ export const data = [ name: 'customerio', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 36, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgABcRhIBqSp7kiPekGBIeVh', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4C4G1S0AMNG0XVF2M7RPH5S', - object_type: 'email', - metric: 'drafted', - timestamp: 1585250305, + source: {}, }, ], method: 'POST', @@ -276,25 +301,30 @@ export const data = [ name: 'customerio', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', 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!', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '12ASDG7S9P6MAZPTJ78DAND9GDC', - object_type: 'email', - metric: 'bounced', - timestamp: 1234567890, + source: {}, }, ], method: 'POST', @@ -341,26 +371,31 @@ export const data = [ name: 'customerio', description: 'test-6', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4C8BES5XT87ZWRJFTB35YJ3', - object_type: 'email', - metric: 'clicked', - timestamp: 1585254348, + source: {}, }, ], method: 'POST', @@ -407,26 +442,31 @@ export const data = [ name: 'customerio', description: 'test-7', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E2EMRMM6TZ12TF9WGZN0WJQT', - metric: 'sent', - object_type: 'email', - timestamp: 1644227937, + source: {}, }, ], method: 'POST', @@ -473,23 +513,28 @@ export const data = [ name: 'customerio', description: 'test-8', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01ER4R5WB62QWCNREKFB4DYXGR', - metric: 'delivered', - object_type: 'email', - timestamp: 1675196819, + source: {}, }, ], method: 'POST', @@ -508,7 +553,10 @@ export const data = [ context: { library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Customer.io' }, - traits: { cioId: '7ef807109981', email: 'test@example.com' }, + traits: { + cioId: '7ef807109981', + email: 'test@example.com', + }, }, integrations: { 'Customer.io': false }, type: 'track', @@ -534,23 +582,28 @@ export const data = [ name: 'customerio', description: 'test-9', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 38, - campaign_id: 6, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RAEABQFxN56fWzydfV4_EGvfobI=', - failure_message: 'NoDevicesSynced', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4VSX8SZ0T9AQMH4Q16NRB89', - object_type: 'push', - metric: 'attempted', - timestamp: 1585776075, + source: {}, }, ], method: 'POST', @@ -595,29 +648,34 @@ export const data = [ name: 'customerio', description: 'test-10', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4C4HDQ7P1X9KTKF0ZX7PWHE', - object_type: 'push', - metric: 'sent', - timestamp: 1585250350, + source: {}, }, ], method: 'POST', @@ -668,30 +726,35 @@ export const data = [ name: 'customerio', description: 'test-11', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4V2SBHYK4TNTG8WKMP39G9R', - object_type: 'push', - metric: 'clicked', - timestamp: 1585751829, + source: {}, }, ], method: 'POST', @@ -742,24 +805,29 @@ export const data = [ name: 'customerio', description: 'test-12', module: 'source', - version: 'v0', + version: 'v2', 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.", + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4F3DCS83P8HT7R3E6DWQN1X', - object_type: 'sms', - metric: 'attempted', - timestamp: 1234567890, + source: {}, }, ], method: 'POST', @@ -805,25 +873,30 @@ export const data = [ name: 'customerio', description: 'test-13', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4XXPN42JDF4B1ATQKTZ8WHV', - object_type: 'sms', - metric: 'clicked', - timestamp: 1585847161, + source: {}, }, ], method: 'POST', @@ -869,23 +942,28 @@ export const data = [ name: 'customerio', description: 'test-14', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 39, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgQBcRhNAufb0s30bmz5HD7Y', - recipient: '#signups', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4C4TQKD6KJ274870J5DE2HB', - object_type: 'slack', - metric: 'sent', - timestamp: 1585250655, + source: {}, }, ], method: 'POST', @@ -930,25 +1008,30 @@ export const data = [ name: 'customerio', description: 'test-15', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4C6HJTBNDX18XC4B88M3Y2G', - object_type: 'slack', - metric: 'clicked', - timestamp: 1585252451, + source: {}, }, ], method: 'POST', @@ -994,23 +1077,28 @@ export const data = [ name: 'customerio', description: 'test-16', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4C4HDQ77BCN0X23Z3WBE764', - object_type: 'slack', - metric: 'failed', - timestamp: 1585250350, + source: {}, }, ], method: 'POST', @@ -1055,22 +1143,27 @@ export const data = [ name: 'customerio', description: 'test-17', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 40, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgEBcRhIBqSrYcXDr2ks6Pj9', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4C4G1S04QCV1NASF4NWMQNR', - object_type: 'webhook', - metric: 'drafted', - timestamp: 1585250305, + source: {}, }, ], method: 'POST', @@ -1114,23 +1207,28 @@ export const data = [ name: 'customerio', description: 'test-18', module: 'source', - version: 'v0', + version: 'v2', 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", + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4TYA2KA9T0XGHCRJ784B774', - object_type: 'webhook', - metric: 'attempted', - timestamp: 1585747134, + source: {}, }, ], method: 'POST', @@ -1175,23 +1273,28 @@ export const data = [ name: 'customerio', description: 'test-19', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4C6EP0HCKRHKFARMZ5XEH7A', - object_type: 'webhook', - metric: 'sent', - timestamp: 1585252357, + source: {}, }, ], method: 'POST', @@ -1236,25 +1339,30 @@ export const data = [ name: 'customerio', description: 'test-20', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4C6F5N1Y54TVGJTN64Y1ZS9', - object_type: 'webhook', - metric: 'clicked', - timestamp: 1585252373, + source: {}, }, ], method: 'POST', @@ -1300,23 +1408,28 @@ export const data = [ name: 'customerio', description: 'test-21', module: 'source', - version: 'v0', + version: 'v2', 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 []', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4TY5FVB0ZQ4KVDKRME0XSYZ', - object_type: 'webhook', - metric: 'failed', - timestamp: 1585746984, + source: {}, }, ], method: 'POST', @@ -1361,30 +1474,35 @@ export const data = [ name: 'customerio', description: 'test-22', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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, + }), }, - event_id: '01E4V2SBHYK4TNTG8WKMP39G9S', - object_type: 'push', - metric: 'delivered', - timestamp: 1585751830, + source: {}, }, ], method: 'POST', @@ -1435,20 +1553,25 @@ export const data = [ name: 'customerio', description: 'test-23: email subscribed', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - customer_id: '0200102', - identifiers: { id: '0200102' }, - email_address: 'test@example.com', + request: { + body: JSON.stringify({ + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4C6P79C12J5A6KPE6XNFD', + object_type: 'email', + metric: 'subscribed', + timestamp: 1585250179, + }), }, - event_id: '01E4C4C6P79C12J5A6KPE6XNFD', - object_type: 'email', - metric: 'subscribed', - timestamp: 1585250179, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/facebook_lead_ads/data.ts b/test/integrations/sources/facebook_lead_ads/data.ts new file mode 100644 index 00000000000..e54d0662426 --- /dev/null +++ b/test/integrations/sources/facebook_lead_ads/data.ts @@ -0,0 +1,608 @@ +import utils from '../../../../src/v0/util'; + +const defaultMockFns = () => { + jest.spyOn(utils, 'generateUUID').mockReturnValue('dummy-anonymous-id-0-0'); +}; + +export const data = [ + { + name: 'facebook_lead_ads', + description: 'facebook lead ads with facebook_lead_id', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({ + available_at_this_time: ['2025-02-01T00:00:00+0530'], + city: ['Bengaluru'], + conditional_question_1: ['Sweatshirt'], + conditional_question_2: ['Black'], + conditional_question_3: ['Medium'], + country: ['IN'], + created_time: ['02/01/2025 10:20'], + date_of_birth: ['01/01/2000'], + facebook_lead_id: ['3960271960958574'], + first_name: ['Dummy'], + last_name: ['Name'], + military_status: ['na'], + phone_number: ['+910123456789'], + post_code: [200000], + relationship_status: ['na'], + 'short_answer_ques_1?': ['dummy short answer'], + state: ['Dummy State'], + street_address: ['Dummy Street'], + 'test_ques_1?': ['test ques'], + }), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { + name: 'FacebookLeadAds', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + address: { + city: 'Bengaluru', + country: 'IN', + postalCode: 200000, + state: 'Dummy State', + street: 'Dummy Street', + }, + available_at_this_time: '2025-02-01T00:00:00+0530', + birthday: '01/01/2000', + city: 'Bengaluru', + conditional_question_1: 'Sweatshirt', + conditional_question_2: 'Black', + conditional_question_3: 'Medium', + country: 'IN', + created_time: '02/01/2025 10:20', + date_of_birth: '01/01/2000', + facebook_lead_id: '3960271960958574', + firstName: 'Dummy', + first_name: 'Dummy', + lastName: 'Name', + last_name: 'Name', + military_status: 'na', + phone: '+910123456789', + phone_number: '+910123456789', + post_code: 200000, + relationship_status: 'na', + 'short_answer_ques_1?': 'dummy short answer', + state: 'Dummy State', + street_address: 'Dummy Street', + 'test_ques_1?': 'test ques', + }, + }, + integrations: { + FacebookLeadAds: false, + }, + originalTimestamp: '2025-02-01T10:20:00.000Z', + type: 'identify', + userId: '3960271960958574', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'facebook_lead_ads', + description: 'facebook lead ads with valid created_time', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({ + available_at_this_time: ['2025-02-01T00:00:00+0530'], + city: ['Bengaluru'], + conditional_question_1: ['Sweatshirt'], + conditional_question_2: ['Black'], + conditional_question_3: ['Medium'], + country: ['IN'], + created_time: ['02/01/2025 10:20'], + date_of_birth: ['01/01/2000'], + facebook_lead_id: ['3960271960958574'], + first_name: ['Dummy'], + id: ['3960271960958574'], + last_name: ['Name'], + military_status: ['na'], + phone_number: ['+910123456789'], + post_code: ['200000'], + relationship_status: ['na'], + 'short_answer_ques_1?': ['dummy short answer'], + state: ['Dummy State'], + street_address: ['Dummy Street'], + 'test_ques_1?': ['test ques'], + }), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { + name: 'FacebookLeadAds', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + address: { + city: 'Bengaluru', + country: 'IN', + postalCode: '200000', + state: 'Dummy State', + street: 'Dummy Street', + }, + available_at_this_time: '2025-02-01T00:00:00+0530', + birthday: '01/01/2000', + city: 'Bengaluru', + conditional_question_1: 'Sweatshirt', + conditional_question_2: 'Black', + conditional_question_3: 'Medium', + country: 'IN', + created_time: '02/01/2025 10:20', + date_of_birth: '01/01/2000', + facebook_lead_id: '3960271960958574', + firstName: 'Dummy', + first_name: 'Dummy', + id: '3960271960958574', + lastName: 'Name', + last_name: 'Name', + military_status: 'na', + phone: '+910123456789', + phone_number: '+910123456789', + post_code: '200000', + relationship_status: 'na', + 'short_answer_ques_1?': 'dummy short answer', + state: 'Dummy State', + street_address: 'Dummy Street', + 'test_ques_1?': 'test ques', + }, + }, + integrations: { + FacebookLeadAds: false, + }, + originalTimestamp: '2025-02-01T10:20:00.000Z', + type: 'identify', + userId: '3960271960958574', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'facebook_lead_ads', + description: 'facebook lead ads without userId', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({ + available_at_this_time: ['2025-02-01T00:00:00+0530'], + city: ['Bengaluru'], + conditional_question_1: ['Sweatshirt'], + conditional_question_2: ['Black'], + conditional_question_3: ['Medium'], + country: ['IN'], + created_time: ['02/01/2025 10:20'], + date_of_birth: ['01/01/2000'], + first_name: ['Dummy'], + last_name: ['Name'], + military_status: ['na'], + phone_number: ['+910123456789'], + post_code: ['200000'], + relationship_status: ['na'], + 'short_answer_ques_1?': ['dummy short answer'], + state: ['Dummy State'], + street_address: ['Dummy Street'], + 'test_ques_1?': ['test ques'], + }), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { + name: 'FacebookLeadAds', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + address: { + city: 'Bengaluru', + country: 'IN', + postalCode: '200000', + state: 'Dummy State', + street: 'Dummy Street', + }, + available_at_this_time: '2025-02-01T00:00:00+0530', + birthday: '01/01/2000', + city: 'Bengaluru', + conditional_question_1: 'Sweatshirt', + conditional_question_2: 'Black', + conditional_question_3: 'Medium', + country: 'IN', + created_time: '02/01/2025 10:20', + date_of_birth: '01/01/2000', + firstName: 'Dummy', + first_name: 'Dummy', + lastName: 'Name', + last_name: 'Name', + military_status: 'na', + phone: '+910123456789', + phone_number: '+910123456789', + post_code: '200000', + relationship_status: 'na', + 'short_answer_ques_1?': 'dummy short answer', + state: 'Dummy State', + street_address: 'Dummy Street', + 'test_ques_1?': 'test ques', + }, + }, + integrations: { + FacebookLeadAds: false, + }, + originalTimestamp: '2025-02-01T10:20:00.000Z', + anonymousId: 'dummy-anonymous-id-0-0', + type: 'identify', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'facebook_lead_ads', + description: 'facebook lead ads with invalid created_time', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({ + available_at_this_time: ['2025-02-01T00:00:00+0530'], + city: ['Bengaluru'], + conditional_question_1: ['Sweatshirt'], + conditional_question_2: ['Black'], + conditional_question_3: ['Medium'], + country: ['IN'], + created_time: ['02/01/2025 invalid 10:20'], + date_of_birth: ['01/01/2000'], + facebook_lead_id: ['3960271960958574'], + first_name: ['Dummy'], + id: ['3960271960958574'], + last_name: ['Name'], + military_status: ['na'], + phone_number: ['+910123456789'], + post_code: ['200000'], + relationship_status: ['na'], + 'short_answer_ques_1?': ['dummy short answer'], + state: ['Dummy State'], + street_address: ['Dummy Street'], + 'test_ques_1?': ['test ques'], + }), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { + name: 'FacebookLeadAds', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + address: { + city: 'Bengaluru', + country: 'IN', + postalCode: '200000', + state: 'Dummy State', + street: 'Dummy Street', + }, + available_at_this_time: '2025-02-01T00:00:00+0530', + birthday: '01/01/2000', + city: 'Bengaluru', + conditional_question_1: 'Sweatshirt', + conditional_question_2: 'Black', + conditional_question_3: 'Medium', + country: 'IN', + created_time: '02/01/2025 invalid 10:20', + date_of_birth: '01/01/2000', + facebook_lead_id: '3960271960958574', + firstName: 'Dummy', + first_name: 'Dummy', + id: '3960271960958574', + lastName: 'Name', + last_name: 'Name', + military_status: 'na', + phone: '+910123456789', + phone_number: '+910123456789', + post_code: '200000', + relationship_status: 'na', + 'short_answer_ques_1?': 'dummy short answer', + state: 'Dummy State', + street_address: 'Dummy Street', + 'test_ques_1?': 'test ques', + }, + }, + integrations: { + FacebookLeadAds: false, + }, + type: 'identify', + userId: '3960271960958574', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'facebook_lead_ads', + description: 'facebook lead ads with unavailable/null created_time', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({ + available_at_this_time: ['2025-02-01T00:00:00+0530'], + city: ['Bengaluru'], + conditional_question_1: ['Sweatshirt'], + conditional_question_2: ['Black'], + conditional_question_3: ['Medium'], + country: ['IN'], + date_of_birth: ['01/01/2000'], + facebook_lead_id: ['3960271960958574'], + first_name: ['Dummy'], + id: ['3960271960958574'], + last_name: ['Name'], + military_status: ['na'], + phone_number: ['+910123456789'], + post_code: ['200000'], + relationship_status: ['na'], + 'short_answer_ques_1?': ['dummy short answer'], + state: ['Dummy State'], + street_address: ['Dummy Street'], + 'test_ques_1?': ['test ques'], + }), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { + name: 'FacebookLeadAds', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + address: { + city: 'Bengaluru', + country: 'IN', + postalCode: '200000', + state: 'Dummy State', + street: 'Dummy Street', + }, + available_at_this_time: '2025-02-01T00:00:00+0530', + birthday: '01/01/2000', + city: 'Bengaluru', + conditional_question_1: 'Sweatshirt', + conditional_question_2: 'Black', + conditional_question_3: 'Medium', + country: 'IN', + date_of_birth: '01/01/2000', + facebook_lead_id: '3960271960958574', + firstName: 'Dummy', + first_name: 'Dummy', + id: '3960271960958574', + lastName: 'Name', + last_name: 'Name', + military_status: 'na', + phone: '+910123456789', + phone_number: '+910123456789', + post_code: '200000', + relationship_status: 'na', + 'short_answer_ques_1?': 'dummy short answer', + state: 'Dummy State', + street_address: 'Dummy Street', + 'test_ques_1?': 'test ques', + }, + }, + integrations: { + FacebookLeadAds: false, + }, + type: 'identify', + userId: '3960271960958574', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'facebook_lead_ads', + description: 'facebook lead ads with null payload', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify(null), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'input event must have at least one field', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'facebook_lead_ads', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'facebook_lead_ads', + description: 'facebook lead ads with empty payload', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({}), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'input event must have at least one field', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'facebook_lead_ads', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/formsort/data.ts b/test/integrations/sources/formsort/data.ts index ef275f6c1c4..854ba8a72e5 100644 --- a/test/integrations/sources/formsort/data.ts +++ b/test/integrations/sources/formsort/data.ts @@ -3,23 +3,28 @@ export const data = [ name: 'formsort', description: 'when we receive finalized as false', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - answers: { - yes: true, - enter_email: 'test@user.com', - enter_name: '2022-11-17', - yes_or_no: false, + request: { + body: JSON.stringify({ + 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', + }), }, - 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', + source: {}, }, ], method: 'POST', @@ -65,23 +70,28 @@ export const data = [ name: 'formsort', description: 'when we receive finalized as true', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - answers: { - yes: true, - enter_email: 'test@user.com', - enter_name: '2022-11-17', - yes_or_no: false, + request: { + body: JSON.stringify({ + 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', + }), }, - 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', + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/gainsightpx/data.ts b/test/integrations/sources/gainsightpx/data.ts index b0380015800..6f3bd56ee4a 100644 --- a/test/integrations/sources/gainsightpx/data.ts +++ b/test/integrations/sources/gainsightpx/data.ts @@ -3,95 +3,100 @@ export const data = [ name: 'gainsightpx', description: 'Identify Call', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - configId: '32f07727-d231-4c9d-881e-fb50b80bad63', + source: {}, }, ], method: 'POST', @@ -155,105 +160,110 @@ export const data = [ name: 'gainsightpx', description: 'Custom Track Call ', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - configId: '32f07727-d231-4c9d-881e-fb50b80bad63', + source: {}, }, ], method: 'POST', @@ -329,101 +339,106 @@ export const data = [ name: 'gainsightpx', description: 'Feedback Track Call ', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - configId: '32f07727-d231-4c9d-881e-fb50b80bad63', + source: {}, }, ], method: 'POST', @@ -500,96 +515,102 @@ export const data = [ name: 'gainsightpx', description: 'Feature Match Track Call ', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -660,95 +681,100 @@ export const data = [ name: 'gainsightpx', description: 'Segment Match Track Call and no userId and yes anonymousId as event.sessionId', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -819,22 +845,27 @@ export const data = [ name: 'gainsightpx', description: 'No Match Track Call ', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -853,6 +884,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'gainsightpx', workspaceId: 'Non determinable', }, statusCode: 400, @@ -865,115 +897,120 @@ export const data = [ name: 'gainsightpx', description: 'Survey Track Call -> Multi Question Survey ', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + ], + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1063,110 +1100,119 @@ export const data = [ name: 'gainsightpx', description: 'Survey Track Call -> NPS ', module: 'source', - version: 'v0', + version: 'v2', 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?', + request: { + body: JSON.stringify({ + 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?', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1228,7 +1274,11 @@ export const data = [ questionType: 'Open text question', score: 0, questionHtml: - '
\n
\n How was your experience?\n
\n
\n', + '
\n' + + '
\n' + + ' How was your experience?\n' + + '
\n' + + '
\n', questionText: 'How was your experience?', }, }, @@ -1249,103 +1299,108 @@ export const data = [ name: 'gainsightpx', description: 'Engagement Track Call ', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1420,120 +1475,125 @@ export const data = [ name: 'gainsightpx', description: 'SegmentIO S2S Track Call ', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', }, }, - 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', - }, + }), }, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/iterable/data.ts b/test/integrations/sources/iterable/data.ts index 8912c83434a..1f38695e5a0 100644 --- a/test/integrations/sources/iterable/data.ts +++ b/test/integrations/sources/iterable/data.ts @@ -3,23 +3,28 @@ export const data = [ name: 'iterable', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', 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: [], + request: { + body: JSON.stringify({ + 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: [], + }, + }), }, + source: {}, }, ], method: 'POST', @@ -67,22 +72,27 @@ export const data = [ name: 'iterable', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', 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: [], + request: { + body: JSON.stringify({ + 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: [], + }, + }), }, + source: {}, }, ], method: 'POST', @@ -101,6 +111,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'iterable', workspaceId: 'Non determinable', }, statusCode: 400, @@ -113,20 +124,25 @@ export const data = [ name: 'iterable', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -145,6 +161,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'iterable', workspaceId: 'Non determinable', }, statusCode: 400, @@ -157,10 +174,20 @@ export const data = [ name: 'iterable', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', input: { request: { - body: [{ email: 'test@rudderstack.com', eventName: 'inAppSendSkip' }], + body: [ + { + request: { + body: JSON.stringify({ + email: 'test@rudderstack.com', + eventName: 'inAppSendSkip', + }), + }, + source: {}, + }, + ], method: 'POST', headers: { 'Content-Type': 'application/json' }, }, @@ -195,30 +222,35 @@ export const data = [ name: 'iterable', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -273,30 +305,35 @@ export const data = [ name: 'iterable', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -351,39 +388,44 @@ export const data = [ name: 'iterable', description: 'test-6', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -447,30 +489,35 @@ export const data = [ name: 'iterable', description: 'test-7', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -525,34 +572,39 @@ export const data = [ name: 'iterable', description: 'test-8', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -611,20 +663,25 @@ export const data = [ name: 'iterable', description: 'test-9', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -669,23 +726,28 @@ export const data = [ name: 'iterable', description: 'test-10', module: 'source', - version: 'v0', + version: 'v2', 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: [], + request: { + body: JSON.stringify({ + 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: [], + }, + }), }, + source: {}, }, ], method: 'POST', @@ -733,35 +795,40 @@ export const data = [ name: 'iterable', description: 'test-11', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -821,40 +888,45 @@ export const data = [ name: 'iterable', description: 'test-12', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -918,18 +990,23 @@ export const data = [ name: 'iterable', description: 'test-13', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'inAppClick', + dataFields: { + email: 'docs@iterable.com', + createdAt: '2018-03-27 00:44:40 +00:00', + campaignId: 269450, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -953,7 +1030,10 @@ export const data = [ }, event: 'inAppClick', integrations: { Iterable: false }, - properties: { createdAt: '2018-03-27 00:44:40 +00:00', campaignId: 269450 }, + 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', @@ -969,18 +1049,23 @@ export const data = [ name: 'iterable', description: 'test-14', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'inAppOpen', + dataFields: { + email: 'docs@iterable.com', + createdAt: '2018-03-27 00:44:30 +00:00', + campaignId: 269450, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1004,7 +1089,10 @@ export const data = [ }, event: 'inAppOpen', integrations: { Iterable: false }, - properties: { createdAt: '2018-03-27 00:44:30 +00:00', campaignId: 269450 }, + 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', @@ -1020,34 +1108,39 @@ export const data = [ name: 'iterable', description: 'test-15', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'pushBounce', + dataFields: { + platformEndpoint: '', + 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, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1278,34 +1381,39 @@ export const data = [ name: 'iterable', description: 'test-18', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1364,36 +1472,41 @@ export const data = [ name: 'iterable', description: 'test-19', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1454,20 +1567,25 @@ export const data = [ name: 'iterable', description: 'test-20', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1512,36 +1630,41 @@ export const data = [ name: 'iterable', description: 'test-21', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1602,38 +1725,43 @@ export const data = [ name: 'iterable', description: 'test-22', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1696,34 +1824,39 @@ export const data = [ name: 'iterable', description: 'test-23', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1782,20 +1915,25 @@ export const data = [ name: 'iterable', description: 'test-24', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1840,34 +1978,39 @@ export const data = [ name: 'iterable', description: 'test-25', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1926,20 +2069,25 @@ export const data = [ name: 'iterable', description: 'test-26', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1984,34 +2132,39 @@ export const data = [ name: 'iterable', description: 'test-27', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -2070,37 +2223,42 @@ export const data = [ name: 'iterable', description: 'test-28', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -2162,20 +2320,25 @@ export const data = [ name: 'iterable', description: 'test-29', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/mailjet/data.ts b/test/integrations/sources/mailjet/data.ts index 2a8f3eaf460..2654edb8055 100644 --- a/test/integrations/sources/mailjet/data.ts +++ b/test/integrations/sources/mailjet/data.ts @@ -3,25 +3,30 @@ export const data = [ name: 'mailjet', description: 'MailJet email open event', module: 'source', - version: 'v0', + version: 'v2', 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: '', + request: { + body: JSON.stringify({ + 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: '', + }), + }, + source: {}, }, ], method: 'POST', @@ -69,23 +74,28 @@ export const data = [ name: 'mailjet', description: 'MailJet email bounce event where input event is of type ', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -110,7 +120,10 @@ export const data = [ integrations: { MailJet: false }, type: 'track', event: 'bounce', - properties: { customcampaign: 'mj.nl=58486', mj_campaign_id: 108892 }, + properties: { + customcampaign: 'mj.nl=58486', + mj_campaign_id: 108892, + }, originalTimestamp: '2022-09-29T09:36:11.000Z', userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', }, @@ -125,21 +138,26 @@ export const data = [ name: 'mailjet', description: 'MailJet email sent event', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -164,7 +182,10 @@ export const data = [ integrations: { MailJet: false }, type: 'track', event: 'sent', - properties: { customcampaign: 'mj.nl=58486', mj_campaign_id: 108892 }, + properties: { + customcampaign: 'mj.nl=58486', + mj_campaign_id: 108892, + }, originalTimestamp: '2022-09-29T09:36:11.000Z', userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', }, @@ -179,23 +200,28 @@ export const data = [ name: 'mailjet', description: 'MailJet email bounce event', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -220,7 +246,10 @@ export const data = [ integrations: { MailJet: false }, type: 'track', event: 'bounce', - properties: { customcampaign: 'mj.nl=58486', mj_campaign_id: 108892 }, + properties: { + customcampaign: 'mj.nl=58486', + mj_campaign_id: 108892, + }, originalTimestamp: '2022-09-29T09:36:10.000Z', userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', }, @@ -235,23 +264,28 @@ export const data = [ name: 'mailjet', description: 'MailJet when no email is present', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -275,7 +309,10 @@ export const data = [ integrations: { MailJet: false }, type: 'track', event: 'bounce', - properties: { customcampaign: 'mj.nl=58486', mj_campaign_id: 108892 }, + properties: { + customcampaign: 'mj.nl=58486', + mj_campaign_id: 108892, + }, originalTimestamp: '2022-09-29T09:36:10.000Z', }, ], @@ -289,37 +326,44 @@ export const data = [ name: 'mailjet', description: 'MailJet Multiple payloads in single request', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify([ + { + 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', + }, + ]), + }, + source: {}, }, ], method: 'POST', @@ -356,12 +400,6 @@ export const data = [ userId: '593a5aff0b445b3b77a6d9676b7ec86e', originalTimestamp: '2024-01-05T12:34:00.000Z', }, - ], - }, - }, - { - output: { - batch: [ { context: { library: { name: 'unknown', version: 'unknown' }, diff --git a/test/integrations/sources/mailmodo/data.ts b/test/integrations/sources/mailmodo/data.ts index aa34363831c..0b6d857dcf0 100644 --- a/test/integrations/sources/mailmodo/data.ts +++ b/test/integrations/sources/mailmodo/data.ts @@ -3,21 +3,26 @@ export const data = [ name: 'mailmodo', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', 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: {}, + request: { + body: JSON.stringify({ + 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: {}, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -36,7 +41,10 @@ export const data = [ anonymousId: 'f43848cce166e51b097cbed2851adc16ed9d4c341928f1c790215c50cefb59b0', context: { externalId: [ - { id: 'd3775892hvh4f2f-b9d5-e49810eb2cae', type: 'mailmodoUserId' }, + { + id: 'd3775892hvh4f2f-b9d5-e49810eb2cae', + type: 'mailmodoUserId', + }, ], traits: { email: 'gouhgc@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -63,27 +71,37 @@ export const data = [ name: 'mailmodo', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -138,19 +156,24 @@ export const data = [ name: 'mailmodo', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', 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: {}, + request: { + body: JSON.stringify({ + triggerData: { + data: {}, + triggerSource: 'Manual Add To List', + email: 'gou****@mailmodo.com', + userId: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + journeyId: '349e986e-f56c-****-bc3b-b5f13c3e34da', + eventProperty: {}, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -169,7 +192,10 @@ export const data = [ anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', context: { externalId: [ - { id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', type: 'mailmodoUserId' }, + { + id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + type: 'mailmodoUserId', + }, ], traits: { email: 'gou****@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -194,19 +220,24 @@ export const data = [ name: 'mailmodo', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', 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: {}, + request: { + body: JSON.stringify({ + triggerData: { + data: {}, + triggerSource: 'Dashboard-change in property: first_name', + email: 'gou****@mailmodo.com', + userId: 'cc56708d-****-****-8c07-a4bfa5a7b79b', + journeyId: 'a78d7221-de34-47d8-81c6-5ad70cf4ee38', + eventProperty: {}, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -225,7 +256,10 @@ export const data = [ anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', context: { externalId: [ - { id: 'cc56708d-****-****-8c07-a4bfa5a7b79b', type: 'mailmodoUserId' }, + { + id: 'cc56708d-****-****-8c07-a4bfa5a7b79b', + type: 'mailmodoUserId', + }, ], traits: { email: 'gou****@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -250,31 +284,41 @@ export const data = [ name: 'mailmodo', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', 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: {}, + request: { + body: JSON.stringify({ + 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: {}, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -293,7 +337,10 @@ export const data = [ anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', context: { externalId: [ - { id: '11bff3e8-****-4e93-a533-fd8f9defc768', type: 'mailmodoUserId' }, + { + id: '11bff3e8-****-4e93-a533-fd8f9defc768', + type: 'mailmodoUserId', + }, ], traits: { email: 'gou****@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -328,25 +375,30 @@ export const data = [ name: 'mailmodo', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -365,7 +417,10 @@ export const data = [ anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', context: { externalId: [ - { id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', type: 'mailmodoUserId' }, + { + id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + type: 'mailmodoUserId', + }, ], traits: { email: 'gou****@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -395,19 +450,24 @@ export const data = [ name: 'mailmodo', description: 'test-6', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - triggerData: { - email: 'gou****@mailmodo.com', - data: {}, - userId: 'd3775892-****-4f2f-b9d5-e49810eb2cae', - journeyId: 'b1ee6bf6-****-4b5a-b7b5-0637853cd8c3', - triggerSource: 'Api', - eventProperty: {}, + request: { + body: JSON.stringify({ + triggerData: { + email: 'gou****@mailmodo.com', + data: {}, + userId: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + journeyId: 'b1ee6bf6-****-4b5a-b7b5-0637853cd8c3', + triggerSource: 'Api', + eventProperty: {}, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -426,7 +486,10 @@ export const data = [ anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', context: { externalId: [ - { id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', type: 'mailmodoUserId' }, + { + id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + type: 'mailmodoUserId', + }, ], traits: { email: 'gou****@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -451,24 +514,29 @@ export const data = [ name: 'mailmodo', description: 'test-7', module: 'source', - version: 'v0', + version: 'v2', 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: {}, + request: { + body: JSON.stringify({ + 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', + }), }, - lastCampaignEmailRef: '064c76e7-****-4780-a001-226c066aaa12', - lastCampaignId: '31422f76-****-4a72-a630-dd6f9f615bc3', + source: {}, }, ], method: 'POST', @@ -487,7 +555,10 @@ export const data = [ anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', context: { externalId: [ - { id: 'cc56708d-****-4fea-8c07-a4bfa5a7b79b', type: 'mailmodoUserId' }, + { + id: 'cc56708d-****-4fea-8c07-a4bfa5a7b79b', + type: 'mailmodoUserId', + }, ], traits: { email: 'gou****@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -517,27 +588,37 @@ export const data = [ name: 'mailmodo', description: 'test-8', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -557,7 +638,10 @@ export const data = [ context: { integration: { name: 'Mailmodo', version: '1.0.0' }, library: { name: 'unknown', version: 'unknown' }, - traits: { email: 'test@rudderstack.com', first_name: 'abcda' }, + traits: { + email: 'test@rudderstack.com', + first_name: 'abcda', + }, }, event: 'Form Submitted', integrations: { Mailmodo: false }, diff --git a/test/integrations/sources/moengage/data.ts b/test/integrations/sources/moengage/data.ts index c307959121f..50c127f4830 100644 --- a/test/integrations/sources/moengage/data.ts +++ b/test/integrations/sources/moengage/data.ts @@ -1,132 +1,126 @@ -const data = [ +export const data = [ { name: 'moengage', description: 'Simple track call', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - anonymousId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', - channel: 'web', - context: { - timezone: 'Wrong/Timezone', - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.1.6', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.1.6', - }, - locale: 'en-GB', - os: { - name: '', - version: '', - }, - page: { - path: '/testing/script-test.html', - referrer: '', - search: '', - title: '', - url: 'http://localhost:3243/testing/script-test.html', - }, - screen: { - density: 2, - }, - traits: { - company: { - id: 'abc123', - }, - createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', - email: 'rudderTest@gmail.com', - name: 'Rudder Test', - plan: 'Enterprise', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', - }, - event: 'Order Completed', - integrations: { - All: true, - }, - messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', - originalTimestamp: '2020-10-16T08:10:12.782Z', - properties: { - checkout_id: 'what is checkout id here??', - coupon: 'APPARELSALE', - currency: 'GBP', - order_id: 'transactionId', - products: [ - { - brand: '', - category: 'Merch', - currency: 'GBP', - image_url: 'https://www.example.com/product/bacon-jam.jpg', - name: 'Food/Drink', - position: 1, - price: 3, - product_id: 'product-bacon-jam', - quantity: 2, - sku: 'sku-1', - typeOfProduct: 'Food', - url: 'https://www.example.com/product/bacon-jam', - value: 6, - variant: 'Extra topped', - }, - { - brand: 'Levis', - category: 'Merch', - currency: 'GBP', - image_url: 'https://www.example.com/product/t-shirt.jpg', - name: 'T-Shirt', - position: 2, - price: 12.99, - product_id: 'product-t-shirt', - quantity: 1, - sku: 'sku-2', - typeOfProduct: 'Shirt', - url: 'https://www.example.com/product/t-shirt', - value: 12.99, - variant: 'White', + request: { + body: JSON.stringify({ + anonymousId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + channel: 'web', + context: { + timezone: 'Wrong/Timezone', + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.6', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.6', + }, + locale: 'en-GB', + os: { name: '', version: '' }, + page: { + path: '/testing/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:3243/testing/script-test.html', + }, + screen: { density: 2 }, + traits: { + company: { id: 'abc123' }, + createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', + email: 'rudderTest@gmail.com', + name: 'Rudder Test', + plan: 'Enterprise', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', }, - { - brand: 'Levis', - category: 'Merch', + event: 'Order Completed', + integrations: { All: true }, + messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', + originalTimestamp: '2020-10-16T08:10:12.782Z', + properties: { + checkout_id: 'what is checkout id here??', coupon: 'APPARELSALE', currency: 'GBP', - image_url: 'https://www.example.com/product/offer-t-shirt.jpg', - name: 'T-Shirt-on-offer', - position: 1, - price: 12.99, - product_id: 'offer-t-shirt', - quantity: 1, - sku: 'sku-3', - typeOfProduct: 'Shirt', - url: 'https://www.example.com/product/offer-t-shirt', - value: 12.99, - variant: 'Black', + order_id: 'transactionId', + products: [ + { + brand: '', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + name: 'Food/Drink', + position: 1, + price: 3, + product_id: 'product-bacon-jam', + quantity: 2, + sku: 'sku-1', + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + value: 6, + variant: 'Extra topped', + }, + { + brand: 'Levis', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/t-shirt.jpg', + name: 'T-Shirt', + position: 2, + price: 12.99, + product_id: 'product-t-shirt', + quantity: 1, + sku: 'sku-2', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/t-shirt', + value: 12.99, + variant: 'White', + }, + { + brand: 'Levis', + category: 'Merch', + coupon: 'APPARELSALE', + currency: 'GBP', + image_url: 'https://www.example.com/product/offer-t-shirt.jpg', + name: 'T-Shirt-on-offer', + position: 1, + price: 12.99, + product_id: 'offer-t-shirt', + quantity: 1, + sku: 'sku-3', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/offer-t-shirt', + value: 12.99, + variant: 'Black', + }, + ], + revenue: 31.98, + shipping: 4, + value: 31.98, }, - ], - revenue: 31.98, - shipping: 4, - value: 31.98, + 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', + userId: 'rudder123', + }), }, - 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', - userId: 'rudder123', + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -153,10 +147,7 @@ const data = [ version: '1.1.6', }, locale: 'en-GB', - os: { - name: '', - version: '', - }, + os: { name: '', version: '' }, page: { path: '/testing/script-test.html', referrer: '', @@ -164,13 +155,9 @@ const data = [ title: '', url: 'http://localhost:3243/testing/script-test.html', }, - screen: { - density: 2, - }, + screen: { density: 2 }, traits: { - company: { - id: 'abc123', - }, + company: { id: 'abc123' }, createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', email: 'rudderTest@gmail.com', name: 'Rudder Test', @@ -180,9 +167,7 @@ const data = [ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', }, event: 'Order Completed', - integrations: { - All: true, - }, + integrations: { All: true }, messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', originalTimestamp: '2020-10-16T08:10:12.782Z', properties: { @@ -263,204 +248,196 @@ const data = [ name: 'moengage', description: 'Batch of events', module: 'source', - version: 'v0', + version: 'v2', overrideReceivedAt: true, overrideRequestIP: true, input: { request: { body: [ { - batch: [ - { - type: 'page', - event: 'home', - sentAt: '2020-11-12T21:12:54.117Z', - userId: 'sajal', - channel: 'mobile', - context: { - traits: {}, - library: { - name: 'rudder-sdk-ruby-sync', - version: '1.0.7', - }, - page: { - path: '/Rectified.html', - referrer: 'http://localhost:1112/', - search: '', - title: '', - url: 'http://localhost:1112/Rectified.html', - }, - userAgent: - 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.3.0.QFKINXM)', - }, - rudderId: 'asdfasdfsadf', - properties: { - name: 'asdfsadf', - }, - timestamp: '2020-11-12T21:12:41.320Z', - anonymousId: '123123123123', - }, - { - anonymousId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', - channel: 'web', - context: { - timezone: 'Asia/Tokyo', - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.1.6', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.1.6', - }, - locale: 'en-GB', - os: { - name: '', - version: '', - }, - page: { - path: '/testing/script-test.html', - referrer: '', - search: '', - title: '', - url: 'http://localhost:3243/testing/script-test.html', - }, - screen: { - density: 2, - }, - traits: { - company: { - id: 'abc123', + request: { + body: JSON.stringify({ + batch: [ + { + type: 'page', + event: 'home', + sentAt: '2020-11-12T21:12:54.117Z', + userId: 'sajal', + channel: 'mobile', + context: { + traits: {}, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.7', + }, + page: { + path: '/Rectified.html', + referrer: 'http://localhost:1112/', + search: '', + title: '', + url: 'http://localhost:1112/Rectified.html', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.3.0.QFKINXM)', }, - createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', - email: 'rudderTest@gmail.com', - name: 'Rudder Test', - plan: 'Enterprise', + rudderId: 'asdfasdfsadf', + properties: { name: 'asdfsadf' }, + timestamp: '2020-11-12T21:12:41.320Z', + anonymousId: '123123123123', }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', - }, - event: 'Order Completed', - integrations: { - All: true, - }, - messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', - originalTimestamp: '2020-10-16T08:10:12.782Z', - properties: { - checkout_id: 'what is checkout id here??', - coupon: 'APPARELSALE', - currency: 'GBP', - order_id: 'transactionId', - category: 'some category', - originalArray: [ - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - ], - products: [ - { - brand: '', - category: 'Merch', - currency: 'GBP', - image_url: 'https://www.example.com/product/bacon-jam.jpg', - name: 'Food/Drink', - position: 1, - price: 3, - product_id: 'product-bacon-jam', - quantity: 2, - sku: 'sku-1', - typeOfProduct: 'Food', - url: 'https://www.example.com/product/bacon-jam', - value: 6, - variant: 'Extra topped', - }, - { - brand: 'Levis', - category: 'Merch', - currency: 'GBP', - image_url: 'https://www.example.com/product/t-shirt.jpg', - name: 'T-Shirt', - position: 2, - price: 12.99, - product_id: 'product-t-shirt', - quantity: 1, - sku: 'sku-2', - typeOfProduct: 'Shirt', - url: 'https://www.example.com/product/t-shirt', - value: 12.99, - variant: 'White', + { + anonymousId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + channel: 'web', + context: { + timezone: 'Asia/Tokyo', + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.6', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.6', + }, + locale: 'en-GB', + os: { name: '', version: '' }, + page: { + path: '/testing/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:3243/testing/script-test.html', + }, + screen: { density: 2 }, + traits: { + company: { id: 'abc123' }, + createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', + email: 'rudderTest@gmail.com', + name: 'Rudder Test', + plan: 'Enterprise', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', }, - { - brand: 'Levis', - category: 'Merch', + event: 'Order Completed', + integrations: { All: true }, + messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', + originalTimestamp: '2020-10-16T08:10:12.782Z', + properties: { + checkout_id: 'what is checkout id here??', coupon: 'APPARELSALE', currency: 'GBP', - image_url: 'https://www.example.com/product/offer-t-shirt.jpg', - name: 'T-Shirt-on-offer', - position: 1, - price: 12.99, - product_id: 'offer-t-shirt', - quantity: 1, - sku: 'sku-3', - typeOfProduct: 'Shirt', - url: 'https://www.example.com/product/offer-t-shirt', - value: 12.99, - variant: 'Black', + order_id: 'transactionId', + category: 'some category', + originalArray: [ + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + ], + products: [ + { + brand: '', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + name: 'Food/Drink', + position: 1, + price: 3, + product_id: 'product-bacon-jam', + quantity: 2, + sku: 'sku-1', + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + value: 6, + variant: 'Extra topped', + }, + { + brand: 'Levis', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/t-shirt.jpg', + name: 'T-Shirt', + position: 2, + price: 12.99, + product_id: 'product-t-shirt', + quantity: 1, + sku: 'sku-2', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/t-shirt', + value: 12.99, + variant: 'White', + }, + { + brand: 'Levis', + category: 'Merch', + coupon: 'APPARELSALE', + currency: 'GBP', + image_url: 'https://www.example.com/product/offer-t-shirt.jpg', + name: 'T-Shirt-on-offer', + position: 1, + price: 12.99, + product_id: 'offer-t-shirt', + quantity: 1, + sku: 'sku-3', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/offer-t-shirt', + value: 12.99, + variant: 'Black', + }, + ], + revenue: 31.98, + shipping: 4, + value: 31.98, }, - ], - revenue: 31.98, - shipping: 4, - value: 31.98, - }, - 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', - userId: 'rudder123', - }, - ], + 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', + userId: 'rudder123', + }, + ], + }), + }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -479,10 +456,7 @@ const data = [ channel: 'mobile', context: { traits: {}, - library: { - name: 'rudder-sdk-ruby-sync', - version: '1.0.7', - }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.7' }, page: { path: '/Rectified.html', referrer: 'http://localhost:1112/', @@ -494,9 +468,7 @@ const data = [ 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.3.0.QFKINXM)', }, rudderId: 'asdfasdfsadf', - properties: { - name: 'asdfsadf', - }, + properties: { name: 'asdfsadf' }, timestamp: '2020-11-12T21:12:41.320Z', anonymousId: '123123123123', }, @@ -516,10 +488,7 @@ const data = [ version: '1.1.6', }, locale: 'en-GB', - os: { - name: '', - version: '', - }, + os: { name: '', version: '' }, page: { path: '/testing/script-test.html', referrer: '', @@ -527,13 +496,9 @@ const data = [ title: '', url: 'http://localhost:3243/testing/script-test.html', }, - screen: { - density: 2, - }, + screen: { density: 2 }, traits: { - company: { - id: 'abc123', - }, + company: { id: 'abc123' }, createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', email: 'rudderTest@gmail.com', name: 'Rudder Test', @@ -543,9 +508,7 @@ const data = [ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', }, event: 'Order Completed', - integrations: { - All: true, - }, + integrations: { All: true }, messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', originalTimestamp: '2020-10-16T08:10:12.782Z', properties: { @@ -662,7 +625,3 @@ const data = [ }, }, ]; - -module.exports = { - data, -}; diff --git a/test/integrations/sources/monday/data.ts b/test/integrations/sources/monday/data.ts index 1bb26930901..a57794ca40d 100644 --- a/test/integrations/sources/monday/data.ts +++ b/test/integrations/sources/monday/data.ts @@ -3,28 +3,33 @@ export const data = [ name: 'monday', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -78,23 +83,28 @@ export const data = [ name: 'monday', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -143,39 +153,48 @@ export const data = [ name: 'monday', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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', }, - 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', + }), }, + source: {}, }, ], method: 'POST', @@ -206,7 +225,11 @@ export const data = [ label: { text: 'Done', index: 1, - style: { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + style: { + color: '#00c875', + border: '#00B461', + var_name: 'green-shadow', + }, is_done: true, }, post_id: null, @@ -240,25 +263,30 @@ export const data = [ name: 'monday', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -309,31 +337,36 @@ export const data = [ name: 'monday', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -390,23 +423,28 @@ export const data = [ name: 'monday', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, + }), }, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/olark/data.ts b/test/integrations/sources/olark/data.ts index 3486e849076..f3262dc1a28 100644 --- a/test/integrations/sources/olark/data.ts +++ b/test/integrations/sources/olark/data.ts @@ -3,34 +3,42 @@ export const data = [ name: 'olark', description: 'Olark webhook response', module: 'source', - version: 'v0', + version: 'v2', 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/', + request: { + body: JSON.stringify({ + kind: 'Conversation', + id: 'ho6HrHxoabmm6q0G103JU0JFaor0BobA', + manuallySubmitted: false, + items: [ + { + kind: 'OfflineMessage', + timestamp: '1669285628.796693', + body: + 'name: test rudderlabs\n' + + 'email: ruddertest@gmail.com\n' + + 'Message: 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/', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -53,7 +61,11 @@ export const data = [ context: { os: { name: 'Macintosh' }, page: { url: 'http://localhost:5503/' }, - traits: { name: 'test', email: 'ruddertest@gmail.com', country: 'India' }, + 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' }, @@ -62,7 +74,10 @@ export const data = [ tags: [], items: [ { - body: 'name: test rudderlabs\nemail: ruddertest@gmail.com\nMessage: I am Fine', + body: + 'name: test rudderlabs\n' + + 'email: ruddertest@gmail.com\n' + + 'Message: I am Fine', kind: 'OfflineMessage', timestamp: '1669285628.796693', }, @@ -81,58 +96,68 @@ export const data = [ name: 'olark', description: 'Olark webhook response', module: 'source', - version: 'v0', + version: 'v2', 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', - }, + request: { + body: JSON.stringify({ + 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', + }, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -162,7 +187,10 @@ export const data = [ userId: 'NOTAREALVISITORIDS5LGl6QUrK2OaPP', context: { os: { name: 'Windows' }, - page: { url: 'http://www.olark.com', referrer: 'http://www.olark.com' }, + page: { + url: 'http://www.olark.com', + referrer: 'http://www.olark.com', + }, traits: { city: 'San Francisco', name: 'Olark', @@ -207,35 +235,47 @@ export const data = [ name: 'olark', description: 'Olark webhook response', module: 'source', - version: 'v0', + version: 'v2', 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/', + request: { + body: JSON.stringify({ + kind: 'Conversation', + id: 'ho6HrHxoabmm6q0G103JU0JFaor0BobA', + manuallySubmitted: false, + items: [ + { + kind: 'OfflineMessage', + timestamp: '1669288532.567071', + body: + 'name: test rudderstack\n' + 'email: rudder14@gmail.com\n' + 'Message: 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/', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -271,7 +311,10 @@ export const data = [ tags: [], items: [ { - body: 'name: test rudderstack\nemail: rudder14@gmail.com\nMessage: veavv', + body: + 'name: test rudderstack\n' + + 'email: rudder14@gmail.com\n' + + 'Message: veavv', kind: 'OfflineMessage', timestamp: '1669288532.567071', }, diff --git a/test/integrations/sources/ortto/data.ts b/test/integrations/sources/ortto/data.ts index 6feed3f43a3..a46351d8103 100644 --- a/test/integrations/sources/ortto/data.ts +++ b/test/integrations/sources/ortto/data.ts @@ -9,33 +9,36 @@ export const data = [ name: 'ortto', description: 'Simple track call', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - activity: { - id: '00651b946bfef7e80478efee', - field_id: 'act::s-all', - created: '2023-10-03T04:11:23Z', - attr: { - 'str::is': 'API', - 'str::s-ctx': 'Subscribed via API', - }, - }, - contact: { - contact_id: '00651b946baa9be6b2edad00', - email: 'abhi@example.com', + request: { + body: JSON.stringify({ + activity: { + id: '00651b946bfef7e80478efee', + field_id: 'act::s-all', + created: '2023-10-03T04:11:23Z', + attr: { + 'str::is': 'API', + 'str::s-ctx': 'Subscribed via API', + }, + }, + contact: { + contact_id: '00651b946baa9be6b2edad00', + email: 'abhi@example.com', + }, + id: '00651b946cef87c7af64f4f3', + time: '2023-10-03T04:11:24.25726779Z', + webhook_id: '651b8aec8002153e16319fd3', + }), }, - id: '00651b946cef87c7af64f4f3', - time: '2023-10-03T04:11:24.25726779Z', - webhook_id: '651b8aec8002153e16319fd3', + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -78,65 +81,62 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'ortto', description: 'Simple track call', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - activity: { - id: '00651b946bfef7e80478efee', - field_id: 'act::s-all', - created: '2023-10-03T04:11:23Z', - attr: { - 'str::is': 'API', - 'str::s-ctx': 'Subscribed via API', - }, - }, - contact: { - external_id: 'user_x', - city: { - name: 'Kolkata', - id: 0, - lat: 37751000, - lng: -97822000, - }, - country: { - name: 'United States', - id: 6252001, - lat: 0, - lng: 0, - }, - email: 'xyz@email.com', - first_name: 'Ujjwal', - last_name: 'Ujjwal', - birthday: { - year: 1980, - month: 12, - day: 11, - timezone: 'Australia/Sydney', - }, - phone_number: { - c: '91', - n: '401234567', - }, + request: { + body: JSON.stringify({ + activity: { + id: '00651b946bfef7e80478efee', + field_id: 'act::s-all', + created: '2023-10-03T04:11:23Z', + attr: { + 'str::is': 'API', + 'str::s-ctx': 'Subscribed via API', + }, + }, + contact: { + external_id: 'user_x', + city: { + name: 'Kolkata', + id: 0, + lat: 37751000, + lng: -97822000, + }, + country: { + name: 'United States', + id: 6252001, + lat: 0, + lng: 0, + }, + email: 'xyz@email.com', + first_name: 'Ujjwal', + last_name: 'Ujjwal', + birthday: { + year: 1980, + month: 12, + day: 11, + timezone: 'Australia/Sydney', + }, + phone_number: { c: '91', n: '401234567' }, + }, + id: '00651b946cef87c7af64f4f3', + time: '2023-10-03T04:11:24.25726779Z', + webhook_id: '651b8aec8002153e16319fd3', + }), }, - id: '00651b946cef87c7af64f4f3', - time: '2023-10-03T04:11:24.25726779Z', - webhook_id: '651b8aec8002153e16319fd3', + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -158,10 +158,7 @@ export const data = [ firstName: 'Ujjwal', lastName: 'Ujjwal', phone: '91401234567', - address: { - city: 'Kolkata', - country: 'United States', - }, + address: { city: 'Kolkata', country: 'United States' }, }, }, event: 'Resubscribe globally', @@ -190,66 +187,63 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'ortto', description: 'Simple track call with unknown field id', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - activity: { - id: '00651b946bfef7e80478efee', - field_id: 'act::s-ccc', - created: '2023-10-03T04:11:23Z', - attr: { - 'str::is': 'API', - 'str::s-ctx': 'Subscribed via API', - }, - }, - contact: { - external_id: 'user_x', - city: { - name: 'Kolkata', - id: 0, - lat: 37751000, - lng: -97822000, - }, - contact_id: '006524f0b8d370050056e400', - country: { - name: 'United States', - id: 6252001, - lat: 0, - lng: 0, - }, - email: 'xyz@email.com', - first_name: 'Ujjwal', - last_name: 'Ujjwal', - birthday: { - year: 1980, - month: 3, - day: 4, - timezone: 'Australia/Sydney', - }, - phone_number: { - c: '91', - n: '401234567', - }, + request: { + body: JSON.stringify({ + activity: { + id: '00651b946bfef7e80478efee', + field_id: 'act::s-ccc', + created: '2023-10-03T04:11:23Z', + attr: { + 'str::is': 'API', + 'str::s-ctx': 'Subscribed via API', + }, + }, + contact: { + external_id: 'user_x', + city: { + name: 'Kolkata', + id: 0, + lat: 37751000, + lng: -97822000, + }, + contact_id: '006524f0b8d370050056e400', + country: { + name: 'United States', + id: 6252001, + lat: 0, + lng: 0, + }, + email: 'xyz@email.com', + first_name: 'Ujjwal', + last_name: 'Ujjwal', + birthday: { + year: 1980, + month: 3, + day: 4, + timezone: 'Australia/Sydney', + }, + phone_number: { c: '91', n: '401234567' }, + }, + id: '00651b946cef87c7af64f4f3', + time: '2023-10-03T04:11:24.25726779Z', + webhook_id: '651b8aec8002153e16319fd3', + }), }, - id: '00651b946cef87c7af64f4f3', - time: '2023-10-03T04:11:24.25726779Z', - webhook_id: '651b8aec8002153e16319fd3', + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -277,10 +271,7 @@ export const data = [ firstName: 'Ujjwal', lastName: 'Ujjwal', phone: '91401234567', - address: { - city: 'Kolkata', - country: 'United States', - }, + address: { city: 'Kolkata', country: 'United States' }, }, }, event: 'custom event triggered', @@ -309,66 +300,63 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'ortto', description: 'Simple track call with unknown field id', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - activity: { - id: '00651b946bfef7e80478efee', - field_id: 'act::test_webhook', - created: '2023-10-03T04:11:23Z', - attr: { - 'str::is': 'API', - 'str::s-ctx': 'Subscribed via API', - }, - }, - contact: { - external_id: 'user_x', - city: { - name: 'Kolkata', - id: 0, - lat: 37751000, - lng: -97822000, - }, - contact_id: '006524f0b8d370050056e400', - country: { - name: 'United States', - id: 6252001, - lat: 0, - lng: 0, - }, - email: 'xyz@email.com', - first_name: 'Ujjwal', - last_name: 'Ujjwal', - birthday: { - year: 1980, - month: 3, - day: 4, - timezone: 'Australia/Sydney', - }, - phone_number: { - c: '91', - n: '401234567', - }, + request: { + body: JSON.stringify({ + activity: { + id: '00651b946bfef7e80478efee', + field_id: 'act::test_webhook', + created: '2023-10-03T04:11:23Z', + attr: { + 'str::is': 'API', + 'str::s-ctx': 'Subscribed via API', + }, + }, + contact: { + external_id: 'user_x', + city: { + name: 'Kolkata', + id: 0, + lat: 37751000, + lng: -97822000, + }, + contact_id: '006524f0b8d370050056e400', + country: { + name: 'United States', + id: 6252001, + lat: 0, + lng: 0, + }, + email: 'xyz@email.com', + first_name: 'Ujjwal', + last_name: 'Ujjwal', + birthday: { + year: 1980, + month: 3, + day: 4, + timezone: 'Australia/Sydney', + }, + phone_number: { c: '91', n: '401234567' }, + }, + id: '00651b946cef87c7af64f4f3', + time: '2023-10-03T04:11:24.25726779Z', + webhook_id: '651b8aec8002153e16319fd3', + }), }, - id: '00651b946cef87c7af64f4f3', - time: '2023-10-03T04:11:24.25726779Z', - webhook_id: '651b8aec8002153e16319fd3', + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -386,8 +374,10 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, -]; +].map((testCase) => ({ + ...testCase, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/pagerduty/data.ts b/test/integrations/sources/pagerduty/data.ts index fdfee6fc0d4..171dabf45b8 100644 --- a/test/integrations/sources/pagerduty/data.ts +++ b/test/integrations/sources/pagerduty/data.ts @@ -3,70 +3,78 @@ export const data = [ name: 'pagerduty', description: 'Incident Triggered', module: 'source', - version: 'v0', + version: 'v2', 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: [ - { + request: { + body: JSON.stringify({ + 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', }, - ], - 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', + 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, + }, }, - urgency: 'high', - conference_bridge: null, - resolve_reason: null, - }, + }), }, + source: {}, }, ], method: 'POST', @@ -145,7 +153,10 @@ export const data = [ 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', }, }, - client: { url: 'https://monitoring.service.com', name: 'Monitoring Service' }, + client: { + url: 'https://monitoring.service.com', + name: 'Monitoring Service', + }, resourceType: 'incident', }, integrations: { PagerDuty: false }, @@ -162,70 +173,75 @@ export const data = [ name: 'pagerduty', description: 'Incident Priority Updated', module: 'source', - version: 'v0', + version: 'v2', 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: [ - { + request: { + body: JSON.stringify({ + 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', }, - ], - 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', + 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, + }, }, - urgency: 'high', - conference_bridge: null, - resolve_reason: null, - }, + }), }, + source: {}, }, ], method: 'POST', @@ -320,45 +336,50 @@ export const data = [ name: 'pagerduty', description: 'Incident Responder Added', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }, }, - escalation_policy: null, - message: 'Please help with "Event Stream Failure"', - state: 'pending', - type: 'incident_responder', - }, + }), }, + source: {}, }, ], method: 'POST', @@ -426,70 +447,75 @@ export const data = [ name: 'pagerduty', description: 'Incident Escalated', module: 'source', - version: 'v0', + version: 'v2', 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: [ - { + request: { + body: JSON.stringify({ + 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', }, - ], - 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', + 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, + }, }, - urgency: 'high', - conference_bridge: null, - resolve_reason: null, - }, + }), }, + source: {}, }, ], method: 'POST', @@ -584,62 +610,67 @@ export const data = [ name: 'pagerduty', description: 'Incident Resolved', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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, + }, }, - urgency: 'high', - conference_bridge: { conference_number: '', conference_url: '' }, - resolve_reason: null, - }, + }), }, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/pipedream/data.ts b/test/integrations/sources/pipedream/data.ts index a4b5c33e0d5..a77cdea848b 100644 --- a/test/integrations/sources/pipedream/data.ts +++ b/test/integrations/sources/pipedream/data.ts @@ -3,15 +3,20 @@ export const data = [ name: 'pipedream', description: 'No type or userId is given', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - anonymousId: '63767499ca6fb1b7c988d5bb', - artist: 'Gautam', - genre: 'Jazz', - song: 'Take Five', + request: { + body: JSON.stringify({ + anonymousId: '63767499ca6fb1b7c988d5bb', + artist: 'Gautam', + genre: 'Jazz', + song: 'Take Five', + }), + }, + source: {}, }, ], method: 'POST', @@ -53,10 +58,22 @@ export const data = [ name: 'pipedream', description: 'No type or anonymousId is given', module: 'source', - version: 'v0', + version: 'v2', input: { request: { - body: [{ userId: '12', artist: 'Gautam', genre: 'Jazz', song: 'Take Five' }], + body: [ + { + request: { + body: JSON.stringify({ + userId: '12', + artist: 'Gautam', + genre: 'Jazz', + song: 'Take Five', + }), + }, + source: {}, + }, + ], method: 'POST', headers: { 'Content-Type': 'application/json' }, }, @@ -78,7 +95,12 @@ export const data = [ }, integrations: { PIPEDREAM: false }, type: 'track', - properties: { userId: '12', artist: 'Gautam', genre: 'Jazz', song: 'Take Five' }, + properties: { + userId: '12', + artist: 'Gautam', + genre: 'Jazz', + song: 'Take Five', + }, }, ], }, @@ -91,29 +113,39 @@ export const data = [ name: 'pipedream', description: 'Track Call -> type and userId is given', module: 'source', - version: 'v0', + version: 'v2', 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' }, + request: { + body: JSON.stringify({ + 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' }, + }), }, - type: 'track', - properties: { artist: 'John', Album: 'ABCD' }, + source: {}, }, ], method: 'POST', @@ -164,24 +196,29 @@ export const data = [ name: 'pipedream', description: 'Identify type -> type and userId is given', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - timestamp: '2020-09-29T14:50:29.907+05:30', - type: 'identify', + source: {}, }, ], method: 'POST', @@ -223,16 +260,21 @@ export const data = [ name: 'pipedream', description: 'Group type -> type and userId is given', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - userId: 'user123', - groupId: '17', - context: {}, - traits: { operation: 'add' }, - type: 'group', + request: { + body: JSON.stringify({ + userId: 'user123', + groupId: '17', + context: {}, + traits: { operation: 'add' }, + type: 'group', + }), + }, + source: {}, }, ], method: 'POST', @@ -265,24 +307,32 @@ export const data = [ name: 'pipedream', description: 'Page type -> type and userId is given', module: 'source', - version: 'v0', + version: 'v2', 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)', + request: { + body: JSON.stringify({ + 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: 'Home', - properties: { title: 'Home | RudderStack', url: 'http://www.rudderstack.com' }, - receivedAt: '2020-09-29T14:50:43.005+05:30', - type: 'page', + source: {}, }, ], method: 'POST', @@ -308,7 +358,10 @@ export const data = [ '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' }, + properties: { + title: 'Home | RudderStack', + url: 'http://www.rudderstack.com', + }, receivedAt: '2020-09-29T14:50:43.005+05:30', type: 'page', }, @@ -323,10 +376,21 @@ export const data = [ name: 'pipedream', description: 'Alias type -> type and userId is given', module: 'source', - version: 'v0', + version: 'v2', input: { request: { - body: [{ type: 'alias', previousId: 'name@surname.com', userId: '12345' }], + body: [ + { + request: { + body: JSON.stringify({ + type: 'alias', + previousId: 'name@surname.com', + userId: '12345', + }), + }, + source: {}, + }, + ], method: 'POST', headers: { 'Content-Type': 'application/json' }, }, @@ -339,7 +403,12 @@ export const data = [ { output: { batch: [ - { type: 'alias', previousId: 'name@surname.com', userId: '12345', context: {} }, + { + type: 'alias', + previousId: 'name@surname.com', + userId: '12345', + context: {}, + }, ], }, }, diff --git a/test/integrations/sources/refiner/data.ts b/test/integrations/sources/refiner/data.ts index 255004322c3..6986b847d97 100644 --- a/test/integrations/sources/refiner/data.ts +++ b/test/integrations/sources/refiner/data.ts @@ -3,106 +3,114 @@ export const data = [ name: 'refiner', description: 'Refiner webhook response', module: 'source', - version: 'v0', + version: 'v2', 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: [], + request: { + body: JSON.stringify({ + 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: [], + }, + }), }, + source: {}, }, ], method: 'POST', @@ -159,7 +167,9 @@ export const data = [ }, properties: { response: { - data: { why_did_you_cancel_your_subscription: 'Pricing' }, + data: { + why_did_you_cancel_your_subscription: 'Pricing', + }, tags: [], uuid: 'eb117cb0-49cf-11ed-b050-03a44b32151c', received_at: '2022-10-12T02:05:55.000000Z', @@ -202,113 +212,123 @@ export const data = [ name: 'refiner', description: 'Refiner webhook response', module: 'source', - version: 'v0', + version: 'v2', 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: [], + request: { + body: JSON.stringify({ + 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: [], + }, + }), }, + source: {}, }, ], method: 'POST', @@ -325,7 +345,9 @@ export const data = [ batch: [ { type: 'identify', - traits: { why_did_you_cancel_your_subscription: 'Missing features' }, + traits: { + why_did_you_cancel_your_subscription: 'Missing features', + }, userId: 'sdk@30', context: { traits: { @@ -365,7 +387,9 @@ export const data = [ }, properties: { response: { - data: { why_did_you_cancel_your_subscription: 'Missing features' }, + data: { + why_did_you_cancel_your_subscription: 'Missing features', + }, tags: [], uuid: '7c508c60-4ea2-11ed-9302-57708fe11d26', received_at: '2022-10-18T05:05:45.000000Z', diff --git a/test/integrations/sources/revenuecat/data.ts b/test/integrations/sources/revenuecat/data.ts index 2762bac5b27..e61c57fc8a5 100644 --- a/test/integrations/sources/revenuecat/data.ts +++ b/test/integrations/sources/revenuecat/data.ts @@ -9,67 +9,67 @@ export const data = [ name: 'revenuecat', description: 'Simple track call', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - api_version: '1.0', - event: { - aliases: [ - 'f8e14f51-0c76-49ba-8d67-c229f1875dd9', - '389ad6dd-bb40-4c03-9471-1353da2d55ec', - ], - app_user_id: 'f8e14f51-0c76-49ba-8d67-c229f1875dd9', - commission_percentage: null, - country_code: 'US', - currency: null, - entitlement_id: null, - entitlement_ids: null, - environment: 'SANDBOX', - event_timestamp_ms: 1698617217232, - expiration_at_ms: 1698624417232, - id: '8CF0CD6C-CAF3-41FB-968A-661938235AF0', - is_family_share: null, - offer_code: null, - original_app_user_id: 'f8e14f51-0c76-49ba-8d67-c229f1875dd9', - original_transaction_id: null, - period_type: 'NORMAL', - presented_offering_id: null, - price: null, - price_in_purchased_currency: null, - product_id: 'test_product', - purchased_at_ms: 1698617217232, - store: 'APP_STORE', - subscriber_attributes: { - $displayName: { - updated_at_ms: 1698617217232, - value: 'Mister Mistoffelees', - }, - $email: { - updated_at_ms: 1698617217232, - value: 'tuxedo@revenuecat.com', - }, - $phoneNumber: { - updated_at_ms: 1698617217232, - value: '+19795551234', - }, - my_custom_attribute_1: { - updated_at_ms: 1698617217232, - value: 'catnip', + request: { + body: JSON.stringify({ + api_version: '1.0', + event: { + aliases: [ + 'f8e14f51-0c76-49ba-8d67-c229f1875dd9', + '389ad6dd-bb40-4c03-9471-1353da2d55ec', + ], + app_user_id: 'f8e14f51-0c76-49ba-8d67-c229f1875dd9', + commission_percentage: null, + country_code: 'US', + currency: null, + entitlement_id: null, + entitlement_ids: null, + environment: 'SANDBOX', + event_timestamp_ms: 1698617217232, + expiration_at_ms: 1698624417232, + id: '8CF0CD6C-CAF3-41FB-968A-661938235AF0', + is_family_share: null, + offer_code: null, + original_app_user_id: 'f8e14f51-0c76-49ba-8d67-c229f1875dd9', + original_transaction_id: null, + period_type: 'NORMAL', + presented_offering_id: null, + price: null, + price_in_purchased_currency: null, + product_id: 'test_product', + purchased_at_ms: 1698617217232, + store: 'APP_STORE', + subscriber_attributes: { + $displayName: { + updated_at_ms: 1698617217232, + value: 'Mister Mistoffelees', + }, + $email: { + updated_at_ms: 1698617217232, + value: 'tuxedo@revenuecat.com', + }, + $phoneNumber: { + updated_at_ms: 1698617217232, + value: '+19795551234', + }, + my_custom_attribute_1: { updated_at_ms: 1698617217232, value: 'catnip' }, + }, + takehome_percentage: null, + tax_percentage: null, + transaction_id: null, + type: 'TEST', }, - }, - takehome_percentage: null, - tax_percentage: null, - transaction_id: null, - type: 'TEST', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -82,13 +82,8 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'RevenueCat', - }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'RevenueCat' }, externalId: [ { type: 'revenuecatAppUserId', @@ -96,9 +91,7 @@ export const data = [ }, ], }, - integrations: { - RevenueCat: false, - }, + integrations: { RevenueCat: false }, type: 'track', properties: { aliases: [ @@ -139,10 +132,7 @@ export const data = [ updated_at_ms: 1698617217232, value: '+19795551234', }, - my_custom_attribute_1: { - updated_at_ms: 1698617217232, - value: 'catnip', - }, + my_custom_attribute_1: { updated_at_ms: 1698617217232, value: 'catnip' }, }, takehomePercentage: null, taxPercentage: null, @@ -161,61 +151,58 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'revenuecat', description: 'Initial purchase event', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - api_version: '1.0', - event: { - aliases: ['yourCustomerAliasedID', 'yourCustomerAliasedID'], - app_id: 'yourAppID', - app_user_id: 'yourCustomerAppUserID', - commission_percentage: 0.3, - country_code: 'US', - currency: 'USD', - entitlement_id: 'pro_cat', - entitlement_ids: ['pro_cat'], - environment: 'PRODUCTION', - event_timestamp_ms: 1591121855319, - expiration_at_ms: 1591726653000, - id: 'UniqueIdentifierOfEvent', - is_family_share: false, - offer_code: 'free_month', - original_app_user_id: 'OriginalAppUserID', - original_transaction_id: '1530648507000', - period_type: 'NORMAL', - presented_offering_id: 'OfferingID', - price: 2.49, - price_in_purchased_currency: 2.49, - product_id: 'onemonth_no_trial', - purchased_at_ms: 1591121853000, - store: 'APP_STORE', - subscriber_attributes: { - '$Favorite Cat': { - updated_at_ms: 1581121853000, - value: 'Garfield', + request: { + body: JSON.stringify({ + api_version: '1.0', + event: { + aliases: ['yourCustomerAliasedID', 'yourCustomerAliasedID'], + app_id: 'yourAppID', + app_user_id: 'yourCustomerAppUserID', + commission_percentage: 0.3, + country_code: 'US', + currency: 'USD', + entitlement_id: 'pro_cat', + entitlement_ids: ['pro_cat'], + environment: 'PRODUCTION', + event_timestamp_ms: 1591121855319, + expiration_at_ms: 1591726653000, + id: 'UniqueIdentifierOfEvent', + is_family_share: false, + offer_code: 'free_month', + original_app_user_id: 'OriginalAppUserID', + original_transaction_id: '1530648507000', + period_type: 'NORMAL', + presented_offering_id: 'OfferingID', + price: 2.49, + price_in_purchased_currency: 2.49, + product_id: 'onemonth_no_trial', + purchased_at_ms: 1591121853000, + store: 'APP_STORE', + subscriber_attributes: { + '$Favorite Cat': { updated_at_ms: 1581121853000, value: 'Garfield' }, + }, + takehome_percentage: 0.7, + tax_percentage: 0.3, + transaction_id: '170000869511114', + type: 'INITIAL_PURCHASE', }, - }, - takehome_percentage: 0.7, - tax_percentage: 0.3, - transaction_id: '170000869511114', - type: 'INITIAL_PURCHASE', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -228,13 +215,8 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'RevenueCat', - }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'RevenueCat' }, externalId: [ { type: 'revenuecatAppUserId', @@ -242,9 +224,7 @@ export const data = [ }, ], }, - integrations: { - RevenueCat: false, - }, + integrations: { RevenueCat: false }, type: 'track', properties: { aliases: ['yourCustomerAliasedID', 'yourCustomerAliasedID'], @@ -293,59 +273,56 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'revenuecat', description: 'Purchase event with anonymous user', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - api_version: '1.0', - event: { - aliases: ['yourCustomerAliasedID', 'yourCustomerAliasedID'], - app_id: 'yourAppID', - commission_percentage: 0.3, - country_code: 'US', - currency: 'USD', - entitlement_id: 'pro_cat', - entitlement_ids: ['pro_cat'], - environment: 'PRODUCTION', - event_timestamp_ms: 1591121855319, - expiration_at_ms: 1591726653000, - id: 'UniqueIdentifierOfEvent', - is_family_share: false, - offer_code: 'free_month', - original_transaction_id: '1530648507000', - period_type: 'NORMAL', - presented_offering_id: 'OfferingID', - price: 2.49, - price_in_purchased_currency: 2.49, - product_id: 'onemonth_no_trial', - purchased_at_ms: 1591121853000, - store: 'APP_STORE', - subscriber_attributes: { - '$Favorite Cat': { - updated_at_ms: 1581121853000, - value: 'Garfield', + request: { + body: JSON.stringify({ + api_version: '1.0', + event: { + aliases: ['yourCustomerAliasedID', 'yourCustomerAliasedID'], + app_id: 'yourAppID', + commission_percentage: 0.3, + country_code: 'US', + currency: 'USD', + entitlement_id: 'pro_cat', + entitlement_ids: ['pro_cat'], + environment: 'PRODUCTION', + event_timestamp_ms: 1591121855319, + expiration_at_ms: 1591726653000, + id: 'UniqueIdentifierOfEvent', + is_family_share: false, + offer_code: 'free_month', + original_transaction_id: '1530648507000', + period_type: 'NORMAL', + presented_offering_id: 'OfferingID', + price: 2.49, + price_in_purchased_currency: 2.49, + product_id: 'onemonth_no_trial', + purchased_at_ms: 1591121853000, + store: 'APP_STORE', + subscriber_attributes: { + '$Favorite Cat': { updated_at_ms: 1581121853000, value: 'Garfield' }, + }, + takehome_percentage: 0.7, + tax_percentage: 0.3, + transaction_id: '170000869511114', + type: 'INITIAL_PURCHASE', }, - }, - takehome_percentage: 0.7, - tax_percentage: 0.3, - transaction_id: '170000869511114', - type: 'INITIAL_PURCHASE', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -358,17 +335,10 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'RevenueCat', - }, - }, - integrations: { - RevenueCat: false, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'RevenueCat' }, }, + integrations: { RevenueCat: false }, type: 'track', properties: { aliases: ['yourCustomerAliasedID', 'yourCustomerAliasedID'], @@ -416,8 +386,10 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, -]; +].map((testCase) => ({ + ...testCase, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/satismeter/data.ts b/test/integrations/sources/satismeter/data.ts index 713f527f2c9..625284ad027 100644 --- a/test/integrations/sources/satismeter/data.ts +++ b/test/integrations/sources/satismeter/data.ts @@ -3,108 +3,113 @@ export const data = [ name: 'satismeter', description: ' All fields Check with event as completed', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', }, - ], - 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', + }), }, - campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, - event: 'completed', + source: {}, }, ], method: 'POST', @@ -132,7 +137,10 @@ export const data = [ userDeleted: false, }, locale: 'en', - campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, + campaign: { + id: '6373271b764986ebee62bfca', + name: 'NPS Survey', + }, integration: { name: 'SATISMETER' }, location: { country: 'IN', @@ -217,106 +225,111 @@ export const data = [ description: ' Neither reponse.user.id or response.user.userId is provided in payload then mapping response.id to anonymousId', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', }, - ], - 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', + }), }, - campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, - event: 'completed', + source: {}, }, ], method: 'POST', @@ -344,7 +357,10 @@ export const data = [ userDeleted: false, }, locale: 'en', - campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, + campaign: { + id: '6373271b764986ebee62bfca', + name: 'NPS Survey', + }, integration: { name: 'SATISMETER' }, location: { country: 'IN', diff --git a/test/integrations/sources/segment/data.ts b/test/integrations/sources/segment/data.ts index 780a65c1195..a7567af3a55 100644 --- a/test/integrations/sources/segment/data.ts +++ b/test/integrations/sources/segment/data.ts @@ -10,92 +10,128 @@ export const data: SrcTestCaseData[] = [ name: 'segment', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', 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: '**************_***************', + request: { + body: JSON.stringify({ + 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, + }), }, - 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, + source: {}, }, { - 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, + request: { + body: JSON.stringify({ + 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, + }), + }, + source: {}, }, { - 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: '**************_***************', + request: { + body: JSON.stringify({ + 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, + }), }, - 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, + source: {}, }, { - 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: '**************_***************', + request: { + body: JSON.stringify({ + 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, + }), }, - 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, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/shopify/constants.ts b/test/integrations/sources/shopify/constants.ts index af53a3180e8..cd362adaec3 100644 --- a/test/integrations/sources/shopify/constants.ts +++ b/test/integrations/sources/shopify/constants.ts @@ -1,3 +1,58 @@ +const dummyResponseCommonPayload = { + navigator: { + language: 'en-US', + cookieEnabled: true, + languages: ['en-US', 'en'], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', + }, + window: { + innerHeight: 1028, + innerWidth: 1362, + outerHeight: 1080, + outerWidth: 1728, + pageXOffset: 0, + pageYOffset: 0, + location: { + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + hash: '', + host: 'store.myshopify.com', + hostname: 'store.myshopify.com', + origin: 'https://store.myshopify.com', + pathname: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + port: '', + protocol: 'https:', + search: '', + }, + origin: 'https://store.myshopify.com', + screen: { + height: 1117, + width: 1728, + }, + screenX: 0, + screenY: 37, + scrollX: 0, + scrollY: 0, + }, + page: { + title: 'Checkout - pixel-testing-rs', + url: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + path: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + search: '', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', + screen: { + height: 1117, + width: 1728, + }, + library: { + name: 'RudderStack Shopify Cloud', + eventOrigin: 'client', + version: '2.0.0', + }, +}; + export const dummySourceConfig = { ID: 'dummy-source-id', OriginalID: '', @@ -83,25 +138,10 @@ export const dummyContext = { }, }; -export const note_attributes = [ - { - name: 'cartId', - value: '9c623f099fc8819aa4d6a958b65dfe7d', - }, - { - name: 'cartToken', - value: 'Z2NwLXVzLWVhc3QxOjAxSkQzNUFXVEI4VkVUNUpTTk1LSzBCMzlF', - }, - { - name: 'rudderAnonymousId', - value: '50ead33e-d763-4854-b0ab-765859ef05cb', - }, -]; - -export const responseDummyContext = { +export const dummyContextwithCampaign = { document: { location: { - href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU?checkout%5Bpayment_gateway%5D=shopify_payments&utm_campaign=shopifySale&utm_medium=checkout&utm_term=term_checkout&utm_content=web&utm_custom1=customutm&tag=tag', hash: '', host: 'store.myshopify.com', hostname: 'store.myshopify.com', @@ -150,21 +190,60 @@ export const responseDummyContext = { scrollX: 0, scrollY: 0, }, - page: { - title: 'Checkout - pixel-testing-rs', - url: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - path: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - search: '', +}; + +export const note_attributes = [ + { + name: 'cartId', + value: '9c623f099fc8819aa4d6a958b65dfe7d', }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', - screen: { - height: 1117, - width: 1728, + { + name: 'cartToken', + value: 'Z2NwLXVzLWVhc3QxOjAxSkQzNUFXVEI4VkVUNUpTTk1LSzBCMzlF', }, - library: { - name: 'RudderStack Shopify Cloud', - eventOrigin: 'client', - version: '2.0.0', + { + name: 'rudderAnonymousId', + value: '50ead33e-d763-4854-b0ab-765859ef05cb', + }, +]; + +export const responseDummyContext = { + document: { + location: { + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + hash: '', + host: 'store.myshopify.com', + hostname: 'store.myshopify.com', + origin: 'https://store.myshopify.com', + pathname: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + port: '', + protocol: 'https:', + search: '', + }, + referrer: 'https://store.myshopify.com/cart', + characterSet: 'UTF-8', + title: 'Checkout - pixel-testing-rs', + }, + ...dummyResponseCommonPayload, +}; + +export const responseDummyContextwithCampaign = { + document: { + location: { + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU?checkout%5Bpayment_gateway%5D=shopify_payments&utm_campaign=shopifySale&utm_medium=checkout&utm_term=term_checkout&utm_content=web&utm_custom1=customutm&tag=tag', + hash: '', + host: 'store.myshopify.com', + hostname: 'store.myshopify.com', + origin: 'https://store.myshopify.com', + pathname: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + port: '', + protocol: 'https:', + search: '', + }, + referrer: 'https://store.myshopify.com/cart', + title: 'Checkout - pixel-testing-rs', + characterSet: 'UTF-8', }, + // title: 'Checkout - pixel-testing-rs', + ...dummyResponseCommonPayload, }; diff --git a/test/integrations/sources/shopify/data.ts b/test/integrations/sources/shopify/data.ts index d4498e089c9..1cc10371daf 100644 --- a/test/integrations/sources/shopify/data.ts +++ b/test/integrations/sources/shopify/data.ts @@ -11,18 +11,21 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Track Call -> carts_create ', module: 'source', - version: 'v0', + version: 'v1', 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', + event: { + 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', + }, + source: {}, }, ], method: 'POST', @@ -41,10 +44,14 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'No Query Parameters', module: 'source', - version: 'v0', + version: 'v1', skipGo: 'not possible', input: { - request: { body: [{}], method: 'POST', headers: { 'Content-Type': 'application/json' } }, + request: { + body: [{ event: {}, source: {} }], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, pathSuffix: '', }, output: { @@ -58,6 +65,7 @@ const serverSideEventsScenarios = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'shopify', workspaceId: 'Non determinable', }, statusCode: 400, @@ -70,11 +78,16 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Invalid topic', module: 'source', - version: 'v0', + version: 'v1', input: { request: { body: [ - { query_parameters: { signature: ['rudderstack'], writeKey: ['sample-write-key'] } }, + { + event: { + query_parameters: { signature: ['rudderstack'], writeKey: ['sample-write-key'] }, + }, + source: {}, + }, ], method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -92,6 +105,7 @@ const serverSideEventsScenarios = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'shopify', workspaceId: 'Non determinable', }, statusCode: 400, @@ -104,17 +118,20 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Topic Not found', module: 'source', - version: 'v0', + version: 'v1', skipGo: 'not possible', input: { request: { body: [ { - query_parameters: { - topic: [], - signature: ['rudderstack'], - writeKey: ['sample-write-key'], + event: { + query_parameters: { + topic: [], + signature: ['rudderstack'], + writeKey: ['sample-write-key'], + }, }, + source: {}, }, ], method: 'POST', @@ -133,6 +150,7 @@ const serverSideEventsScenarios = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'shopify', workspaceId: 'Non determinable', }, statusCode: 400, @@ -145,16 +163,19 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Unsupported Event Type', module: 'source', - version: 'v0', + version: 'v1', input: { request: { body: [ { - query_parameters: { - topic: ['random_event'], - signature: ['rudderstack'], - writeKey: ['sample-write-key'], + event: { + query_parameters: { + topic: ['random_event'], + signature: ['rudderstack'], + writeKey: ['sample-write-key'], + }, }, + source: {}, }, ], method: 'POST', @@ -173,37 +194,68 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Identify Call for customers create event', module: 'source', - version: 'v0', + version: 'v1', 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: [ - { + event: { + 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', @@ -222,36 +274,8 @@ const serverSideEventsScenarios = [ 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, }, + source: {}, }, ], method: 'POST', @@ -352,40 +376,44 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Unsupported checkout event', module: 'source', - version: 'v0', + version: 'v1', input: { request: { body: [ { - query_parameters: { - topic: ['checkout_delete'], - writeKey: ['sample-write-key'], - signature: ['rudderstack'], + event: { + 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', }, - 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', + source: {}, }, ], method: 'POST', @@ -404,97 +432,101 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Track Call -> Fullfillments updated event', module: 'source', - version: 'v0', + version: 'v1', 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' }, + event: { + 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', }, - 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' }, }, - ], - 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', }, - 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', + ], + 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', + }, + source: {}, }, ], method: 'POST', @@ -616,407 +648,410 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Track Call -> Order Partially Fulfilled event', module: 'source', - version: 'v0', + version: 'v1', input: { request: { body: [ { - query_parameters: { - topic: ['orders_partially_fulfilled'], - writeKey: ['sample-write-key'], - signature: ['rudderstack'], - }, - id: 820982911946154508, - admin_graphql_api_id: 'gid://shopify/Order/820982911946154508', - app_id: null, - browser_ip: null, - buyer_accepts_marketing: true, - cancel_reason: 'customer', - cancelled_at: '2021-12-31T19:00:00-05:00', - cart_token: null, - checkout_id: null, - checkout_token: null, - client_details: null, - closed_at: null, - confirmation_number: null, - confirmed: false, - contact_email: 'jon@example.com', - created_at: '2021-12-31T19:00:00-05:00', - currency: 'USD', - current_subtotal_price: '398.00', - current_subtotal_price_set: { - shop_money: { - amount: '398.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '398.00', - currency_code: 'USD', - }, - }, - current_total_additional_fees_set: null, - current_total_discounts: '0.00', - current_total_discounts_set: { - shop_money: { - amount: '0.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '0.00', - currency_code: 'USD', - }, - }, - current_total_duties_set: null, - current_total_price: '398.00', - current_total_price_set: { - shop_money: { - amount: '398.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '398.00', - currency_code: 'USD', - }, - }, - current_total_tax: '0.00', - current_total_tax_set: { - shop_money: { - amount: '0.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '0.00', - currency_code: 'USD', - }, - }, - customer_locale: 'en', - device_id: null, - discount_codes: [], - email: 'jon@example.com', - estimated_taxes: false, - financial_status: 'voided', - fulfillment_status: 'pending', - landing_site: null, - landing_site_ref: null, - location_id: null, - merchant_of_record_app_id: null, - name: '#9999', - note: null, - note_attributes: [], - number: 234, - order_number: 1234, - order_status_url: - 'https://jsmith.myshopify.com/548380009/orders/123456abcd/authenticate?key=abcdefg', - original_total_additional_fees_set: null, - original_total_duties_set: null, - payment_gateway_names: ['visa', 'bogus'], - phone: null, - po_number: null, - presentment_currency: 'USD', - processed_at: '2021-12-31T19:00:00-05:00', - reference: null, - referring_site: null, - source_identifier: null, - source_name: 'web', - source_url: null, - subtotal_price: '388.00', - subtotal_price_set: { - shop_money: { - amount: '388.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '388.00', - currency_code: 'USD', + event: { + query_parameters: { + topic: ['orders_partially_fulfilled'], + writeKey: ['sample-write-key'], + signature: ['rudderstack'], }, - }, - tags: 'tag1, tag2', - tax_exempt: false, - tax_lines: [], - taxes_included: false, - test: true, - token: '123456abcd', - total_discounts: '20.00', - total_discounts_set: { - shop_money: { - amount: '20.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '20.00', - currency_code: 'USD', + id: 820982911946154508, + admin_graphql_api_id: 'gid://shopify/Order/820982911946154508', + app_id: null, + browser_ip: null, + buyer_accepts_marketing: true, + cancel_reason: 'customer', + cancelled_at: '2021-12-31T19:00:00-05:00', + cart_token: null, + checkout_id: null, + checkout_token: null, + client_details: null, + closed_at: null, + confirmation_number: null, + confirmed: false, + contact_email: 'jon@example.com', + created_at: '2021-12-31T19:00:00-05:00', + currency: 'USD', + current_subtotal_price: '398.00', + current_subtotal_price_set: { + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, }, - }, - total_line_items_price: '398.00', - total_line_items_price_set: { - shop_money: { - amount: '398.00', - currency_code: 'USD', + current_total_additional_fees_set: null, + current_total_discounts: '0.00', + current_total_discounts_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '398.00', - currency_code: 'USD', + current_total_duties_set: null, + current_total_price: '398.00', + current_total_price_set: { + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, }, - }, - total_outstanding: '398.00', - total_price: '388.00', - total_price_set: { - shop_money: { - amount: '388.00', - currency_code: 'USD', + current_total_tax: '0.00', + current_total_tax_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '388.00', - currency_code: 'USD', + customer_locale: 'en', + device_id: null, + discount_codes: [], + email: 'jon@example.com', + estimated_taxes: false, + financial_status: 'voided', + fulfillment_status: 'pending', + landing_site: null, + landing_site_ref: null, + location_id: null, + merchant_of_record_app_id: null, + name: '#9999', + note: null, + note_attributes: [], + number: 234, + order_number: 1234, + order_status_url: + 'https://jsmith.myshopify.com/548380009/orders/123456abcd/authenticate?key=abcdefg', + original_total_additional_fees_set: null, + original_total_duties_set: null, + payment_gateway_names: ['visa', 'bogus'], + phone: null, + po_number: null, + presentment_currency: 'USD', + processed_at: '2021-12-31T19:00:00-05:00', + reference: null, + referring_site: null, + source_identifier: null, + source_name: 'web', + source_url: null, + subtotal_price: '388.00', + subtotal_price_set: { + shop_money: { + amount: '388.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '388.00', + currency_code: 'USD', + }, }, - }, - total_shipping_price_set: { - shop_money: { - amount: '10.00', - currency_code: 'USD', + tags: 'tag1, tag2', + tax_exempt: false, + tax_lines: [], + taxes_included: false, + test: true, + token: '123456abcd', + total_discounts: '20.00', + total_discounts_set: { + shop_money: { + amount: '20.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '20.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '10.00', - currency_code: 'USD', + total_line_items_price: '398.00', + total_line_items_price_set: { + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, }, - }, - total_tax: '0.00', - total_tax_set: { - shop_money: { - amount: '0.00', - currency_code: 'USD', + total_outstanding: '398.00', + total_price: '388.00', + total_price_set: { + shop_money: { + amount: '388.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '388.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '0.00', - currency_code: 'USD', + total_shipping_price_set: { + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, }, - }, - total_tip_received: '0.00', - total_weight: 0, - updated_at: '2021-12-31T19:00:00-05:00', - user_id: null, - billing_address: { - first_name: 'Steve', - address1: '123 Shipping Street', - phone: '555-555-SHIP', - city: 'Shippington', - zip: '40003', - province: 'Kentucky', - country: 'United States', - last_name: 'Shipper', - address2: null, - company: 'Shipping Company', - latitude: null, - longitude: null, - name: 'Steve Shipper', - country_code: 'US', - province_code: 'KY', - }, - customer: { - id: 115310627314723954, - email: 'john@example.com', - created_at: null, - updated_at: null, - first_name: 'John', - last_name: 'Smith', - state: 'disabled', - note: null, - verified_email: true, - multipass_identifier: null, - tax_exempt: false, - phone: null, - email_marketing_consent: { - state: 'not_subscribed', - opt_in_level: null, - consent_updated_at: null, + total_tax: '0.00', + total_tax_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, }, - sms_marketing_consent: null, - tags: '', - currency: 'USD', - tax_exemptions: [], - admin_graphql_api_id: 'gid://shopify/Customer/115310627314723954', - default_address: { - id: 715243470612851245, - customer_id: 115310627314723954, - first_name: null, - last_name: null, - company: null, - address1: '123 Elm St.', + total_tip_received: '0.00', + total_weight: 0, + updated_at: '2021-12-31T19:00:00-05:00', + user_id: null, + billing_address: { + first_name: 'Steve', + address1: '123 Shipping Street', + phone: '555-555-SHIP', + city: 'Shippington', + zip: '40003', + province: 'Kentucky', + country: 'United States', + last_name: 'Shipper', address2: null, - city: 'Ottawa', - province: 'Ontario', - country: 'Canada', - zip: 'K2H7A8', - phone: '123-123-1234', - name: '', - province_code: 'ON', - country_code: 'CA', - country_name: 'Canada', - default: true, + company: 'Shipping Company', + latitude: null, + longitude: null, + name: 'Steve Shipper', + country_code: 'US', + province_code: 'KY', }, - }, - discount_applications: [], - fulfillments: [], - line_items: [ - { - id: 866550311766439020, - admin_graphql_api_id: 'gid://shopify/LineItem/866550311766439020', - attributed_staffs: [ - { - id: 'gid://shopify/StaffMember/902541635', - quantity: 1, - }, - ], - current_quantity: 1, - fulfillable_quantity: 1, - fulfillment_service: 'manual', - fulfillment_status: null, - gift_card: false, - grams: 567, - name: 'IPod Nano - 8GB', - price: '199.00', - price_set: { - shop_money: { - amount: '199.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '199.00', - currency_code: 'USD', - }, + customer: { + id: 115310627314723954, + email: 'john@example.com', + created_at: null, + updated_at: null, + first_name: 'John', + last_name: 'Smith', + state: 'disabled', + note: null, + verified_email: true, + multipass_identifier: null, + tax_exempt: false, + phone: null, + email_marketing_consent: { + state: 'not_subscribed', + opt_in_level: null, + consent_updated_at: null, }, - product_exists: true, - product_id: 632910392, - properties: [], - quantity: 1, - requires_shipping: true, - sku: 'IPOD2008PINK', - taxable: true, - title: 'IPod Nano - 8GB', - total_discount: '0.00', - total_discount_set: { - shop_money: { - amount: '0.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '0.00', - currency_code: 'USD', - }, + sms_marketing_consent: null, + tags: '', + currency: 'USD', + tax_exemptions: [], + admin_graphql_api_id: 'gid://shopify/Customer/115310627314723954', + default_address: { + id: 715243470612851245, + customer_id: 115310627314723954, + first_name: null, + last_name: null, + company: null, + address1: '123 Elm St.', + address2: null, + city: 'Ottawa', + province: 'Ontario', + country: 'Canada', + zip: 'K2H7A8', + phone: '123-123-1234', + name: '', + province_code: 'ON', + country_code: 'CA', + country_name: 'Canada', + default: true, }, - variant_id: 808950810, - variant_inventory_management: 'shopify', - variant_title: null, - vendor: null, - tax_lines: [], - duties: [], - discount_allocations: [], }, - { - id: 141249953214522974, - admin_graphql_api_id: 'gid://shopify/LineItem/141249953214522974', - attributed_staffs: [], - current_quantity: 1, - fulfillable_quantity: 1, - fulfillment_service: 'manual', - fulfillment_status: null, - gift_card: false, - grams: 567, - name: 'IPod Nano - 8GB', - price: '199.00', - price_set: { - shop_money: { - amount: '199.00', - currency_code: 'USD', + discount_applications: [], + fulfillments: [], + line_items: [ + { + id: 866550311766439020, + admin_graphql_api_id: 'gid://shopify/LineItem/866550311766439020', + attributed_staffs: [ + { + id: 'gid://shopify/StaffMember/902541635', + quantity: 1, + }, + ], + current_quantity: 1, + fulfillable_quantity: 1, + fulfillment_service: 'manual', + fulfillment_status: null, + gift_card: false, + grams: 567, + name: 'IPod Nano - 8GB', + price: '199.00', + price_set: { + shop_money: { + amount: '199.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '199.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '199.00', - currency_code: 'USD', + product_exists: true, + product_id: 632910392, + properties: [], + quantity: 1, + requires_shipping: true, + sku: 'IPOD2008PINK', + taxable: true, + title: 'IPod Nano - 8GB', + total_discount: '0.00', + total_discount_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, }, + variant_id: 808950810, + variant_inventory_management: 'shopify', + variant_title: null, + vendor: null, + tax_lines: [], + duties: [], + discount_allocations: [], }, - product_exists: true, - product_id: 632910392, - properties: [], - quantity: 1, - requires_shipping: true, - sku: 'IPOD2008PINK', - taxable: true, - title: 'IPod Nano - 8GB', - total_discount: '0.00', - total_discount_set: { - shop_money: { - amount: '0.00', - currency_code: 'USD', + { + id: 141249953214522974, + admin_graphql_api_id: 'gid://shopify/LineItem/141249953214522974', + attributed_staffs: [], + current_quantity: 1, + fulfillable_quantity: 1, + fulfillment_service: 'manual', + fulfillment_status: null, + gift_card: false, + grams: 567, + name: 'IPod Nano - 8GB', + price: '199.00', + price_set: { + shop_money: { + amount: '199.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '199.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '0.00', - currency_code: 'USD', + product_exists: true, + product_id: 632910392, + properties: [], + quantity: 1, + requires_shipping: true, + sku: 'IPOD2008PINK', + taxable: true, + title: 'IPod Nano - 8GB', + total_discount: '0.00', + total_discount_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, }, + variant_id: 808950810, + variant_inventory_management: 'shopify', + variant_title: null, + vendor: null, + tax_lines: [], + duties: [], + discount_allocations: [], }, - variant_id: 808950810, - variant_inventory_management: 'shopify', - variant_title: null, - vendor: null, - tax_lines: [], - duties: [], - discount_allocations: [], + ], + payment_terms: null, + refunds: [], + shipping_address: { + first_name: 'Steve', + address1: '123 Shipping Street', + phone: '555-555-SHIP', + city: 'Shippington', + zip: '40003', + province: 'Kentucky', + country: 'United States', + last_name: 'Shipper', + address2: null, + company: 'Shipping Company', + latitude: null, + longitude: null, + name: 'Steve Shipper', + country_code: 'US', + province_code: 'KY', }, - ], - payment_terms: null, - refunds: [], - shipping_address: { - first_name: 'Steve', - address1: '123 Shipping Street', - phone: '555-555-SHIP', - city: 'Shippington', - zip: '40003', - province: 'Kentucky', - country: 'United States', - last_name: 'Shipper', - address2: null, - company: 'Shipping Company', - latitude: null, - longitude: null, - name: 'Steve Shipper', - country_code: 'US', - province_code: 'KY', - }, - shipping_lines: [ - { - id: 271878346596884015, - carrier_identifier: null, - code: null, - discounted_price: '10.00', - discounted_price_set: { - shop_money: { - amount: '10.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '10.00', - currency_code: 'USD', - }, - }, - is_removed: false, - phone: null, - price: '10.00', - price_set: { - shop_money: { - amount: '10.00', - currency_code: 'USD', + shipping_lines: [ + { + id: 271878346596884015, + carrier_identifier: null, + code: null, + discounted_price: '10.00', + discounted_price_set: { + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '10.00', - currency_code: 'USD', + is_removed: false, + phone: null, + price: '10.00', + price_set: { + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, }, + requested_fulfillment_service_id: null, + source: 'shopify', + title: 'Generic Shipping', + tax_lines: [], + discount_allocations: [], }, - requested_fulfillment_service_id: null, - source: 'shopify', - title: 'Generic Shipping', - tax_lines: [], - discount_allocations: [], - }, - ], + ], + }, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/shopify/mocks.ts b/test/integrations/sources/shopify/mocks.ts index e1895e78124..929d6e17fd3 100644 --- a/test/integrations/sources/shopify/mocks.ts +++ b/test/integrations/sources/shopify/mocks.ts @@ -1,5 +1,14 @@ import utils from '../../../../src/v0/util'; +import { RedisDB } from '../../../../src/util/redis/redisConnector'; export const mockFns = (_) => { jest.spyOn(utils, 'generateUUID').mockReturnValue('5d3e2cb6-4011-5c9c-b7ee-11bc1e905097'); + jest.spyOn(RedisDB, 'getVal').mockImplementation((key) => { + if (key === 'pixel:c7b3f99b-4d34-463b-835f-c879482a7750') { + return Promise.resolve({ userId: 'test-user-id' }); + } + return Promise.resolve({}); + }); + // Mock setVal to track anonymousId to userId mapping + jest.spyOn(RedisDB, 'setVal').mockReturnValue(Promise.resolve()); }; diff --git a/test/integrations/sources/shopify/pixelTestScenarios/CheckoutEventsTests.ts b/test/integrations/sources/shopify/pixelTestScenarios/CheckoutEventsTests.ts index ff1ea39ed13..2b04a33fb8b 100644 --- a/test/integrations/sources/shopify/pixelTestScenarios/CheckoutEventsTests.ts +++ b/test/integrations/sources/shopify/pixelTestScenarios/CheckoutEventsTests.ts @@ -336,6 +336,11 @@ export const pixelCheckoutEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Checkout Started', @@ -775,6 +780,11 @@ export const pixelCheckoutEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Order Completed', diff --git a/test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts b/test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts index 38f682ac6da..95fd2ea26bd 100644 --- a/test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts +++ b/test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts @@ -387,6 +387,11 @@ export const pixelCheckoutStepsScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Checkout Address Info Submitted', @@ -921,6 +926,11 @@ export const pixelCheckoutStepsScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Checkout Contact Info Submitted', @@ -1470,6 +1480,11 @@ export const pixelCheckoutStepsScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Checkout Shipping Info Submitted', @@ -2035,9 +2050,14 @@ export const pixelCheckoutStepsScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', - event: 'Payment Info Submitted', + event: 'Payment Info Entered', properties: { buyerAcceptsEmailMarketing: false, buyerAcceptsSmsMarketing: false, diff --git a/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts b/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts index 46bd4f96151..1e9797bd8d8 100644 --- a/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts +++ b/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts @@ -1,5 +1,12 @@ // This file contains the test scenarios related to Shopify pixel events, emitted from web pixel on the browser. -import { dummyContext, dummySourceConfig, responseDummyContext } from '../constants'; +import { mockFns } from '../mocks'; +import { + dummyContext, + dummyContextwithCampaign, + dummySourceConfig, + responseDummyContext, + responseDummyContextwithCampaign, +} from '../constants'; export const pixelEventsTestScenarios = [ { @@ -18,7 +25,7 @@ export const pixelEventsTestScenarios = [ type: 'standard', clientId: 'c7b3f99b-4d34-463b-835f-c879482a7750', timestamp: '2024-09-15T17:24:30.373Z', - context: dummyContext, + context: dummyContextwithCampaign, pixelEventLabel: true, query_parameters: { topic: ['page_viewed'], @@ -42,7 +49,14 @@ export const pixelEventsTestScenarios = [ batch: [ { context: { - ...responseDummyContext, + ...responseDummyContextwithCampaign, + campaign: { + content: 'web', + medium: 'checkout', + name: 'shopifySale', + term: 'term_checkout', + utm_custom1: 'customutm', + }, shopifyDetails: { clientId: 'c7b3f99b-4d34-463b-835f-c879482a7750', data: {}, @@ -55,9 +69,15 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['page.context.shopifyDetails'], + }, + }, }, name: 'Page View', type: 'page', + userId: 'test-user-id', properties: {}, anonymousId: 'c7b3f99b-4d34-463b-835f-c879482a7750', messageId: 'sh-f6b6f548-5FEF-4DAE-9CAB-39EE6F94E09B', @@ -166,8 +186,14 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', + userId: 'test-user-id', event: 'Product Viewed', properties: { product_id: '7234590834801', @@ -330,8 +356,14 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', + userId: 'test-user-id', event: 'Cart Viewed', properties: { products: [ @@ -555,8 +587,14 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', + userId: 'test-user-id', event: 'Product List Viewed', properties: { cart_id: 'c7b3f99b-4d34-463b-835f-c879482a7750', @@ -725,8 +763,14 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', + userId: 'test-user-id', event: 'Product Added', properties: { image_url: @@ -866,8 +910,14 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', + userId: 'test-user-id', event: 'Product Removed', properties: { image_url: @@ -955,8 +1005,14 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', + userId: 'test-user-id', event: 'Search Submitted', properties: { query: 'skate', @@ -1022,4 +1078,4 @@ export const pixelEventsTestScenarios = [ }, }, }, -]; +].map((p1) => ({ ...p1, mockFns })); diff --git a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts index a154ccb890c..66d5e7815d3 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts @@ -1,5 +1,6 @@ // This file contains the test scenarios for the server-side events from the Shopify GraphQL API for // the v1 transformation flow +import { mockFns } from '../mocks'; import { dummySourceConfig, note_attributes } from '../constants'; export const checkoutEventsTestScenarios = [ @@ -100,11 +101,6 @@ export const checkoutEventsTestScenarios = [ }, }, source: dummySourceConfig, - query_parameters: { - topic: ['carts_update'], - writeKey: ['2mw9SN679HngnXXXHT4oSVVBVmb'], - version: ['pixel'], - }, }, ], method: 'POST', @@ -215,18 +211,23 @@ export const checkoutEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', - event: 'Checkout Started', + event: 'Checkout Started Webhook', properties: { - order_id: 35550298931313, - value: '600.00', - tax: '0.00', + order_id: '35550298931313', + value: 600, + tax: 0, currency: 'USD', products: [ { - product_id: 7234590408817, - price: '600.00', + product_id: '7234590408817', + price: 600.0, brand: 'Hydrogen Vendor', quantity: 1, }, @@ -235,6 +236,7 @@ export const checkoutEventsTestScenarios = [ timestamp: '2024-11-06T02:22:02.000Z', traits: { shippingAddress: [], + cart_token_hash: '9125e1da-57b9-5bdc-953e-eb2b0ded5edc', }, anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', }, @@ -530,20 +532,24 @@ export const checkoutEventsTestScenarios = [ event: 'Checkout Updated', integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, properties: { currency: 'USD', - order_id: 35374569160817, + order_id: '35374569160817', products: [ { brand: 'pixel-testing-rs', - price: '729.95', - product_id: 7234590638193, + price: 729.95, + product_id: '7234590638193', quantity: 1, }, ], - tax: '0.00', - value: '736.85', + tax: 0, }, timestamp: '2024-09-17T07:29:02.000Z', traits: { @@ -567,6 +573,7 @@ export const checkoutEventsTestScenarios = [ province_code: 'AZ', zip: '85003', }, + cart_token_hash: '9e189f39-da46-58df-81b4-5e507d9ef64e', adminGraphqlApiId: 'gid://shopify/Customer/7188389789809', currency: 'USD', email: 'testuser101@gmail.com', @@ -599,6 +606,74 @@ export const checkoutEventsTestScenarios = [ type: 'track', userId: '7188389789809', }, + { + anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', + context: { + integration: { + name: 'SHOPIFY', + }, + library: { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }, + traits: { + acceptsMarketing: false, + address: { + address1: 'oakwood bridge', + address2: 'Hedgetown', + city: 'KLF', + company: null, + country: 'United States', + country_code: 'US', + country_name: 'United States', + customer_id: 7188389789809, + default: true, + first_name: 'testuser', + id: null, + last_name: 'dummy', + name: 'testuser dummy', + phone: null, + province: 'Arizona', + province_code: 'AZ', + zip: '85003', + }, + adminGraphqlApiId: 'gid://shopify/Customer/7188389789809', + currency: 'USD', + email: 'testuser101@gmail.com', + firstName: 'testuser', + lastName: 'dummy', + orderCount: 0, + shippingAddress: { + address1: 'oakwood bridge', + address2: 'Hedgetown', + city: 'KLF', + company: null, + country: 'United States', + country_code: 'US', + first_name: 'testuser', + last_name: 'dummy', + latitude: null, + longitude: null, + name: 'testuser dummy', + phone: null, + province: 'Arizona', + province_code: 'AZ', + zip: '85003', + }, + state: 'disabled', + tags: '', + taxExempt: false, + totalSpent: '0.00', + verifiedEmail: true, + }, + }, + integrations: { + SHOPIFY: true, + }, + type: 'identify', + userId: '7188389789809', + }, ], }, }, @@ -1203,19 +1278,23 @@ export const checkoutEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Order Updated', properties: { - order_id: 5778367414385, - value: '600.00', - tax: '0.00', + order_id: '5778367414385', + tax: 0, currency: 'USD', products: [ { - product_id: 7234590408817, + product_id: '7234590408817', title: 'The Collection Snowboard: Hydrogen', - price: '600.00', + price: 600, brand: 'Hydrogen Vendor', quantity: 1, }, @@ -1245,6 +1324,7 @@ export const checkoutEventsTestScenarios = [ country_name: 'United States', default: true, }, + cart_token_hash: '9125e1da-57b9-5bdc-953e-eb2b0ded5edc', state: 'disabled', verifiedEmail: true, taxExempt: false, @@ -1290,6 +1370,89 @@ export const checkoutEventsTestScenarios = [ timestamp: '2024-11-06T02:54:50.000Z', anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', }, + { + anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', + context: { + integration: { + name: 'SHOPIFY', + }, + library: { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }, + traits: { + address: { + address1: 'Yuimaru Kitchen', + address2: '6', + city: 'Johnson City', + company: null, + country: 'United States', + country_code: 'US', + country_name: 'United States', + customer_id: 7358220173425, + default: true, + first_name: 'henry', + id: 8715246862449, + last_name: 'waffles', + name: 'henry waffles', + phone: null, + province: 'Tennessee', + province_code: 'TN', + zip: '37604', + }, + adminGraphqlApiId: 'gid://shopify/Customer/7358220173425', + billingAddress: { + address1: 'Yuma Proving Ground', + address2: 'suite 001', + city: 'Yuma Proving Ground', + company: null, + country: 'United States', + country_code: 'US', + first_name: 'yodi', + last_name: 'waffles', + latitude: 33.0177811, + longitude: -114.2525392, + name: 'yodi waffles', + phone: null, + province: 'Arizona', + province_code: 'AZ', + zip: '85365', + }, + currency: 'USD', + email: 'henry@wfls.com', + firstName: 'yodi', + lastName: 'waffles', + shippingAddress: { + address1: 'Yuimaru Kitchen', + address2: '6', + city: 'Johnson City', + company: null, + country: 'United States', + country_code: 'US', + first_name: 'henry', + last_name: 'waffles', + latitude: 36.3528845, + longitude: -82.4006335, + name: 'henry waffles', + phone: null, + province: 'Tennessee', + province_code: 'TN', + zip: '37604', + }, + state: 'disabled', + tags: '', + taxExempt: false, + taxExemptions: [], + verifiedEmail: true, + }, + }, + integrations: { + SHOPIFY: true, + }, + type: 'identify', + userId: '7358220173425', + }, ], }, }, @@ -1594,19 +1757,24 @@ export const checkoutEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Order Created', properties: { - order_id: 5778367414385, - value: '600.00', - tax: '0.00', + order_id: '5778367414385', + value: 600, + tax: 0, currency: 'USD', products: [ { - product_id: 7234590408817, + product_id: '7234590408817', title: 'The Collection Snowboard: Hydrogen', - price: '600.00', + price: 600, brand: 'Hydrogen Vendor', quantity: 1, }, @@ -1636,6 +1804,7 @@ export const checkoutEventsTestScenarios = [ country_name: 'United States', default: true, }, + cart_token_hash: '9125e1da-57b9-5bdc-953e-eb2b0ded5edc', state: 'disabled', currency: 'USD', taxExemptions: [], @@ -1678,6 +1847,465 @@ export const checkoutEventsTestScenarios = [ timestamp: '2024-11-06T02:54:50.000Z', anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', }, + { + anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', + context: { + integration: { + name: 'SHOPIFY', + }, + library: { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }, + traits: { + address: { + address1: 'Yuimaru Kitchen', + address2: '6', + city: 'Johnson City', + company: null, + country: 'United States', + country_code: 'US', + country_name: 'United States', + customer_id: 7358220173425, + default: true, + first_name: 'henry', + id: 8715246862449, + last_name: 'waffles', + name: 'henry waffles', + phone: null, + province: 'Tennessee', + province_code: 'TN', + zip: '37604', + }, + adminGraphqlApiId: 'gid://shopify/Customer/7358220173425', + billingAddress: { + address1: 'Yuma Proving Ground', + address2: 'suite 001', + city: 'Yuma Proving Ground', + company: null, + country: 'United States', + country_code: 'US', + first_name: 'yodi', + last_name: 'waffles', + latitude: 33.0177811, + longitude: -114.2525392, + name: 'yodi waffles', + phone: null, + province: 'Arizona', + province_code: 'AZ', + zip: '85365', + }, + currency: 'USD', + email: 'henry@wfls.com', + firstName: 'yodi', + lastName: 'waffles', + shippingAddress: { + address1: 'Yuimaru Kitchen', + address2: '6', + city: 'Johnson City', + company: null, + country: 'United States', + country_code: 'US', + first_name: 'henry', + last_name: 'waffles', + latitude: 36.3528845, + longitude: -82.4006335, + name: 'henry waffles', + phone: null, + province: 'Tennessee', + province_code: 'TN', + zip: '37604', + }, + state: 'disabled', + taxExemptions: [], + }, + }, + integrations: { + SHOPIFY: true, + }, + type: 'identify', + userId: '7358220173425', + }, + ], + }, + }, + ], + }, + }, + }, + { + id: 'c005', + name: 'shopify', + description: 'Track Call -> Order Cancelled event from Pixel app', + module: 'source', + version: 'v1', + input: { + request: { + body: [ + { + event: { + email: 'henry@wfls.com', + total_price: '600.00', + total_tax: '0.00', + updated_at: '2024-11-05T21:54:50-05:00', + line_items: [ + { + id: 14234727743601, + name: 'The Collection Snowboard: Hydrogen', + price: '600.00', + product_id: 7234590408817, + quantity: 1, + sku: '', + title: 'The Collection Snowboard: Hydrogen', + total_discount: '0.00', + variant_id: 41327142600817, + vendor: 'Hydrogen Vendor', + }, + ], + shipping_address: { + first_name: 'henry', + address1: 'Yuimaru Kitchen', + city: 'Johnson City', + zip: '37604', + }, + query_parameters: { + topic: ['orders_cancelled'], + version: ['pixel'], + writeKey: ['2mw9SN679HngnZkCHT4oSVVBVmb'], + }, + }, + source: dummySourceConfig, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { + name: 'SHOPIFY', + }, + library: { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }, + shopifyDetails: { + email: 'henry@wfls.com', + line_items: [ + { + id: 14234727743601, + name: 'The Collection Snowboard: Hydrogen', + price: '600.00', + product_id: 7234590408817, + quantity: 1, + sku: '', + title: 'The Collection Snowboard: Hydrogen', + total_discount: '0.00', + variant_id: 41327142600817, + vendor: 'Hydrogen Vendor', + }, + ], + shipping_address: { + address1: 'Yuimaru Kitchen', + city: 'Johnson City', + first_name: 'henry', + zip: '37604', + }, + total_price: '600.00', + total_tax: '0.00', + updated_at: '2024-11-05T21:54:50-05:00', + }, + topic: 'orders_cancelled', + }, + event: 'Order Cancelled', + integrations: { + SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, + }, + properties: { + products: [ + { + brand: 'Hydrogen Vendor', + price: 600, + product_id: '7234590408817', + quantity: 1, + title: 'The Collection Snowboard: Hydrogen', + }, + ], + tax: 0, + value: 600, + }, + timestamp: '2024-11-06T02:54:50.000Z', + traits: { + email: 'henry@wfls.com', + shippingAddress: { + address1: 'Yuimaru Kitchen', + city: 'Johnson City', + first_name: 'henry', + zip: '37604', + }, + }, + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + id: 'c001', + name: 'shopify', + description: + 'Track Call -> Checkout Started event from Pixel app, with no anonymoudId in redis. anonymousId is set as hash of cart_token (race condition scenario)', + module: 'source', + version: 'v1', + input: { + request: { + body: [ + { + event: { + id: 35550298931313, + token: '84ad78572dae52a8cbea7d55371afe89', + cart_token: 'Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ', + email: null, + gateway: null, + buyer_accepts_marketing: false, + buyer_accepts_sms_marketing: false, + sms_marketing_phone: null, + created_at: '2024-11-06T02:22:00+00:00', + updated_at: '2024-11-05T21:22:02-05:00', + landing_site: '/', + note: '', + note_attributes: [], + referring_site: '', + shipping_lines: [], + shipping_address: [], + taxes_included: false, + total_weight: 0, + currency: 'USD', + completed_at: null, + phone: null, + customer_locale: 'en-US', + line_items: [ + { + key: '41327142600817', + fulfillment_service: 'manual', + gift_card: false, + grams: 0, + presentment_title: 'The Collection Snowboard: Hydrogen', + presentment_variant_title: '', + product_id: 7234590408817, + quantity: 1, + requires_shipping: true, + sku: '', + tax_lines: [], + taxable: true, + title: 'The Collection Snowboard: Hydrogen', + variant_id: 41327142600817, + variant_title: '', + variant_price: '600.00', + vendor: 'Hydrogen Vendor', + unit_price_measurement: { + measured_type: null, + quantity_value: null, + quantity_unit: null, + reference_value: null, + reference_unit: null, + }, + compare_at_price: null, + line_price: '600.00', + price: '600.00', + applied_discounts: [], + destination_location_id: null, + user_id: null, + rank: null, + origin_location_id: null, + properties: {}, + }, + ], + name: '#35550298931313', + abandoned_checkout_url: + 'https://pixel-testing-rs.myshopify.com/59026964593/checkouts/ac/Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ/recover?key=0385163be3875d3a2117e982d9cc3517&locale=en-US', + discount_codes: [], + tax_lines: [], + presentment_currency: 'USD', + source_name: 'web', + total_line_items_price: '600.00', + total_tax: '0.00', + total_discounts: '0.00', + subtotal_price: '600.00', + total_price: '600.00', + total_duties: '0.00', + device_id: null, + user_id: null, + location_id: null, + source_identifier: null, + source_url: null, + source: null, + closed_at: null, + query_parameters: { + topic: ['checkouts_create'], + version: ['pixel'], + writeKey: ['2mw9SN679HngnXXXHT4oSVVBVmb'], + }, + }, + source: dummySourceConfig, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }, + integration: { + name: 'SHOPIFY', + }, + topic: 'checkouts_create', + cart_token: 'Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ', + shopifyDetails: { + id: 35550298931313, + token: '84ad78572dae52a8cbea7d55371afe89', + cart_token: 'Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ', + email: null, + gateway: null, + buyer_accepts_marketing: false, + buyer_accepts_sms_marketing: false, + sms_marketing_phone: null, + created_at: '2024-11-06T02:22:00+00:00', + updated_at: '2024-11-05T21:22:02-05:00', + landing_site: '/', + note: '', + note_attributes: [], + referring_site: '', + shipping_lines: [], + shipping_address: [], + taxes_included: false, + total_weight: 0, + currency: 'USD', + completed_at: null, + phone: null, + customer_locale: 'en-US', + line_items: [ + { + key: '41327142600817', + fulfillment_service: 'manual', + gift_card: false, + grams: 0, + presentment_title: 'The Collection Snowboard: Hydrogen', + presentment_variant_title: '', + product_id: 7234590408817, + quantity: 1, + requires_shipping: true, + sku: '', + tax_lines: [], + taxable: true, + title: 'The Collection Snowboard: Hydrogen', + variant_id: 41327142600817, + variant_title: '', + variant_price: '600.00', + vendor: 'Hydrogen Vendor', + unit_price_measurement: { + measured_type: null, + quantity_value: null, + quantity_unit: null, + reference_value: null, + reference_unit: null, + }, + compare_at_price: null, + line_price: '600.00', + price: '600.00', + applied_discounts: [], + destination_location_id: null, + user_id: null, + rank: null, + origin_location_id: null, + properties: {}, + }, + ], + name: '#35550298931313', + abandoned_checkout_url: + 'https://pixel-testing-rs.myshopify.com/59026964593/checkouts/ac/Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ/recover?key=0385163be3875d3a2117e982d9cc3517&locale=en-US', + discount_codes: [], + tax_lines: [], + presentment_currency: 'USD', + source_name: 'web', + total_line_items_price: '600.00', + total_tax: '0.00', + total_discounts: '0.00', + subtotal_price: '600.00', + total_price: '600.00', + total_duties: '0.00', + device_id: null, + user_id: null, + location_id: null, + source_identifier: null, + source_url: null, + source: null, + closed_at: null, + }, + }, + integrations: { + SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, + }, + type: 'track', + event: 'Checkout Started Webhook', + properties: { + order_id: '35550298931313', + value: 600, + tax: 0, + currency: 'USD', + products: [ + { + product_id: '7234590408817', + price: 600.0, + brand: 'Hydrogen Vendor', + quantity: 1, + }, + ], + }, + timestamp: '2024-11-06T02:22:02.000Z', + traits: { + shippingAddress: [], + cart_token_hash: '9125e1da-57b9-5bdc-953e-eb2b0ded5edc', + }, + anonymousId: '9125e1da-57b9-5bdc-953e-eb2b0ded5edc', + }, ], }, }, @@ -1685,4 +2313,4 @@ export const checkoutEventsTestScenarios = [ }, }, }, -]; +].map((d1) => ({ ...d1, mockFns })); diff --git a/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts index d68d0a8f59c..25ce93aa8ce 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts @@ -68,6 +68,11 @@ export const genericTrackTestScenarios = [ event: 'Cart Update', integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, properties: { products: [], @@ -255,7 +260,7 @@ export const genericTrackTestScenarios = [ gift_card: false, grams: 0, name: 'The Collection Snowboard: Hydrogen', - price: '600.00', + price: 600, price_set: { shop_money: { amount: '600.00', @@ -267,7 +272,7 @@ export const genericTrackTestScenarios = [ }, }, product_exists: true, - product_id: 7234590408817, + product_id: '7234590408817', properties: [], quantity: 1, requires_shipping: true, @@ -469,7 +474,7 @@ export const genericTrackTestScenarios = [ gift_card: false, grams: 0, name: 'The Collection Snowboard: Hydrogen', - price: '600.00', + price: 600, price_set: { shop_money: { amount: '600.00', @@ -481,7 +486,7 @@ export const genericTrackTestScenarios = [ }, }, product_exists: true, - product_id: 7234590408817, + product_id: '7234590408817', properties: [], quantity: 1, requires_shipping: true, @@ -530,15 +535,20 @@ export const genericTrackTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Order Paid', properties: { products: [ { - product_id: 7234590408817, + product_id: '7234590408817', title: 'The Collection Snowboard: Hydrogen', - price: '600.00', + price: 600, brand: 'Hydrogen Vendor', quantity: 1, }, @@ -546,9 +556,30 @@ export const genericTrackTestScenarios = [ }, traits: { email: 'henry@wfls.com', + cart_token_hash: '9125e1da-57b9-5bdc-953e-eb2b0ded5edc', }, anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', }, + { + anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', + context: { + integration: { + name: 'SHOPIFY', + }, + library: { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }, + traits: { + email: 'henry@wfls.com', + }, + }, + integrations: { + SHOPIFY: true, + }, + type: 'identify', + }, ], }, }, diff --git a/test/integrations/sources/shopify/webhookTestScenarios/IdentifyTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/IdentifyTests.ts index b03f5635b6a..346485fe1e6 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/IdentifyTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/IdentifyTests.ts @@ -187,6 +187,11 @@ export const identityTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['identify.context.shopifyDetails'], + }, + }, }, type: 'identify', userId: '7358220173425', diff --git a/test/integrations/sources/signl4/data.ts b/test/integrations/sources/signl4/data.ts index b318bfb6df5..a8ca1850972 100644 --- a/test/integrations/sources/signl4/data.ts +++ b/test/integrations/sources/signl4/data.ts @@ -9,21 +9,26 @@ export const data = [ name: 'signl4', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - id: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + source: {}, }, ], method: 'POST', @@ -69,27 +74,32 @@ export const data = [ name: 'signl4', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - id: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + source: {}, }, ], method: 'POST', @@ -109,7 +119,10 @@ export const data = [ library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Signl4' }, externalId: [ - { type: 'signl4UserId', id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5' }, + { + type: 'signl4UserId', + id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + }, ], traits: { email: 'rene@signl4.com', name: 'Rene' }, }, @@ -140,27 +153,32 @@ export const data = [ name: 'signl4', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - id: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + source: {}, }, ], method: 'POST', @@ -180,7 +198,10 @@ export const data = [ library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Signl4' }, externalId: [ - { type: 'signl4UserId', id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5' }, + { + type: 'signl4UserId', + id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + }, ], traits: { email: 'rene@signl4.com', name: 'Rene' }, }, @@ -211,23 +232,28 @@ export const data = [ name: 'signl4', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - id: '27283793-47c8-4da2-9767-d37be224338d', + source: {}, }, ], method: 'POST', @@ -275,30 +301,35 @@ export const data = [ name: 'signl4', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), }, - id: '141c0f88-7831-4d5e-b055-f6e83c269770', + source: {}, }, ], method: 'POST', @@ -318,7 +349,10 @@ export const data = [ library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Signl4' }, externalId: [ - { type: 'signl4UserId', id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5' }, + { + type: 'signl4UserId', + id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + }, ], traits: { email: 'rene@signl4.com', name: 'Rene' }, }, @@ -350,15 +384,20 @@ export const data = [ name: 'signl4', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + eventType: 300, + eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', + team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + }), + }, + source: {}, }, ], method: 'POST', @@ -383,7 +422,10 @@ export const data = [ 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' }, + properties: { + eventType: 300, + 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f', + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -397,15 +439,20 @@ export const data = [ name: 'signl4', description: 'test-6', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + eventType: 301, + eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', + team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + }), + }, + source: {}, }, ], method: 'POST', @@ -430,7 +477,10 @@ export const data = [ 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' }, + properties: { + eventType: 301, + 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f', + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -444,16 +494,21 @@ export const data = [ name: 'signl4', description: 'test-7', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -473,7 +528,10 @@ export const data = [ library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Signl4' }, externalId: [ - { type: 'signl4UserId', id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504' }, + { + type: 'signl4UserId', + id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504', + }, ], }, integrations: { Signl4: false }, @@ -481,7 +539,10 @@ export const data = [ 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' }, + properties: { + eventType: 302, + 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f', + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -495,16 +556,21 @@ export const data = [ name: 'signl4', description: 'test-8', module: 'source', - version: 'v0', + version: 'v2', 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', + request: { + body: JSON.stringify({ + 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', + }), + }, + source: {}, }, ], method: 'POST', @@ -524,7 +590,10 @@ export const data = [ library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Signl4' }, externalId: [ - { type: 'signl4UserId', id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504' }, + { + type: 'signl4UserId', + id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504', + }, ], }, integrations: { Signl4: false }, @@ -532,7 +601,10 @@ export const data = [ 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' }, + properties: { + eventType: 303, + 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f', + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], diff --git a/test/integrations/sources/slack/data.ts b/test/integrations/sources/slack/data.ts index def8a63408b..7a4d29489cb 100644 --- a/test/integrations/sources/slack/data.ts +++ b/test/integrations/sources/slack/data.ts @@ -3,20 +3,23 @@ export const data = [ name: 'slack', description: 'Webhook url verificatin event', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - token: 'Jhj5dZrVaK7ZwHHjRyZWjbDl', - challenge: '3eZbrw1aB10FEMAGAZd4FyFQ', - type: 'url_verification', + request: { + body: JSON.stringify({ + token: 'Jhj5dZrVaK7ZwHHjRyZWjbDl', + challenge: '3eZbrw1aB10FEMAGAZd4FyFQ', + type: 'url_verification', + }), + }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -39,44 +42,47 @@ export const data = [ name: 'slack', description: 'Team joined event', module: 'source', - version: 'v0', + version: 'v2', 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, + request: { + body: JSON.stringify({ + 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', - user_id: 'U04G7H550', - is_bot: true, - is_enterprise_install: false, - }, - ], - is_ext_shared_channel: false, - event_context: 'eJldCI65436EUEpMSFhgfhg76joiQzAxRTRQTEIxMzUifQ', + 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', + }), + }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -89,23 +95,11 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'SLACK', - }, - externalId: [ - { - type: 'slackUserId', - id: 'W012CDE', - }, - ], - }, - integrations: { - SLACK: false, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'SLACK' }, + externalId: [{ type: 'slackUserId', id: 'W012CDE' }], }, + integrations: { SLACK: false }, type: 'identify', event: 'Team Join', anonymousId: '2bc5ae2825a712d3d154cbdacb86ac16c278', @@ -131,74 +125,74 @@ export const data = [ name: 'slack', description: 'Message event', module: 'source', - version: 'v0', + version: 'v2', 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: [ + request: { + body: JSON.stringify({ + 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_section', + type: 'rich_text', + block_id: 'xGKJl', elements: [ { - type: 'text', - text: 'What is the pricing of product X', - }, - { - type: 'channel', - channel_id: 'C03CDQTPI65', - }, - { - type: 'text', - text: ' to do this', + 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', }, - ], - 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, + type: 'event_callback', + event_id: 'EvY5JTJ0NG5', + event_time: 1709441309, + token: 'REm2987dqtpi72Lq', team_id: 'T0GFJL5J7', - user_id: 'W012CDE', - is_bot: true, - is_enterprise_install: false, - }, - ], - is_ext_shared_channel: false, - event_context: '4-wd6joiQfdgTRQTpIzdfifQ', + 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', + }), + }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -211,23 +205,11 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'SLACK', - }, - externalId: [ - { - type: 'slackUserId', - id: 'U04G7H550', - }, - ], - }, - integrations: { - SLACK: false, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'SLACK' }, + externalId: [{ type: 'slackUserId', id: 'U04G7H550' }], }, + integrations: { SLACK: false }, type: 'track', event: 'Message', anonymousId: '7509c04f547b05afb6838aa742f4910263d6', @@ -258,10 +240,7 @@ export const data = [ type: 'channel', channel_id: 'C03CDQTPI65', }, - { - type: 'text', - text: ' to do this', - }, + { type: 'text', text: ' to do this' }, ], }, ], diff --git a/test/integrations/sources/webhook/data.ts b/test/integrations/sources/webhook/data.ts new file mode 100644 index 00000000000..68fb8db10af --- /dev/null +++ b/test/integrations/sources/webhook/data.ts @@ -0,0 +1,227 @@ +import utils from '../../../../src/v0/util'; + +const ANONYMOUS_ID = '97fcd7b2-cc24-47d7-b776-057b7b199513'; +const defaultMockFns = () => { + jest.spyOn(utils, 'generateUUID').mockReturnValue(ANONYMOUS_ID); +}; + +export const data = [ + { + name: 'webhook', + description: 'successful webhook request with query params and headers', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({ + prop1: 'value1', + prop2: 'value2', + }), + method: 'POST', + url: '/v1/webhook?writeKey=write_key&query_param_key_1=query_param_value_1&query_param_key_2=query_param_value_2', + proto: 'HTTP/1.1', + headers: { + Connection: ['keep-alive'], + 'Content-Length': ['48'], + 'Content-Type': ['application/json'], + }, + query_parameters: { + query_param_key_1: ['query_param_value_1'], + query_param_key_2: ['query_param_value_2'], + writeKey: ['write_key'], + }, + }, + source: { + Config: { + putRequestDetailsInContext: true, + }, + }, + }, + { + request: { + body: JSON.stringify({ + prop1: 'value1', + prop2: 'value2', + }), + method: 'POST', + url: '/v1/webhook?writeKey=write_key&query_param_key_1=query_param_value_1&query_param_key_2=query_param_value_2', + proto: 'HTTP/1.1', + headers: { + Connection: ['keep-alive'], + 'Content-Length': ['48'], + 'Content-Type': ['application/json'], + }, + query_parameters: { + query_param_key_1: ['query_param_value_1'], + query_param_key_2: ['query_param_value_2'], + writeKey: ['write_key'], + }, + }, + source: { + Config: { + putRequestDetailsInContext: false, + }, + }, + }, + { + request: { + body: JSON.stringify({ + prop1: 'value1', + prop2: 'value2', + }), + method: 'POST', + url: '/v1/webhook?writeKey=write_key&query_param_key_1=query_param_value_1&query_param_key_2=query_param_value_2', + proto: 'HTTP/1.1', + headers: { + Connection: ['keep-alive'], + 'Content-Length': ['48'], + 'Content-Type': ['application/json'], + }, + query_parameters: { + query_param_key_1: ['query_param_value_1'], + query_param_key_2: ['query_param_value_2'], + writeKey: ['write_key'], + }, + }, + source: {}, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'webhook_source_event', + properties: { + prop1: 'value1', + prop2: 'value2', + }, + anonymousId: ANONYMOUS_ID, + context: { + method: 'POST', + url: '/v1/webhook?writeKey=write_key&query_param_key_1=query_param_value_1&query_param_key_2=query_param_value_2', + proto: 'HTTP/1.1', + headers: { + Connection: 'keep-alive', + 'Content-Length': '48', + 'Content-Type': 'application/json', + }, + query_parameters: { + query_param_key_1: 'query_param_value_1', + query_param_key_2: 'query_param_value_2', + writeKey: 'write_key', + }, + }, + }, + ], + }, + }, + { + output: { + batch: [ + { + type: 'track', + event: 'webhook_source_event', + properties: { + prop1: 'value1', + prop2: 'value2', + }, + anonymousId: ANONYMOUS_ID, + context: {}, + }, + ], + }, + }, + { + output: { + batch: [ + { + type: 'track', + event: 'webhook_source_event', + properties: { + prop1: 'value1', + prop2: 'value2', + }, + anonymousId: ANONYMOUS_ID, + context: {}, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'webhook', + description: 'failed webhook request with malformed JSON body', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: '{"prop1": "value1", "prop2": "value2"', + method: 'POST', + url: '/v1/webhook?writeKey=write_key&query_param_key_1=query_param_value_1&query_param_key_2=query_param_value_2', + proto: 'HTTP/1.1', + headers: { + Accept: ['*/*'], + 'Accept-Encoding': ['gzip, deflate, br'], + Connection: ['keep-alive'], + 'Content-Length': ['48'], + 'Content-Type': ['application/json'], + 'Postman-Token': ['1d06ebe8-086f-44dd-916a-ad5ab26959f6'], + 'User-Agent': ['PostmanRuntime/7.43.0'], + }, + query_parameters: { + query_param_key_1: ['query_param_value_1'], + query_param_key_2: ['query_param_value_2'], + writeKey: ['write_key'], + }, + }, + source: { + Config: { + putRequestDetailsInContext: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Malformed JSON in request body', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'webhook', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/testTypes.ts b/test/integrations/testTypes.ts index b11403f50a5..29d777219d7 100644 --- a/test/integrations/testTypes.ts +++ b/test/integrations/testTypes.ts @@ -1,12 +1,16 @@ import { AxiosResponse } from 'axios'; import MockAdapter from 'axios-mock-adapter'; +import { BaseTestCase } from '@rudderstack/integrations-lib'; + import { DeliveryV1Response, + Metadata, ProcessorTransformationRequest, ProcessorTransformationResponse, ProxyV1Request, RouterTransformationRequest, RouterTransformationResponse, + RudderMessage, } from '../../src/types'; export interface requestType { @@ -38,13 +42,14 @@ export interface mockType { response: responseType; } -export interface TestCaseData { +export interface TestCaseData extends BaseTestCase { id?: string; name: string; description: string; skipGo?: string; scenario?: string; successCriteria?: string; + tags?: string[]; comment?: string; feature: string; module: string; @@ -57,6 +62,14 @@ export interface TestCaseData { mockFns?: (mockAdapter: MockAdapter) => {}; } +export interface ExtendedTestCaseData { + // use this to add any new properties for dynamic test cases + // this will keep the base TestCaseData structure generic and intact + tcData: TestCaseData; + sourceTransformV2Flag?: boolean; + descriptionSuffix?: string; +} + export type MockFns = (mockAdapter: MockAdapter) => void; export interface SrcTestCaseData { @@ -92,7 +105,8 @@ export type ProcessorTestData = { version: string; input: { request: { - body: ProcessorTransformationRequest[]; + method: string; + body: ProcessorTransformationRequest, Partial>[]; }; }; output: { @@ -115,7 +129,8 @@ export type RouterTestData = { version: string; input: { request: { - body: RouterTransformationRequest; + body: RouterTransformationRequest, Partial>; + method: string; }; }; output: { @@ -128,7 +143,7 @@ export type RouterTestData = { }; }; -export type ProxyV1TestData = { +export type ProxyV1TestData = BaseTestCase & { id: string; name: string; description: string; diff --git a/test/integrations/testUtils.ts b/test/integrations/testUtils.ts index 73d08e452c2..6c234bcd0f3 100644 --- a/test/integrations/testUtils.ts +++ b/test/integrations/testUtils.ts @@ -1,10 +1,10 @@ import { globSync } from 'glob'; import { join } from 'path'; import { MockHttpCallsData, TestCaseData } from './testTypes'; -import MockAdapter from 'axios-mock-adapter'; +import MockAxiosAdapter from 'axios-mock-adapter'; import isMatch from 'lodash/isMatch'; import { OptionValues } from 'commander'; -import { removeUndefinedAndNullValues } from '@rudderstack/integrations-lib'; +import { filter, removeUndefinedAndNullValues } from '@rudderstack/integrations-lib'; import tags from '../../src/v0/util/tags'; import { existsSync, mkdirSync, writeFileSync } from 'fs'; import { Destination, ProxyMetdata, ProxyV0Request, ProxyV1Request } from '../../src/types'; @@ -18,9 +18,14 @@ import { ProxyV1RequestSchema, RouterTransformationResponseListSchema, } from '../../src/types/zodTypes'; +import { defaultAccessToken } from './common/secrets'; +import { randomBytes } from 'crypto'; -const generateAlphanumericId = (size = 36) => - [...Array(size)].map(() => ((Math.random() * size) | 0).toString(size)).join(''); +const generateAlphanumericId = (size = 36) => { + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + const bytes = randomBytes(size); + return Array.from(bytes, (byte) => chars[byte % chars.length]).join(''); +}; export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): string[] => { const globPattern = join(dirPath, '**', 'data.ts'); let testFilePaths = globSync(globPattern); @@ -28,8 +33,9 @@ export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): strin const destinationOrSource = opts.destination || opts.source; if (destinationOrSource) { - filteredTestFilePaths = testFilePaths.filter( - (testFile) => destinationOrSource && testFile.includes(`${destinationOrSource}/`), + const resources = destinationOrSource.split(','); + filteredTestFilePaths = testFilePaths.filter((testFile) => + resources.some((resource) => testFile.includes(`/${resource}/`)), ); } if (opts.feature) { @@ -41,27 +47,54 @@ export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): strin }; export const getTestData = (filePath): TestCaseData[] => { - return require(filePath).data as TestCaseData[]; + const { data, skip } = require(filePath); + return skip ? [] : filter(data as TestCaseData[]); +}; + +export const getTestSecrets = (destination: string) => { + const filePath = join(__dirname, 'destinations', destination, 'maskedSecrets.ts'); + return require(filePath); }; export const getMockHttpCallsData = (filePath): MockHttpCallsData[] => { return require(filePath).networkCallsData as MockHttpCallsData[]; }; -export const getAllTestMockDataFilePaths = (dirPath: string, destination: string): string[] => { +export const registerAxiosMocks = ( + mockAdapter: MockAxiosAdapter, + axiosMocks: MockHttpCallsData[], +) => { + axiosMocks.forEach((axiosMock) => addMock(mockAdapter, axiosMock)); +}; + +export const getAllTestMockDataFilePaths = (dirPath: string, resourceName?: string): string[] => { const globPattern = join(dirPath, '**', 'network.ts'); let testFilePaths = globSync(globPattern); - if (destination) { + + if (resourceName) { + const resources = resourceName.split(','); const commonTestFilePaths = testFilePaths.filter((testFile) => testFile.includes('test/integrations/common'), ); - testFilePaths = testFilePaths.filter((testFile) => testFile.includes(destination)); + testFilePaths = testFilePaths.filter((testFile) => + resources.some((resource) => testFile.includes(`/${resource}/`)), + ); testFilePaths = [...commonTestFilePaths, ...testFilePaths]; } return testFilePaths; }; -export const addMock = (mock: MockAdapter, axiosMock: MockHttpCallsData) => { +export const getTestMockData = (resourceName?: string) => { + const allTestMockDataFilePaths = getAllTestMockDataFilePaths(__dirname, resourceName); + return allTestMockDataFilePaths + .map((currPath) => { + const mockNetworkCallsData: MockHttpCallsData[] = getMockHttpCallsData(currPath); + return mockNetworkCallsData; + }) + .flat(); +}; + +export const addMock = (mock: MockAxiosAdapter, axiosMock: MockHttpCallsData) => { const { url, method, data: reqData, params, ...opts } = axiosMock.httpReq; const { data, headers, status } = axiosMock.httpRes; @@ -98,6 +131,7 @@ export const addMock = (mock: MockAdapter, axiosMock: MockHttpCallsData) => { break; } }; + export const overrideDestination = (destination: Destination, overrideConfigValues) => { return Object.assign({}, destination, { Config: { ...destination.Config, ...overrideConfigValues }, @@ -480,7 +514,7 @@ export const generateProxyV0Payload = ( workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }; @@ -522,7 +556,7 @@ export const generateProxyV1Payload = ( workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: payloadParameters.accessToken || 'default-accessToken', + accessToken: payloadParameters.accessToken || defaultAccessToken, }, dontBatch: false, }, @@ -604,7 +638,7 @@ export const generateMetadata = (jobId: number, userId?: string): any => { destinationId: 'default-destinationId', workspaceId: 'default-workspaceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }; @@ -618,7 +652,7 @@ export const generateGoogleOAuthMetadata = (jobId: number): any => { destinationId: 'default-destinationId', workspaceId: 'default-workspaceId', secret: { - access_token: 'default-accessToken', // applicable for google destinations + access_token: defaultAccessToken, // applicable for google destinations }, dontBatch: false, }; diff --git a/test/scripts/migrateTest.ts b/test/scripts/migrateTest.ts new file mode 100644 index 00000000000..6757aa4bd12 --- /dev/null +++ b/test/scripts/migrateTest.ts @@ -0,0 +1,155 @@ +import fs from 'fs'; +import path from 'path'; + +import prettier from 'prettier'; +import { Command } from 'commander'; + +// Initialize command line options +const program = new Command(); +program + .option('-d, --destination ', 'Destination name to migrate') + .option('-f, --feature ', 'Feature type (processor/router/proxy)', 'processor') + // .option('-p, --path ', 'Base path for test files', path.join(__dirname, 'destinations')) + .parse(process.argv); + +const options = program.opts(); + +// Default values and utility functions from the previous example +import { + migrateProcessorTestCase, + migrateRouterTestCase, + migrateProxyTestCase, + extractCommonValues, + generateOptimizedTestFile, +} from './migrationUtils'; +import { getTestData, getTestDataFilePaths } from '../integrations/testUtils'; + +function readTestFile(filePath: string): any { + try { + const fileContent = getTestData(filePath); + return fileContent; + } catch (error) { + console.error(`Error reading test file ${filePath}:`, error); + return null; + } +} + +async function formatWithPrettier(content: string, filepath: string): Promise { + try { + // Try to load prettier config from the project + const prettierConfig = await prettier.resolveConfig(filepath); + + // Format the content using prettier with either found config or defaults + const formattedContent = await prettier.format(content, { + ...prettierConfig, + filepath, // This helps prettier determine parser based on file extension + parser: 'typescript', // Fallback to typescript parser if not determined from filepath + }); + + return formattedContent; + } catch (error) { + console.error('Error formatting file with prettier:', error); + // Return original content if formatting fails + return content; + } +} + +async function enhancedwriteTestFile( + filePath: string, + testCases: any[], + feature: string, +): Promise { + try { + // Extract common values + const commonValues = extractCommonValues(testCases); + + // Generate optimized content + const content = generateOptimizedTestFile(testCases, commonValues, feature); + + // Format with prettier + const formattedContent = await formatWithPrettier(content, filePath); + + // Write the formatted content + fs.writeFileSync(filePath, formattedContent); + } catch (error) { + console.error(`Error writing to file ${filePath}:`, error); + throw error; + } +} + +async function migrateTestFiles(): Promise { + const { destination, feature } = options; + + if (!destination) { + console.error('Please specify a destination with -d or --destination'); + process.exit(1); + } + + console.log(`Starting migration for destination: ${destination}, feature: ${feature}`); + + const basePath = path.resolve(__dirname, '..'); + + const testFiles = getTestDataFilePaths(basePath, options); + + if (testFiles.length === 0) { + console.log('No test files found matching the criteria'); + return; + } + + let migratedCount = 0; + let errorCount = 0; + + for (const filePath of testFiles) { + console.log(`\nProcessing file: ${filePath}`); + try { + const testCases = readTestFile(filePath); + if (!testCases) continue; + + const migratedTests = testCases.map((testCase: any, index: number) => { + try { + switch (feature.toLowerCase()) { + case 'processor': + return migrateProcessorTestCase(testCase, index); + case 'router': + return migrateRouterTestCase(testCase, index); + case 'proxy': + return migrateProxyTestCase(testCase, index); + default: + throw new Error(`Unsupported feature type: ${feature}`); + } + } catch (error) { + console.error(`Error migrating test case: ${testCase.name || 'unnamed'}`, error); + return testCase; + } + }); + + // Create backup of original file + const backupPath = filePath.replace('data.ts', 'data.backup.ts'); + fs.copyFileSync(filePath, backupPath); + console.log(`Created backup at: ${backupPath}`); + + // Write migrated tests + await enhancedwriteTestFile(filePath, migratedTests, feature.toLowerCase()); + console.log(`Successfully migrated ${migratedTests.length} test cases in ${filePath}`); + migratedCount += migratedTests.length; + } catch (error) { + console.error(`Error processing file ${filePath}:`, error); + errorCount++; + } + } + + console.log('\nMigration Summary:'); + console.log(`Total files processed: ${testFiles.length}`); + console.log(`Total test cases migrated: ${migratedCount}`); + console.log(`Files with errors: ${errorCount}`); +} + +// Run migration if this script is called directly +if (require.main === module) { + migrateTestFiles().catch((error) => { + console.error('Migration failed:', error); + process.exit(1); + }); +} + +export { migrateTestFiles }; diff --git a/test/scripts/migrationUtils.ts b/test/scripts/migrationUtils.ts new file mode 100644 index 00000000000..67d158a85fa --- /dev/null +++ b/test/scripts/migrationUtils.ts @@ -0,0 +1,465 @@ +import { removeUndefinedValues } from '@rudderstack/integrations-lib'; +import { + Metadata, + Destination, + ProcessorTransformationRequest, + RouterTransformationRequest, + ProxyV1Request, + ProcessorTransformationResponse, + RouterTransformationResponse, +} from '../../src/types'; + +import { + TestCaseData, + ProcessorTestData, + RouterTestData, + ProxyV1TestData, +} from '../integrations/testTypes'; + +// Default metadata to fill in missing fields +const defaultMetadata: Metadata = { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: new Date().toISOString(), + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, +}; + +// Default destination configuration +const defaultDestination: Destination = { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: {}, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, +}; + +// Utility function to migrate generic test cases +export function migrateTestCase(oldTestCase: any): TestCaseData { + return { + id: oldTestCase.id || `test-${Date.now()}`, + name: oldTestCase.name || 'Migrated Test Case', + description: oldTestCase.description || 'Migrated from legacy test case', + scenario: oldTestCase.scenario || 'Default scenario', + successCriteria: oldTestCase.successCriteria || 'Test should pass successfully', + feature: oldTestCase.feature || 'default-feature', + module: oldTestCase.module || 'default-module', + version: oldTestCase.version || '1.0.0', + input: { + request: { + method: oldTestCase.input?.request?.method || 'POST', + body: oldTestCase.input?.request?.body || {}, + headers: oldTestCase.input?.request?.headers || {}, + params: oldTestCase.input?.request?.params || {}, + }, + pathSuffix: oldTestCase.input?.pathSuffix, + }, + output: { + response: { + status: oldTestCase.output?.response?.status || 200, + body: oldTestCase.output?.response?.body || {}, + headers: oldTestCase.output?.response?.headers || {}, + }, + }, + }; +} + +// Utility function to migrate processor test cases +export function migrateProcessorTestCase(oldTestCase: any, index: number): ProcessorTestData { + const processorRequest: ProcessorTransformationRequest = { + message: oldTestCase.input?.request?.body[0]?.message || {}, + metadata: { ...defaultMetadata, ...oldTestCase.input?.request?.body[0]?.metadata }, + destination: { ...defaultDestination, ...oldTestCase.input?.request?.body[0]?.destination }, + }; + + const processorResponse: ProcessorTransformationResponse = { + output: oldTestCase.output?.response?.body[0]?.output, + metadata: { ...defaultMetadata, ...oldTestCase.output?.response?.body[0]?.metadata }, + statusCode: oldTestCase.output?.response?.body[0]?.statusCode || 200, + error: oldTestCase.output?.response?.body[0]?.error, + statTags: oldTestCase.output?.response?.body[0]?.statTags, + }; + + return removeUndefinedValues({ + id: oldTestCase.id || `processor-${Date.now()}`, + name: oldTestCase.name || 'Processor Test Case', + description: oldTestCase.description || 'Migrated processor test case', + scenario: oldTestCase.scenario || 'Default processor scenario', + successCriteria: oldTestCase.successCriteria || 'Processor test should pass successfully', + feature: oldTestCase.feature || 'processor', + module: oldTestCase.module || 'transformation', + version: oldTestCase.version || '1.0.0', + input: { + request: { + method: oldTestCase.input?.request?.method || 'POST', + body: [processorRequest], + }, + }, + output: { + response: { + status: 200, + body: [processorResponse], + }, + }, + mockFns: oldTestCase.mockFns ? `Add mock of index ${index}` : undefined, + }) as ProcessorTestData; +} + +// Utility function to migrate router test cases +export function migrateRouterTestCase(oldTestCase: any, index: number): RouterTestData { + const input = Array.isArray(oldTestCase.input.request.body.input) + ? oldTestCase.input.request.body.input.map((item: any) => ({ + message: item.message || {}, + metadata: { ...defaultMetadata, ...item.metadata }, + destination: { ...defaultDestination, ...item.destination }, + })) + : { + message: oldTestCase.input.request.body.input?.message || {}, + metadata: { ...defaultMetadata, ...oldTestCase.input.request.body.input?.metadata }, + destination: { + ...defaultDestination, + ...oldTestCase.input.request.body.input?.destination, + }, + }; + const routerRequest: RouterTransformationRequest = { + input: input, + destType: oldTestCase.input?.request?.body?.destType || 'default-destination-type', + }; + + const routerResponse: RouterTransformationResponse = oldTestCase.output.response.body.output.map( + (op) => { + return removeUndefinedValues({ + batchedRequest: op.batchedRequest, + metadata: op.metadata.map((m: any) => ({ ...defaultMetadata, ...m })), + statusCode: op.statusCode || 200, + destination: { ...defaultDestination, ...op.destination }, + batched: op.batched || false, + error: op.error, + statTags: op.statTags, + }); + }, + ); + + return removeUndefinedValues({ + id: oldTestCase.id || `router-${Date.now()}`, + name: oldTestCase.name || 'Router Test Case', + description: oldTestCase.description || 'Migrated router test case', + scenario: oldTestCase.scenario || 'Default router scenario', + successCriteria: oldTestCase.successCriteria || 'Router test should pass successfully', + feature: oldTestCase.feature || 'router', + module: oldTestCase.module || 'transformation', + version: oldTestCase.version || '1.0.0', + input: { + request: { + body: routerRequest, + method: oldTestCase.input?.request?.method || 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: routerResponse, + }, + }, + }, + mockFns: oldTestCase.mockFns ? `Add mock of index ${index}` : undefined, + }) as RouterTestData; +} + +// Utility function to migrate proxy test cases +export function migrateProxyTestCase(oldTestCase: any, index: number): ProxyV1TestData { + const proxyRequest: ProxyV1Request = { + version: oldTestCase.input?.request?.body?.version || '1.0.0', + type: oldTestCase.input?.request?.body?.type || 'default-type', + method: oldTestCase.input?.request?.body?.method || 'POST', + endpoint: oldTestCase.input?.request?.body?.endpoint || '/default-endpoint', + userId: oldTestCase.input?.request?.body?.userId || 'default-user', + metadata: [ + { + jobId: 1, + attemptNum: 1, + userId: 'default-user', + sourceId: 'default-source', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + secret: {}, + dontBatch: false, + }, + ], + destinationConfig: {}, + }; + + return { + id: oldTestCase.id || `proxy-${Date.now()}`, + name: oldTestCase.name || 'Proxy Test Case', + description: oldTestCase.description || 'Migrated proxy test case', + scenario: oldTestCase.scenario || 'Default proxy scenario', + successCriteria: oldTestCase.successCriteria || 'Proxy test should pass successfully', + feature: oldTestCase.feature || 'proxy', + module: oldTestCase.module || 'delivery', + version: oldTestCase.version || '1.0.0', + input: { + request: { + body: proxyRequest, + method: oldTestCase.input?.request?.method || 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: 'Success', + response: [ + { + error: '', + statusCode: 200, + metadata: proxyRequest.metadata[0], + }, + ], + }, + }, + }, + }, + }; +} + +interface CommonValues { + metadata?: Metadata; + destination?: Destination; + baseRequest?: { + headers?: Record; + params?: Record; + }; + commonConfig?: Record; +} + +function deepDiff(obj1: any, obj2: any): any { + const diff: any = {}; + + for (const key in obj1) { + if (typeof obj1[key] === 'object' && obj1[key] !== null) { + const nestedDiff = deepDiff(obj1[key], obj2[key] || {}); + if (Object.keys(nestedDiff).length > 0) { + diff[key] = nestedDiff; + } + } else if (obj1[key] !== obj2[key]) { + diff[key] = obj2[key]; + } + } + + return diff; +} + +export function extractCommonValues(testCases: any[]): CommonValues { + const commonValues: CommonValues = {}; + + // Only proceed if we have test cases + if (testCases.length === 0) return commonValues; + + // Extract metadata from first test case as base + const firstCase = testCases[0]; + let isMetadataCommon = true; + let isDestinationCommon = true; + let baseMetadata: Metadata | undefined; + let baseDestination: Destination | undefined; + + // For processor and router cases + if (firstCase.input?.request?.body) { + if (Array.isArray(firstCase.input.request.body)) { + baseMetadata = firstCase.input.request.body[0]?.metadata; + baseDestination = firstCase.input.request.body[0]?.destination; + } else { + baseMetadata = firstCase.input.request.body?.metadata; + baseDestination = firstCase.input.request.body?.destination; + } + } + + // Compare with other test cases + for (const testCase of testCases.slice(1)) { + let currentMetadata; + let currentDestination; + + if (testCase.input?.request?.body) { + if (Array.isArray(testCase.input.request.body)) { + currentMetadata = testCase.input.request.body[0]?.metadata; + currentDestination = testCase.input.request.body[0]?.destination; + } else { + currentMetadata = testCase.input.request.body?.metadata; + currentDestination = testCase.input.request.body?.destination; + } + } + + // Check if metadata is common + if (baseMetadata && currentMetadata) { + const metadataDiff = deepDiff(baseMetadata, currentMetadata); + if (Object.keys(metadataDiff).length > 0) { + isMetadataCommon = false; + } + } + + // Check if destination is common + if (baseDestination && currentDestination) { + const destinationDiff = deepDiff(baseDestination, currentDestination); + if (Object.keys(destinationDiff).length > 0) { + isDestinationCommon = false; + } + } + } + + if (isMetadataCommon && baseMetadata) { + commonValues.metadata = baseMetadata; + } + + if (isDestinationCommon && baseDestination) { + commonValues.destination = baseDestination; + } + + return commonValues; +} + +export function generateOptimizedTestFile( + testCases: any[], + commonValues: CommonValues, + feature: string, +): string { + const variables: string[] = []; + const imports: Set = new Set([]); + + // Add necessary imports based on common values + if (commonValues.metadata) imports.add('Metadata'); + if (commonValues.destination) imports.add('Destination'); + + // Generate common variables + if (commonValues.metadata) { + variables.push( + `const baseMetadata: Metadata = ${JSON.stringify(commonValues.metadata, null, 2)};`, + ); + } + + if (commonValues.destination) { + variables.push(` +const baseDestination: Destination = ${JSON.stringify(commonValues.destination, null, 2)};`); + } + + // Process test cases to use common variables + const processedTests = testCases.map((testCase) => { + const processedCase = { ...testCase }; + + if (commonValues.metadata && testCase.input?.request?.body) { + // Handle input metadata + if (Array.isArray(testCase.input.request.body)) { + processedCase.input.request.body = testCase.input.request.body.map((item: any) => ({ + ...item, + metadata: 'baseMetadata', // special marker + })); + } else { + processedCase.input.request.body.metadata = 'baseMetadata'; // special marker + processedCase.output.metadata = 'baseMetadata'; // special marker + } + // Handle output metadata + if (Array.isArray(testCase.output.response.body)) { + processedCase.output.response.body = testCase.output.response.body.map((item: any) => ({ + ...item, + metadata: 'baseMetadata', // special marker + })); + } else { + processedCase.output.response.body.metadata = 'baseMetadata'; // special marker + } + } + + if (commonValues.destination && testCase.input?.request?.body) { + // Handle input destination + if (Array.isArray(testCase.input.request.body)) { + processedCase.input.request.body = testCase.input.request.body.map((item: any) => ({ + ...item, + destination: 'baseDestination', // special marker + })); + } else { + processedCase.input.request.body.destination = 'baseDestination'; // special marker + } + // Handle output destination + if (Array.isArray(testCase.output.response.body)) { + processedCase.output.response.body = testCase.output.response.body.map((item: any) => ({ + ...item, + metadata: 'baseMetadata', // special marker + })); + } else { + processedCase.output.response.body.metadata = 'baseMetadata'; // special marker + } + } + + return processedCase; + }); + + // const functionReplacer = (key, value) => { + // if (typeof value === 'function') { + // return value.toString(); + // } + // return value; + // }; + + let type = ''; + if (feature === 'processor') { + type = 'ProcessorTestData'; + } else if (feature === 'router') { + type = 'RouterTestData'; + } + + // Generate the final file content + const content = `/** + * Auto-migrated and optimized test cases + * Generated on: ${new Date().toISOString()} + */ + + import { ${type} } from '../../../testTypes'; + import { ${Array.from(imports).join(', ')} } from '../../../../../src/types'; + + ${variables.join('\n')} + + export const data: ${type}[] = ${JSON.stringify(processedTests, null, 2)}; + `; + + // Replace our special markers with actual variable references + return content + .replaceAll('"baseMetadata"', 'baseMetadata') + .replaceAll('"baseDestination"', 'baseDestination'); +} diff --git a/test/scripts/removeRedundentFunctionsFromSecrets.ts b/test/scripts/removeRedundentFunctionsFromSecrets.ts new file mode 100644 index 00000000000..0419c32d68d --- /dev/null +++ b/test/scripts/removeRedundentFunctionsFromSecrets.ts @@ -0,0 +1,73 @@ +#!/usr/bin/env node +/** + * This script will: + * 1. Find all .js and .ts files (except in node_modules). + * 2. For any file with “maskedSecrets” in its path, update the export declarations: + * - Convert “export const getAuthHeader_N = () => …;” to “export const authHeaderN = …;” + * - Convert “export const getSecret_N = () => …;” to “export const secretN = …;” + * (Also update inner calls from getSecret_N() to secretN.) + * 3. For all files, update import statements and function usages. + */ + +import fs from 'fs'; +import { globSync } from 'glob'; +import path from 'path'; + +const updateFileContent = (content: string, filePath: string) => { + let newContent = content; + + // --- 1. Update export declarations in maskedSecrets files --- + if (filePath.includes('maskedSecrets')) { + // Replace getAuthHeader declarations + newContent = newContent.replace( + /export\s+const\s+getAuthHeader_(\d+)\s*=\s*\(\)\s*=>\s*(.+);/g, + (match, num, body) => { + // Update inner reference from getSecret_N() to secretN + const modifiedBody = body.replace(/getSecret_(\d+)\(\)/g, 'secret$1'); + // Remove the "get" part and also remove the underscore before the number + return `export const authHeader${num} = ${modifiedBody};`; + }, + ); + + // Replace getSecret declarations + newContent = newContent.replace( + /export\s+const\s+getSecret_(\d+)\s*=\s*\(\)\s*=>\s*(.+);/g, + (match, num, body) => { + return `export const secret${num} = ${body};`; + }, + ); + } + + // --- 2. Update import statements and usage in all files --- + // Replace function call usages: e.g. getAuthHeader_1() -> authHeader1 and getSecret_1() -> secret1 + newContent = newContent + .replace(/getAuthHeader_(\d+)\s*\(\)/g, 'authHeader$1') + .replace(/getSecret_(\d+)\s*\(\)/g, 'secret$1') + // Also update any identifier (such as in import lists) so that the "get" prefix is removed. + .replace(/\bgetAuthHeader_(\d+)\b/g, 'authHeader$1') + .replace(/\bgetSecret_(\d+)\b/g, 'secret$1'); + + return newContent; +}; + +// Find all maskedSecrets.ts files matching the pattern. +const maskedSecretsFiles = globSync( + path.join(__dirname, '..', 'integrations', 'destinations', '**', '*.ts'), +); + +maskedSecretsFiles.forEach((filePath) => { + fs.readFile(filePath, 'utf8', (err, data) => { + if (err) { + console.error('Error reading file:', filePath, err); + return; + } + const updatedContent = updateFileContent(data, filePath); + fs.writeFile(filePath, updatedContent, 'utf8', (err) => { + if (err) { + console.error('Error writing file:', filePath, err); + } else { + console.log('File updated successfully:', filePath); + } + }); + }); +}); diff --git a/test/test_reporter/allureReporter.ts b/test/test_reporter/allureReporter.ts new file mode 100644 index 00000000000..3165aaa96a7 --- /dev/null +++ b/test/test_reporter/allureReporter.ts @@ -0,0 +1,134 @@ +import * as allure from 'allure-js-commons'; +import { diff as jsonDiff } from 'jest-diff'; +import _ from 'lodash'; +import { TestCaseData } from '../integrations/testTypes'; +import { compareObjects } from '../integrations/testUtils'; + +interface TestReportData { + testCase: TestCaseData; + actualResponse: any; + status: 'passed' | 'failed'; + diff?: string; +} + +/** + * Enhanced test reporter with detailed JSON diff and Allure integration + */ +export const enhancedTestReport = { + /** + * Generate a detailed test report with JSON diff for failed cases + */ + generateDetailedReport(data: TestReportData) { + const { testCase, actualResponse, status } = data; + const expectedResponse = testCase.output.response?.body; + + // Create Allure test case details + allure.description(` + Feature: ${testCase.feature} + Description: ${testCase.description} + Success Criteria: ${testCase.successCriteria || 'N/A'} + Scenario: ${testCase.scenario || 'N/A'} + Test ID: ${testCase.id || 'N/A'} + API Version: ${testCase.version || 'N/A'} + `); + + // Add request/response as attachments + allure.attachment( + 'Request', + JSON.stringify(testCase.input.request, null, 2), + 'application/json', + ); + allure.attachment( + 'Actual Response', + JSON.stringify(actualResponse, null, 2), + 'application/json', + ); + + if (status === 'failed') { + const diffResult = jsonDiff(expectedResponse, actualResponse, { + expand: false, // Compact diff view + contextLines: 3, // Show 3 lines of context around changes + }); + + const diffKeys = compareObjects(expectedResponse, actualResponse); + + if (diffResult) { + allure.attachment( + 'Expected Response', + JSON.stringify(expectedResponse, null, 2), + 'application/json', + ); + + allure.attachment('Diff Keys', JSON.stringify(diffKeys), 'text/plain'); + } + + // Add failure details + const failureMessage = `Test failed for ${testCase.name}\nSee JSON diff for details`; + allure.step(failureMessage, () => { + throw new Error(failureMessage); + }); + } + + return status; + }, + + /** + * Validate test case response with enhanced reporting + */ + validateTestResponse(testCase: TestCaseData, response: any): boolean { + const expectedResponse = testCase.output.response?.body; + const actualResponse = response; + const status = _.isEqual(actualResponse, expectedResponse) ? 'passed' : 'failed'; + + this.generateDetailedReport({ + testCase, + actualResponse, + status, + }); + + return status === 'passed'; + }, +}; + +/** + * Enhanced test utilities with better organization + */ +export const enhancedTestUtils = { + /** + * Setup test suite with Allure reporting + */ + setupTestSuite(testData: TestCaseData) { + allure.epic(testData.name); + allure.feature(testData.module); + allure.story(testData.feature); + allure.displayName(testData.description); + if (testData.scenario) { + allure.tag(testData.scenario); + } + if (testData.tags) { + allure.tags(...testData.tags); + } + if (testData.id) { + allure.allureId(testData.id); + } + }, + + /** + * Run pre-test preparations + */ + beforeTestRun(testCase: TestCaseData) { + allure.step('Test Setup', () => { + // Setup new test + this.setupTestSuite(testCase); + }); + }, + + /** + * Run post-test cleanup and reporting + */ + afterTestRun(testCase: TestCaseData, response: any) { + allure.step('Test Verification', () => { + return enhancedTestReport.validateTestResponse(testCase, response); + }); + }, +}; diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 00000000000..44502a8a371 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["node_modules", "dist"], + "include": ["src/**/*.ts", "test/**/*.ts"], + "compilerOptions": { + "outDir": "./dist-test" + } +}