From 0008277fe43d20ced4066f8f1f1b0f1d12345f01 Mon Sep 17 00:00:00 2001 From: Mihir Bhalala <77438541+mihir-4116@users.noreply.github.com> Date: Tue, 26 Sep 2023 15:09:02 +0530 Subject: [PATCH 1/8] feat(gaec): partial failures handling (#2631) * chore: partial failure handling * chore: code review changes --- .../networkHandler.js | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js b/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js index e79c568238..9fa0e9a3a4 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js @@ -107,7 +107,23 @@ const responseHandler = (destinationResponse) => { const message = 'Request Processed Successfully'; const { status } = destinationResponse; if (isHttpStatusSuccess(status)) { - // Mostly any error will not have a status of 2xx + // for google ads enhance conversions the partialFailureError returns with status 200 + const { partialFailureError } = destinationResponse.response; + // non-zero code signifies partialFailure + // Ref - https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto + if (partialFailureError && partialFailureError.code !== 0) { + throw new NetworkError( + `[Google Ads Offline Conversions]:: partialFailureError - ${JSON.stringify( + partialFailureError, + )}`, + 400, + { + [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(400), + }, + partialFailureError, + ); + } + return { status, message, @@ -127,7 +143,7 @@ const responseHandler = (destinationResponse) => { getAuthErrCategoryFromErrDetailsAndStCode(status, response), ); }; -// eslint-disable-next-line func-names + class networkHandler { constructor() { this.proxy = ProxyRequest; @@ -136,4 +152,5 @@ class networkHandler { this.prepareProxy = prepareProxyRequest; } } + module.exports = { networkHandler }; From deddae1722259be6d5d4e4abca8366b6619cd909 Mon Sep 17 00:00:00 2001 From: Ujjwal Abhishek <63387036+ujjwal-ab@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:37:53 +0530 Subject: [PATCH 2/8] chore: move unit tests to correct place for mssql and postgres (#2657) * chore: move unit tests to correct place for mssql and postgres * chore: replace var to const * chore: replace var to const --- src/v0/destinations/mssql/transform.test.js | 48 ++++++++++++++++++ .../destinations/postgres/transform.test.js | 48 ++++++++++++++++++ test/__tests__/mssql.test.js | 50 ------------------- test/__tests__/postgres.test.js | 50 ------------------- 4 files changed, 96 insertions(+), 100 deletions(-) create mode 100644 src/v0/destinations/mssql/transform.test.js create mode 100644 src/v0/destinations/postgres/transform.test.js delete mode 100644 test/__tests__/mssql.test.js delete mode 100644 test/__tests__/postgres.test.js diff --git a/src/v0/destinations/mssql/transform.test.js b/src/v0/destinations/mssql/transform.test.js new file mode 100644 index 0000000000..0892651b21 --- /dev/null +++ b/src/v0/destinations/mssql/transform.test.js @@ -0,0 +1,48 @@ +const { getDataType } = require('../../../../src/warehouse/index'); +const { getDataTypeOverride } = require('./transform'); + +const testCases = [ + { + name: 'normalInt', + data: 1, + type: 'int', + }, + { + name: 'normalFloat', + data: 2.01, + type: 'float', + }, + { + name: 'normalBoolean', + data: true, + type: 'boolean', + }, + { + name: 'normalString', + data: 'mssql transformation[*007}', + type: 'string', + }, + { + name: 'violationErrors', + data: [ + { + message: + 'no schema for eventName : Product Purchased new, eventType : track in trackingPlanID : tp_20dfXJDpotQWHe7hMxfQfgWMZDv::1', + meta: {}, + type: 'Unplanned-Event', + }, + ], + type: 'string', + }, +]; + +describe('MSSQL data types testing', () => { + const options = {}; + options.getDataTypeOverride = getDataTypeOverride; + testCases.forEach((testCase) => { + it(`should return data type ${testCase.type} for this input data ${testCase.data} everytime`, () => { + const dataType = getDataType(testCase.name, testCase.data, options); + expect(dataType).toEqual(testCase.type); + }); + }); +}); diff --git a/src/v0/destinations/postgres/transform.test.js b/src/v0/destinations/postgres/transform.test.js new file mode 100644 index 0000000000..9256d5bcde --- /dev/null +++ b/src/v0/destinations/postgres/transform.test.js @@ -0,0 +1,48 @@ +const { getDataType } = require('../../../../src/warehouse/index'); +const { getDataTypeOverride } = require('./transform'); + +const testCases = [ + { + name: 'normalInt', + data: 1, + type: 'int', + }, + { + name: 'normalFloat', + data: 2.01, + type: 'float', + }, + { + name: 'normalBoolean', + data: true, + type: 'boolean', + }, + { + name: 'normalString', + data: 'postgres transformation[*007}', + type: 'string', + }, + { + name: 'violationErrors', + data: [ + { + message: + 'no schema for eventName : Product Purchased new, eventType : track in trackingPlanID : tp_20dfXJDpotQWHe7hMxfQfgWMZDv::1', + meta: {}, + type: 'Unplanned-Event', + }, + ], + type: 'json', + }, +]; + +describe('Postgres data types testing', () => { + const options = {}; + options.getDataTypeOverride = getDataTypeOverride; + testCases.forEach((testCase) => { + it(`should return data type ${testCase.type} for this input data ${testCase.data} everytime`, () => { + const dataType = getDataType(testCase.name, testCase.data, options); + expect(dataType).toEqual(testCase.type); + }); + }); +}); diff --git a/test/__tests__/mssql.test.js b/test/__tests__/mssql.test.js deleted file mode 100644 index 7e883d2c30..0000000000 --- a/test/__tests__/mssql.test.js +++ /dev/null @@ -1,50 +0,0 @@ -const { getDataType } = require("../../src/warehouse/index"); -const { - getDataTypeOverride -} = require("../../src/v0/destinations/mssql/transform"); - -var testCases = [ - { - name: "normalInt", - data: 1, - type: "int" - }, - { - name: "normalFloat", - data: 2.01, - type: "float" - }, - { - name: "normalBoolean", - data: true, - type: "boolean" - }, - { - name: "normalString", - data: "mssql transformation[*007}", - type: "string" - }, - { - name: "violationErrors", - data: [ - { - message: - "no schema for eventName : Product Purchased new, eventType : track in trackingPlanID : tp_20dfXJDpotQWHe7hMxfQfgWMZDv::1", - meta: {}, - type: "Unplanned-Event" - } - ], - type: "string" - } -]; - -describe("MSSQL data types testing", () => { - let options = {}; - options.getDataTypeOverride = getDataTypeOverride; - testCases.forEach(testCase => { - it(`should return data type ${testCase.type} for this input data ${testCase.data} everytime`, () => { - var dataType = getDataType(testCase.name, testCase.data, options); - expect(dataType).toEqual(testCase.type); - }); - }); -}); diff --git a/test/__tests__/postgres.test.js b/test/__tests__/postgres.test.js deleted file mode 100644 index 354fedba09..0000000000 --- a/test/__tests__/postgres.test.js +++ /dev/null @@ -1,50 +0,0 @@ -const { getDataType } = require("../../src/warehouse/index"); -const { - getDataTypeOverride -} = require("../../src/v0/destinations/postgres/transform"); - -var testCases = [ - { - name: "normalInt", - data: 1, - type: "int" - }, - { - name: "normalFloat", - data: 2.01, - type: "float" - }, - { - name: "normalBoolean", - data: true, - type: "boolean" - }, - { - name: "normalString", - data: "postgres transformation[*007}", - type: "string" - }, - { - name: "violationErrors", - data: [ - { - message: - "no schema for eventName : Product Purchased new, eventType : track in trackingPlanID : tp_20dfXJDpotQWHe7hMxfQfgWMZDv::1", - meta: {}, - type: "Unplanned-Event" - } - ], - type: "json" - } -]; - -describe("Postgres data types testing", () => { - let options = {}; - options.getDataTypeOverride = getDataTypeOverride; - testCases.forEach(testCase => { - it(`should return data type ${testCase.type} for this input data ${testCase.data} everytime`, () => { - var dataType = getDataType(testCase.name, testCase.data, options); - expect(dataType).toEqual(testCase.type); - }); - }); -}); From 100c80881eb99716198231deb9ec0e69dc3fa2a0 Mon Sep 17 00:00:00 2001 From: Sankeerth Date: Thu, 28 Sep 2023 10:32:35 +0530 Subject: [PATCH 3/8] feat: add axios mocking to component test-suite (#2638) --- jest.config.typescript.js | 258 +- package-lock.json | 48 + package.json | 3 + src/adapters/network.js | 11 + src/v0/destinations/canny/util.js | 15 +- src/v0/destinations/yahoo_dsp/util.js | 6 +- test/__mocks__/axios.js | 2 - .../data/optimizely_fullstack/response.json | 180 - .../__mocks__/data/pardot/proxy_response.json | 352 - test/__mocks__/optimizely_fullstack.mock.js | 19 - test/__tests__/data/optimizely_fullstack.json | 1641 ----- .../data/optimizely_fullstack_router.json | 494 -- test/__tests__/data/pardot_proxy_input.json | 106 - test/__tests__/data/pardot_proxy_output.json | 378 - .../optimizely_fullstack-cdk.test.ts | 60 - test/__tests__/pardot.test.js | 28 - test/__tests__/proxy.test.ts | 22 +- test/deleteUsers/README.md | 35 - test/deleteUsers/data/af/handler_input.json | 177 - test/deleteUsers/data/af/handler_output.json | 44 - test/deleteUsers/data/af/nw_client_data.json | 58 - test/deleteUsers/data/am/handler_input.json | 380 - test/deleteUsers/data/am/handler_output.json | 26 - test/deleteUsers/data/am/nw_client_data.json | 91 - .../deleteUsers/data/braze/handler_input.json | 393 -- .../data/braze/handler_output.json | 32 - .../data/braze/nw_client_data.json | 97 - .../data/clevertap/handler_input.json | 441 -- .../data/clevertap/handler_output.json | 20 - .../data/clevertap/nw_client_data.json | 177 - .../data/engage/handler_input.json | 133 - .../data/engage/handler_output.json | 39 - .../data/engage/nw_client_data.json | 197 - test/deleteUsers/data/ga/handler_input.json | 83 - test/deleteUsers/data/ga/handler_output.json | 21 - test/deleteUsers/data/ga/nw_client_data.json | 316 - .../data/intercom/handler_input.json | 90 - .../data/intercom/handler_output.json | 32 - .../data/intercom/nw_client_data.json | 96 - test/deleteUsers/data/mp/handler_input.json | 3155 --------- test/deleteUsers/data/mp/handler_output.json | 44 - test/deleteUsers/data/mp/nw_client_data.json | 6159 ----------------- .../data/sendgrid/handler_input.json | 921 --- .../data/sendgrid/handler_output.json | 26 - .../data/sendgrid/nw_client_data.json | 117 - test/deleteUsers/deleteUsers.test.ts | 67 - test/integrations/component.test.ts | 75 +- .../destinations/active_campaign/network.ts | 1966 ++++++ .../destinations/af/deleteUsers/data.ts | 302 + test/integrations/destinations/af/network.ts | 67 + .../destinations/am/deleteUsers/data.ts | 396 ++ test/integrations/destinations/am/network.ts | 209 + .../destinations/braze/deleteUsers/data.ts | 483 ++ .../destinations/braze/network.ts | 191 + test/integrations/destinations/canny/data.ts | 3 + .../destinations/canny/network.ts | 83 + .../clevertap/deleteUsers/data.ts | 495 ++ .../destinations/clevertap/network.ts | 175 + .../destinations/engage/deleteUsers/data.ts | 241 + .../destinations/engage/network.ts | 141 + .../destinations/ga/deleteUsers/data.ts | 139 + test/integrations/destinations/ga/network.ts | 293 + .../destinations/intercom/deleteUsers/data.ts | 180 + .../destinations/intercom/network.ts | 93 + .../marketo_static_list/network.ts | 22 + .../destinations/mautic/network.ts | 3232 +++++++++ .../destinations/mp/deleteUsers/data.ts | 3281 +++++++++ test/integrations/destinations/mp/network.ts | 1150 +++ .../optimizely_fullstack/network.ts | 206 + .../optimizely_fullstack/processor/data.ts | 2170 ++++++ .../optimizely_fullstack/router/data.ts | 563 ++ .../destinations/pardot/network.ts | 440 ++ .../destinations/pardot/router/data.ts | 553 ++ .../destinations/sendgrid/deleteUsers/data.ts | 1275 ++++ .../destinations/sendgrid/network.ts | 110 + .../destinations/trengo/network.ts | 1326 ++++ .../integrations/destinations/user/network.ts | 441 ++ .../destinations/yahoo_dsp/network.ts | 22 + .../destinations/yahoo_dsp/processor/data.ts | 12 +- .../destinations/yahoo_dsp/router/data.ts | 3 + .../destinations/zendesk/network.ts | 1825 +++++ test/integrations/testTypes.ts | 9 + test/integrations/testUtils.ts | 53 +- test/testHelper.js | 13 + 84 files changed, 22453 insertions(+), 16875 deletions(-) delete mode 100644 test/__mocks__/data/optimizely_fullstack/response.json delete mode 100644 test/__mocks__/data/pardot/proxy_response.json delete mode 100644 test/__mocks__/optimizely_fullstack.mock.js delete mode 100644 test/__tests__/data/optimizely_fullstack.json delete mode 100644 test/__tests__/data/optimizely_fullstack_router.json delete mode 100644 test/__tests__/data/pardot_proxy_input.json delete mode 100644 test/__tests__/data/pardot_proxy_output.json delete mode 100644 test/__tests__/optimizely_fullstack-cdk.test.ts delete mode 100644 test/__tests__/pardot.test.js delete mode 100644 test/deleteUsers/README.md delete mode 100644 test/deleteUsers/data/af/handler_input.json delete mode 100644 test/deleteUsers/data/af/handler_output.json delete mode 100644 test/deleteUsers/data/af/nw_client_data.json delete mode 100644 test/deleteUsers/data/am/handler_input.json delete mode 100644 test/deleteUsers/data/am/handler_output.json delete mode 100644 test/deleteUsers/data/am/nw_client_data.json delete mode 100644 test/deleteUsers/data/braze/handler_input.json delete mode 100644 test/deleteUsers/data/braze/handler_output.json delete mode 100644 test/deleteUsers/data/braze/nw_client_data.json delete mode 100644 test/deleteUsers/data/clevertap/handler_input.json delete mode 100644 test/deleteUsers/data/clevertap/handler_output.json delete mode 100644 test/deleteUsers/data/clevertap/nw_client_data.json delete mode 100644 test/deleteUsers/data/engage/handler_input.json delete mode 100644 test/deleteUsers/data/engage/handler_output.json delete mode 100644 test/deleteUsers/data/engage/nw_client_data.json delete mode 100644 test/deleteUsers/data/ga/handler_input.json delete mode 100644 test/deleteUsers/data/ga/handler_output.json delete mode 100644 test/deleteUsers/data/ga/nw_client_data.json delete mode 100644 test/deleteUsers/data/intercom/handler_input.json delete mode 100644 test/deleteUsers/data/intercom/handler_output.json delete mode 100644 test/deleteUsers/data/intercom/nw_client_data.json delete mode 100644 test/deleteUsers/data/mp/handler_input.json delete mode 100644 test/deleteUsers/data/mp/handler_output.json delete mode 100644 test/deleteUsers/data/mp/nw_client_data.json delete mode 100644 test/deleteUsers/data/sendgrid/handler_input.json delete mode 100644 test/deleteUsers/data/sendgrid/handler_output.json delete mode 100644 test/deleteUsers/data/sendgrid/nw_client_data.json delete mode 100644 test/deleteUsers/deleteUsers.test.ts create mode 100644 test/integrations/destinations/active_campaign/network.ts create mode 100644 test/integrations/destinations/af/deleteUsers/data.ts create mode 100644 test/integrations/destinations/af/network.ts create mode 100644 test/integrations/destinations/am/deleteUsers/data.ts create mode 100644 test/integrations/destinations/am/network.ts create mode 100644 test/integrations/destinations/braze/deleteUsers/data.ts create mode 100644 test/integrations/destinations/braze/network.ts create mode 100644 test/integrations/destinations/canny/network.ts create mode 100644 test/integrations/destinations/clevertap/deleteUsers/data.ts create mode 100644 test/integrations/destinations/clevertap/network.ts create mode 100644 test/integrations/destinations/engage/deleteUsers/data.ts create mode 100644 test/integrations/destinations/engage/network.ts create mode 100644 test/integrations/destinations/ga/deleteUsers/data.ts create mode 100644 test/integrations/destinations/ga/network.ts create mode 100644 test/integrations/destinations/intercom/deleteUsers/data.ts create mode 100644 test/integrations/destinations/intercom/network.ts create mode 100644 test/integrations/destinations/marketo_static_list/network.ts create mode 100644 test/integrations/destinations/mautic/network.ts create mode 100644 test/integrations/destinations/mp/deleteUsers/data.ts create mode 100644 test/integrations/destinations/mp/network.ts create mode 100644 test/integrations/destinations/optimizely_fullstack/network.ts create mode 100644 test/integrations/destinations/optimizely_fullstack/processor/data.ts create mode 100644 test/integrations/destinations/optimizely_fullstack/router/data.ts create mode 100644 test/integrations/destinations/pardot/network.ts create mode 100644 test/integrations/destinations/sendgrid/deleteUsers/data.ts create mode 100644 test/integrations/destinations/sendgrid/network.ts create mode 100644 test/integrations/destinations/trengo/network.ts create mode 100644 test/integrations/destinations/user/network.ts create mode 100644 test/integrations/destinations/yahoo_dsp/network.ts create mode 100644 test/integrations/destinations/zendesk/network.ts diff --git a/jest.config.typescript.js b/jest.config.typescript.js index 66f4236e7e..fde50e3d5e 100644 --- a/jest.config.typescript.js +++ b/jest.config.typescript.js @@ -2,186 +2,186 @@ // https://jestjs.io/docs/en/configuration.html module.exports = { - // All imported modules in your tests should be mocked automatically - // automock: false, + // All imported modules in your tests should be mocked automatically + // automock: false, - // Stop running tests after `n` failures - bail: 1, + // Stop running tests after `n` failures + bail: 1, - // Respect "browser" field in package.json when resolving modules - // browser: false, + // Respect "browser" field in package.json when resolving modules + // browser: false, - // The directory where Jest should store its cached dependency information - // cacheDirectory: "/private/var/folders/bj/xt4sffgd21z57fxhvqrd30_80000gn/T/jest_dx", + // The directory where Jest should store its cached dependency information + // cacheDirectory: "/private/var/folders/bj/xt4sffgd21z57fxhvqrd30_80000gn/T/jest_dx", - // Automatically clear mock calls and instances between every test - // clearMocks: false, + // Automatically clear mock calls and instances between every test + // clearMocks: false, - // Indicates whether the coverage information should be collected while executing the test - collectCoverage: false, + // Indicates whether the coverage information should be collected while executing the test + collectCoverage: false, - // An array of glob patterns indicating a set of files for which coverage information should be collected - // collectCoverageFrom: null, + // An array of glob patterns indicating a set of files for which coverage information should be collected + // collectCoverageFrom: null, - // The directory where Jest should output its coverage files - coverageDirectory: 'reports/ts-coverage', + // The directory where Jest should output its coverage files + coverageDirectory: 'reports/ts-coverage', - // An array of regexp pattern strings used to skip coverage collection - coveragePathIgnorePatterns: ['/node_modules/', '__tests__'], + // An array of regexp pattern strings used to skip coverage collection + coveragePathIgnorePatterns: ['/node_modules/', '__tests__'], - // A list of reporter names that Jest uses when writing coverage reports - coverageReporters: ['json', 'text', 'lcov', 'clover'], + // A list of reporter names that Jest uses when writing coverage reports + coverageReporters: ['json', 'text', 'lcov', 'clover'], - // An object that configures minimum threshold enforcement for coverage results - coverageThreshold: { - global: { - branches: 30, - functions: 40, - lines: 50, - statements: 50, - }, + // An object that configures minimum threshold enforcement for coverage results + coverageThreshold: { + global: { + branches: 30, + functions: 40, + lines: 50, + statements: 50, }, + }, - // A path to a custom dependency extractor - // dependencyExtractor: null, + // A path to a custom dependency extractor + // dependencyExtractor: null, - // Make calling deprecated APIs throw helpful error messages - errorOnDeprecated: true, + // Make calling deprecated APIs throw helpful error messages + errorOnDeprecated: true, - // Force coverage collection from ignored files using an array of glob patterns - // forceCoverageMatch: [], + // Force coverage collection from ignored files using an array of glob patterns + // forceCoverageMatch: [], - // A path to a module which exports an async function that is triggered once before all test suites - // globalSetup: null, + // A path to a module which exports an async function that is triggered once before all test suites + // globalSetup: null, - // A path to a module which exports an async function that is triggered once after all test suites - // globalTeardown: null, + // A path to a module which exports an async function that is triggered once after all test suites + // globalTeardown: null, - // A set of global variables that need to be available in all test environments - // globals: { - // 'ts-jest': { - // tsConfigFile: 'tsconfig.json', - // diagnostics: true - // }, - // }, + // A set of global variables that need to be available in all test environments + // globals: { + // 'ts-jest': { + // tsConfigFile: 'tsconfig.json', + // diagnostics: true + // }, + // }, - // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. - // maxWorkers: "50%", + // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. + // maxWorkers: "50%", - // An array of directory names to be searched recursively up from the requiring module's location - moduleDirectories: ['node_modules'], + // An array of directory names to be searched recursively up from the requiring module's location + moduleDirectories: ['node_modules'], - // An array of file extensions your modules use - moduleFileExtensions: ['js', 'json', 'ts', 'node'], + // An array of file extensions your modules use + moduleFileExtensions: ['js', 'json', 'ts', 'node'], - // A map from regular expressions to module names that allow to stub out resources with a single module - // moduleNameMapper: {}, + // A map from regular expressions to module names that allow to stub out resources with a single module + // moduleNameMapper: {}, - // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader - // modulePathIgnorePatterns: [], + // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader + modulePathIgnorePatterns: ['/test/__mocks__/axios.js'], - // Activates notifications for test results - notify: true, + // Activates notifications for test results + notify: true, - // An enum that specifies notification mode. Requires { notify: true } - notifyMode: 'failure-change', + // An enum that specifies notification mode. Requires { notify: true } + notifyMode: 'failure-change', - // A preset that is used as a base for Jest's configuration - preset: 'ts-jest', + // A preset that is used as a base for Jest's configuration + preset: 'ts-jest', - // Run tests from one or more projects - // projects: null, + // Run tests from one or more projects + // projects: null, - // Use this configuration option to add custom reporters to Jest - // reporters: undefined, + // Use this configuration option to add custom reporters to Jest + // reporters: undefined, - // Automatically reset mock state between every test - // resetMocks: false, + // Automatically reset mock state between every test + // resetMocks: false, - // Reset the module registry before running each individual test - // resetModules: false, + // Reset the module registry before running each individual test + // resetModules: false, - // A path to a custom resolver - // resolver: null, + // A path to a custom resolver + // resolver: null, - // Automatically restore mock state between every test - // restoreMocks: false, + // Automatically restore mock state between every test + // restoreMocks: false, - // The root directory that Jest should scan for tests and modules within - // rootDir: null, + // The root directory that Jest should scan for tests and modules within + // rootDir: null, - // A list of paths to directories that Jest should use to search for files in - // roots: [ - // "" - // ], + // A list of paths to directories that Jest should use to search for files in + // roots: [ + // "" + // ], - // Allows you to use a custom runner instead of Jest's default test runner - // runner: "jest-runner", + // Allows you to use a custom runner instead of Jest's default test runner + // runner: "jest-runner", - // The paths to modules that run some code to configure or set up the testing environment before each test - // setupFiles: [], + // The paths to modules that run some code to configure or set up the testing environment before each test + // setupFiles: [], - // A list of paths to modules that run some code to configure or set up the testing framework before each test - // setupFilesAfterEnv: [], + // A list of paths to modules that run some code to configure or set up the testing framework before each test + // setupFilesAfterEnv: [], - // A list of paths to snapshot serializer modules Jest should use for snapshot testing - // snapshotSerializers: [], + // A list of paths to snapshot serializer modules Jest should use for snapshot testing + // snapshotSerializers: [], - // The test environment that will be used for testing - testEnvironment: 'node', + // The test environment that will be used for testing + testEnvironment: 'node', - // Options that will be passed to the testEnvironment - // testEnvironmentOptions: {}, + // Options that will be passed to the testEnvironment + // testEnvironmentOptions: {}, - // Adds a location field to test results - // testLocationInResults: false, + // Adds a location field to test results + // testLocationInResults: false, - // The glob patterns Jest uses to detect test files - testMatch: ['**/*.(test).ts?(x)'], + // The glob patterns Jest uses to detect test files + testMatch: ['**/*.(test).ts?(x)'], - // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped - testPathIgnorePatterns: ['/node_modules/'], + // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped + testPathIgnorePatterns: ['/node_modules/'], - // The regexp pattern or array of patterns that Jest uses to detect test files - // testRegex: [], + // The regexp pattern or array of patterns that Jest uses to detect test files + // testRegex: [], - // This option allows the use of a custom results processor - // testResultsProcessor: null, + // This option allows the use of a custom results processor + // testResultsProcessor: null, - // This option allows use of a custom test runner - // testRunner: "jasmine2", + // This option allows use of a custom test runner + // testRunner: "jasmine2", - // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href - // testURL: "http://localhost", + // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href + // testURL: "http://localhost", - // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout" - // timers: "real", + // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout" + // timers: "real", - // A map from regular expressions to paths to transformers - transform: { - '^.+\\.tsx?$': [ - 'ts-jest', - { - tsconfig: 'tsconfig.json', - diagnostics: true, - }, - ], - }, + // A map from regular expressions to paths to transformers + transform: { + '^.+\\.tsx?$': [ + 'ts-jest', + { + tsconfig: 'tsconfig.json', + diagnostics: true, + }, + ], + }, - // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation - // transformIgnorePatterns: [ - // "/node_modules/" - // ], + // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation + // transformIgnorePatterns: [ + // "/node_modules/" + // ], - // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them - // unmockedModulePathPatterns: undefined, + // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them + // unmockedModulePathPatterns: undefined, - // Indicates whether each individual test should be reported during the run - // verbose: null, + // Indicates whether each individual test should be reported during the run + // verbose: null, - // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode - // watchPathIgnorePatterns: [], + // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode + // watchPathIgnorePatterns: [], - // Whether to use watchman for file crawling - // watchman: true, + // Whether to use watchman for file crawling + // watchman: true, }; diff --git a/package-lock.json b/package-lock.json index d1334cb0f6..0ebcb14c71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -73,6 +73,7 @@ "devDependencies": { "@commitlint/config-conventional": "^17.6.3", "@digitalroute/cz-conventional-changelog-for-jira": "^8.0.1", + "@types/fast-json-stable-stringify": "^2.1.0", "@types/jest": "^29.5.1", "@types/koa": "^2.13.6", "@types/koa-bodyparser": "^4.3.10", @@ -80,6 +81,7 @@ "@types/node": "^20.2.5", "@typescript-eslint/eslint-plugin": "^5.61.0", "@typescript-eslint/parser": "^5.59.2", + "axios-mock-adapter": "^1.22.0", "benchmark-suite": "^0.1.8", "commander": "^10.0.1", "commitizen": "^4.3.0", @@ -7335,6 +7337,16 @@ "@types/send": "*" } }, + "node_modules/@types/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-IyNhGHu71jH1jCXTHmafuoAAdsbBON3kDh7u/UUhLmjYgN5TYB54e1R8ckTCiIevl2UuZaCsi9XRxineY5yUjw==", + "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, + "dependencies": { + "fast-json-stable-stringify": "*" + } + }, "node_modules/@types/graceful-fs": { "version": "4.1.6", "dev": true, @@ -8213,6 +8225,42 @@ "proxy-from-env": "^1.1.0" } }, + "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, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "is-buffer": "^2.0.5" + }, + "peerDependencies": { + "axios": ">= 0.17.0" + } + }, + "node_modules/axios-mock-adapter/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", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "engines": { + "node": ">=4" + } + }, "node_modules/babel-jest": { "version": "29.6.0", "dev": true, diff --git a/package.json b/package.json index 37db654c9b..ed08c7a7cd 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "test:js: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:component:generateNwMocks": "npm run test:ts -- component --generate=true", "test:ts:silent": "npm run test:ts -- --silent", "test:ts:ci": "npm run test:ts -- --coverage --expand --maxWorkers=50%", "test:ut:integration": "jest \"user_transformation.integration.test.js\" --detectOpenHandles --notify", @@ -113,6 +114,7 @@ "devDependencies": { "@commitlint/config-conventional": "^17.6.3", "@digitalroute/cz-conventional-changelog-for-jira": "^8.0.1", + "@types/fast-json-stable-stringify": "^2.1.0", "@types/jest": "^29.5.1", "@types/koa": "^2.13.6", "@types/koa-bodyparser": "^4.3.10", @@ -120,6 +122,7 @@ "@types/node": "^20.2.5", "@typescript-eslint/eslint-plugin": "^5.61.0", "@typescript-eslint/parser": "^5.59.2", + "axios-mock-adapter": "^1.22.0", "benchmark-suite": "^0.1.8", "commander": "^10.0.1", "commitizen": "^4.3.0", diff --git a/src/adapters/network.js b/src/adapters/network.js index 78552048f0..5ee62029a3 100644 --- a/src/adapters/network.js +++ b/src/adapters/network.js @@ -9,6 +9,8 @@ const log = require('../logger'); const stats = require('../util/stats'); const { removeUndefinedValues } = require('../v0/util'); const { processAxiosResponse } = require('./utils/networkUtils'); +// Only for tests +const { setResponsesForMockAxiosAdapter } = require('../../test/testHelper'); const MAX_CONTENT_LENGTH = parseInt(process.env.MAX_CONTENT_LENGTH, 10) || 100000000; const MAX_BODY_LENGTH = parseInt(process.env.MAX_BODY_LENGTH, 10) || 100000000; @@ -84,6 +86,7 @@ const httpSend = async (options, statTags = {}) => { const requestOptions = enhanceRequestOptions(options); const startTime = new Date(); + const { url, data, method } = requestOptions; try { const response = await axios(requestOptions); clientResponse = { success: true, response }; @@ -92,6 +95,8 @@ const httpSend = async (options, statTags = {}) => { } finally { fireHTTPStats(clientResponse, startTime, statTags); } + + setResponsesForMockAxiosAdapter({ url, data, method, options }, clientResponse); return clientResponse; }; @@ -117,6 +122,7 @@ const httpGET = async (url, options, statTags = {}) => { } finally { fireHTTPStats(clientResponse, startTime, statTags); } + setResponsesForMockAxiosAdapter({ url, options, method: 'GET' }, clientResponse); return clientResponse; }; @@ -142,6 +148,7 @@ const httpDELETE = async (url, options, statTags = {}) => { } finally { fireHTTPStats(clientResponse, startTime, statTags); } + setResponsesForMockAxiosAdapter({ url, options, method: 'DELETE' }, clientResponse); return clientResponse; }; @@ -168,6 +175,7 @@ const httpPOST = async (url, data, options, statTags = {}) => { } finally { fireHTTPStats(clientResponse, startTime, statTags); } + setResponsesForMockAxiosAdapter({ url, data, options, method: 'POST' }, clientResponse); return clientResponse; }; @@ -194,6 +202,7 @@ const httpPUT = async (url, data, options, statTags = {}) => { } finally { fireHTTPStats(clientResponse, startTime, statTags); } + setResponsesForMockAxiosAdapter({ url, data, options, method: 'PUT' }, clientResponse); return clientResponse; }; @@ -220,6 +229,7 @@ const httpPATCH = async (url, data, options, statTags = {}) => { } finally { fireHTTPStats(clientResponse, startTime, statTags); } + setResponsesForMockAxiosAdapter({ url, data, options, method: 'PATCH' }, clientResponse); return clientResponse; }; @@ -388,4 +398,5 @@ module.exports = { getPayloadData, getFormData, handleHttpRequest, + enhanceRequestOptions, }; diff --git a/src/v0/destinations/canny/util.js b/src/v0/destinations/canny/util.js index 9666f143df..002d9aa69f 100644 --- a/src/v0/destinations/canny/util.js +++ b/src/v0/destinations/canny/util.js @@ -25,7 +25,7 @@ const retrieveUserId = async (apiKey, message) => { message.traits?.email || message.context?.traits?.email || message.properties?.email; const { userId } = message; - const header = { + const headers = { 'Content-Type': 'application/x-www-form-urlencoded', Accept: JSON_MIME_TYPE, }; @@ -38,10 +38,15 @@ const retrieveUserId = async (apiKey, message) => { } else { requestBody.userID = `${userId}`; } - const response = await httpPOST(url, qs.stringify(requestBody), header, { - destType: 'canny', - feature: 'transformation', - }); + const response = await httpPOST( + url, + qs.stringify(requestBody), + { headers }, + { + destType: 'canny', + feature: 'transformation', + }, + ); logger.debug(response); // If the request fails, throwing error. if (response.success === false) { diff --git a/src/v0/destinations/yahoo_dsp/util.js b/src/v0/destinations/yahoo_dsp/util.js index f47717df51..a069660bde 100644 --- a/src/v0/destinations/yahoo_dsp/util.js +++ b/src/v0/destinations/yahoo_dsp/util.js @@ -1,7 +1,7 @@ const qs = require('qs'); const sha256 = require('sha256'); const { generateJWTToken } = require('../../../util/jwtTokenGenerator'); -const { httpPOST } = require('../../../adapters/network'); +const { httpSend } = require('../../../adapters/network'); const { isDefinedAndNotNullAndNotEmpty } = require('../../util'); const { getDynamicErrorType } = require('../../../adapters/utils/networkUtils'); const { ACCESS_TOKEN_CACHE_TTL, AUDIENCE_ATTRIBUTE, DSP_SUPPORTED_OPERATION } = require('./config'); @@ -119,7 +119,7 @@ const getAccessToken = async (destination) => { }; const request = { - header: { + headers: { 'Content-Type': 'application/x-www-form-urlencoded', Accept: JSON_MIME_TYPE, }, @@ -134,7 +134,7 @@ const getAccessToken = async (destination) => { }), method: 'POST', }; - const dspAuthorisationData = await httpPOST(request.url, request.data, request.header, { + const dspAuthorisationData = await httpSend(request, { destType: 'yahoo_dsp', feature: 'transformation', }); diff --git a/test/__mocks__/axios.js b/test/__mocks__/axios.js index dc3005d909..6a3139c4e9 100644 --- a/test/__mocks__/axios.js +++ b/test/__mocks__/axios.js @@ -40,7 +40,6 @@ const { sendgridGetRequestHandler } = require("./sendgrid.mock"); const { sendinblueGetRequestHandler } = require("./sendinblue.mock"); const { courierGetRequestHandler } = require("./courier.mock"); const { brazePostRequestHandler } = require("./braze.mock"); -const {optimizelyFullStackGetRequestHandler} = require("./optimizely_fullstack.mock"); const urlDirectoryMap = { "api.hubapi.com": "hs", @@ -55,7 +54,6 @@ const urlDirectoryMap = { "api.sendinblue.com": "sendinblue", "api.criteo.com": "criteo_audience", "api.courier.com": "courier", - "cdn.optimizely.com": "optimizely_fullstack", }; const fs = require("fs"); diff --git a/test/__mocks__/data/optimizely_fullstack/response.json b/test/__mocks__/data/optimizely_fullstack/response.json deleted file mode 100644 index e83dd8197f..0000000000 --- a/test/__mocks__/data/optimizely_fullstack/response.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "https://cdn.optimizely.com/datafiles/abc.json": { - "accountId": "test_account_id", - "projectId": "test_project_id", - "revision": "45", - "attributes": [ - { - "id": "test_attribute_id_1", - "key": "gender" - }, - { - "id": "test_attribute_id_2", - "key": "name" - }, - { - "id": "test_attribute_id_3", - "key": "userId" - }, - { - "id": "test_attribute_id_4", - "key": "anonymousId" - }, - { - "id": "test_attribute_id_5", - "key": "company" - } - ], - "audiences": [ - { - "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\"}]" - } - ], - "version": "4", - "events": [ - { - "id": "test_event_id_1", - "experimentIds": ["test_experiment_id"], - "key": "Product Added" - }, - { - "id": "test_event_id_2", - "experimentIds": ["test_experiment_id"], - "key": "Product Removed" - }, - { - "id": "test_event_id_3", - "experimentIds": ["test_experiment_id"], - "key": "Order Placed" - }, - { - "id": "test_event_id_4", - "experimentIds": ["test_experiment_id"], - "key": "Viewed Meal page" - }, - { - "id": "test_event_id_5", - "experimentIds": ["test_experiment_id"], - "key": "Viewed food page" - }, - { - "id": "test_event_id_6", - "experimentIds": ["test_experiment_id"], - "key": "Viewed Main screen" - }, - { - "id": "test_event_id_7", - "experimentIds": ["test_experiment_id"], - "key": "Home" - }, - { - "id": "test_event_id_8", - "experimentIds": ["test_experiment_id"], - "key": "Index" - } - ], - "anonymizeIP": true, - "botFiltering": false, - "typedAudiences": [], - "variables": [], - "environmentKey": "production", - "sdkKey": "test_sdk_key", - "featureFlags": [ - { - "id": "test_feature_flag_id", - "key": "testfeature", - "experimentIds": ["test_experiment_id"], - "rolloutId": "test_rollout_id", - "variables": [ - { - "id": "test_variable_id", - "key": "sort_method", - "type": "string", - "defaultValue": "alphabetical" - } - ] - } - ], - "rollouts": [ - { - "id": "test_rollout_id", - "experiments": [ - { - "forcedVariations": {}, - "id": "test_experiment_id", - "key": "test_experiment_key", - "status": "Running", - "trafficAllocation": [ - { - "entityId": "test_variation_id", - "endOfRange": 10000 - } - ], - "variations": [ - { - "id": "test_variation_id", - "key": "test_variation_key", - "variables": [ - { - "id": "test_variable_id", - "value": "alphabetical" - } - ], - "featureEnabled": true - } - ], - "layerId": "test_layer_id", - "audienceIds": [] - } - ] - } - ], - "experiments": [ - { - "forcedVariations": {}, - "id": "test_experiment_id", - "key": "test_experiment_key", - "status": "Running", - "trafficAllocation": [ - { - "entityId": "test_variation_id_1", - "endOfRange": 5000 - }, - { - "entityId": "test_variation_id_2", - "endOfRange": 10000 - } - ], - "variations": [ - { - "id": "test_variation_id_1", - "key": "variation_1", - "variables": [ - { - "id": "test_variable_id", - "value": "popular_first" - } - ], - "featureEnabled": true - }, - { - "id": "test_variation_id_2", - "key": "variation_2", - "variables": [ - { - "id": "test_variable_id", - "value": "popular_first" - } - ], - "featureEnabled": true - } - ], - "layerId": "test_layer_id", - "audienceIds": [] - } - ], - "groups": [] - } -} diff --git a/test/__mocks__/data/pardot/proxy_response.json b/test/__mocks__/data/pardot/proxy_response.json deleted file mode 100644 index 53cf0d1255..0000000000 --- a/test/__mocks__/data/pardot/proxy_response.json +++ /dev/null @@ -1,352 +0,0 @@ -{ - "https://pi.pardot.com/api/prospect/version/4/do/upsert/id/123435": { - "data": { - "@attributes": { - "stat": "ok", - "version": 1 - }, - "prospect": { - "id": 123435, - "campaign_id": 42213, - "salutation": null, - "first_name": "Roger12", - "last_name": "Federer12", - "email": "Roger12@waltair.io", - "password": null, - "company": null, - "website": "https://rudderstack.com", - "job_title": null, - "department": null, - "country": "AU", - "address_one": null, - "address_two": null, - "city": null, - "state": null, - "territory": null, - "zip": null, - "phone": null, - "fax": null, - "source": null, - "annual_revenue": null, - "employees": null, - "industry": null, - "years_in_business": null, - "comments": null, - "notes": null, - "score": 14, - "grade": null, - "last_activity_at": null, - "recent_interaction": "Never active.", - "crm_lead_fid": null, - "crm_contact_fid": null, - "crm_owner_fid": "00G2v000004WYXaEAO", - "crm_account_fid": null, - "salesforce_fid": null, - "crm_last_sync": null, - "crm_url": null, - "is_do_not_email": null, - "is_do_not_call": null, - "opted_out": null, - "is_reviewed": 1, - "is_starred": null, - "created_at": "2022-01-21 18:21:46", - "updated_at": "2022-01-21 18:48:41", - "campaign": { - "id": 42113, - "name": "Test", - "crm_fid": "7012y000000MNOCLL4" - }, - "assigned_to": { - "user": { - "id": 38443703, - "email": "test_rudderstack@testcompany.com", - "first_name": "Rudderstack", - "last_name": "User", - "job_title": null, - "role": "Administrator", - "account": 489853, - "created_at": "2021-02-26 06:25:17", - "updated_at": "2021-02-26 06:25:17" - } - }, - "Are_you_shipping_large_fragile_or_bulky_items": false, - "Calendly": false, - "Country_Code": "AU", - "Currency": "AUD", - "Inventory_or_Warehouse_Management_System": false, - "Lead_Status": "New", - "Marketing_Stage": "SAL", - "Record_Type_ID": "TestCompany Lead", - "profile": { - "id": 304, - "name": "Default", - "profile_criteria": [ - { - "id": 1500, - "name": "Shipping Volume", - "matches": "Unknown" - }, - { - "id": 1502, - "name": "Industry", - "matches": "Unknown" - }, - { - "id": 1506, - "name": "Job Title", - "matches": "Unknown" - }, - { - "id": 1508, - "name": "Department", - "matches": "Unknown" - } - ] - }, - "visitors": null, - "visitor_activities": null, - "lists": null - } - }, - "status": 200, - "statusText": "OK" - }, - "https://pi.pardot.com/api/prospect/version/4/do/upsert/email/Roger_12@waltair.io": { - "data": { - "@attributes": { - "stat": "ok", - "version": 1 - }, - "prospect": { - "id": 123435, - "campaign_id": 42213, - "salutation": null, - "first_name": "Roger_12", - "last_name": "Federer_12", - "email": "Roger_12@waltair.io", - "password": null, - "company": null, - "website": "https://rudderstack.com", - "job_title": null, - "department": null, - "country": "AU", - "address_one": null, - "address_two": null, - "city": null, - "state": null, - "territory": null, - "zip": null, - "phone": null, - "fax": null, - "source": null, - "annual_revenue": null, - "employees": null, - "industry": null, - "years_in_business": null, - "comments": null, - "notes": null, - "score": 14, - "grade": null, - "last_activity_at": null, - "recent_interaction": "Never active.", - "crm_lead_fid": null, - "crm_contact_fid": null, - "crm_owner_fid": "00G2v000004WYXaEAO", - "crm_account_fid": null, - "salesforce_fid": null, - "crm_last_sync": null, - "crm_url": null, - "is_do_not_email": null, - "is_do_not_call": null, - "opted_out": null, - "is_reviewed": 1, - "is_starred": null, - "created_at": "2022-01-21 18:21:46", - "updated_at": "2022-01-21 18:48:41", - "campaign": { - "id": 42113, - "name": "Test", - "crm_fid": "7012y000000MNOCLL4" - }, - "assigned_to": { - "user": { - "id": 38443703, - "email": "test_rudderstack@testcompany.com", - "first_name": "Rudderstack", - "last_name": "User", - "job_title": null, - "role": "Administrator", - "account": 489853, - "created_at": "2021-02-26 06:25:17", - "updated_at": "2021-02-26 06:25:17" - } - }, - "Are_you_shipping_large_fragile_or_bulky_items": false, - "Calendly": false, - "Country_Code": "AU", - "Currency": "AUD", - "Inventory_or_Warehouse_Management_System": false, - "Lead_Status": "New", - "Marketing_Stage": "SAL", - "Record_Type_ID": "TestCompany Lead", - "profile": { - "id": 304, - "name": "Default", - "profile_criteria": [ - { - "id": 1500, - "name": "Shipping Volume", - "matches": "Unknown" - }, - { - "id": 1502, - "name": "Industry", - "matches": "Unknown" - }, - { - "id": 1506, - "name": "Job Title", - "matches": "Unknown" - }, - { - "id": 1508, - "name": "Department", - "matches": "Unknown" - } - ] - }, - "visitors": null, - "visitor_activities": null, - "lists": null - } - }, - "status": 201, - "statusText": "Created" - }, - "https://pi.pardot.com/api/prospect/version/4/do/upsert/fid/00Q6r000002LKhTPVR": { - "data": { - "@attributes": { - "stat": "ok", - "version": 1 - }, - "prospect": { - "id": 123435, - "campaign_id": 42213, - "salutation": null, - "first_name": "Roger_12", - "last_name": "Federer_12", - "email": "Roger_12@federer.io", - "password": null, - "company": null, - "website": "https://rudderstack.com", - "job_title": null, - "department": null, - "country": "AU", - "address_one": null, - "address_two": null, - "city": null, - "state": null, - "territory": null, - "zip": null, - "phone": null, - "fax": null, - "source": null, - "annual_revenue": null, - "employees": null, - "industry": null, - "years_in_business": null, - "comments": null, - "notes": null, - "score": 14, - "grade": null, - "last_activity_at": null, - "recent_interaction": "Never active.", - "crm_lead_fid": "00Q6r000002LKhTPVR", - "crm_contact_fid": null, - "crm_owner_fid": "00G2v000004WYXaEAO", - "crm_account_fid": null, - "salesforce_fid": "00Q6r000002LKhTPVR", - "crm_last_sync": "2022-01-21 18:47:37", - "crm_url": "https://testcompany.my.salesforce.com/00Q6r000002LKhTPVR", - "is_do_not_email": null, - "is_do_not_call": null, - "opted_out": null, - "is_reviewed": 1, - "is_starred": null, - "created_at": "2022-01-21 18:21:46", - "updated_at": "2022-01-21 18:48:41", - "campaign": { - "id": 42113, - "name": "Test", - "crm_fid": "7012y000000MNOCLL4" - }, - "assigned_to": { - "user": { - "id": 38443703, - "email": "test_rudderstack@testcompany.com", - "first_name": "Rudderstack", - "last_name": "User", - "job_title": null, - "role": "Administrator", - "account": 489853, - "created_at": "2021-02-26 06:25:17", - "updated_at": "2021-02-26 06:25:17" - } - }, - "Are_you_shipping_large_fragile_or_bulky_items": false, - "Calendly": false, - "Country_Code": "AU", - "Currency": "AUD", - "Inventory_or_Warehouse_Management_System": false, - "Lead_Status": "New", - "Marketing_Stage": "SAL", - "Record_Type_ID": "TestCompany Lead", - "profile": { - "id": 304, - "name": "Default", - "profile_criteria": [ - { - "id": 1500, - "name": "Shipping Volume", - "matches": "Unknown" - }, - { - "id": 1502, - "name": "Industry", - "matches": "Unknown" - }, - { - "id": 1506, - "name": "Job Title", - "matches": "Unknown" - }, - { - "id": 1508, - "name": "Department", - "matches": "Unknown" - } - ] - }, - "visitors": null, - "visitor_activities": null, - "lists": null - } - }, - "status": 200, - "statusText": "OK" - }, - "https://pi.pardot.com/api/prospect/version/4/do/upsert/email/rolex_waltair@mywebsite.io": { - "response": { - "data": { - "@attributes": { - "stat": "fail", - "version": 1, - "err_code": 184 - }, - "err": "access_token is invalid, unknown, or malformed: Inactive token" - } - }, - "status": 401, - "statusText": "Unauthorized" - } -} diff --git a/test/__mocks__/optimizely_fullstack.mock.js b/test/__mocks__/optimizely_fullstack.mock.js deleted file mode 100644 index f2eb3deb8c..0000000000 --- a/test/__mocks__/optimizely_fullstack.mock.js +++ /dev/null @@ -1,19 +0,0 @@ -const optimizelyFullStackGetRequestHandler = (url, mockData) => { - if (url === 'https://cdn.optimizely.com/datafiles/abc.json') { - return { data: mockData, status: 200 }; - } - - return Promise.reject({ - response: { - data: { - code: 'document_not_found', - message: 'document_not_found', - }, - status: 404, - }, - }); -}; - -module.exports = { - optimizelyFullStackGetRequestHandler, -}; diff --git a/test/__tests__/data/optimizely_fullstack.json b/test/__tests__/data/optimizely_fullstack.json deleted file mode 100644 index 1331d38033..0000000000 --- a/test/__tests__/data/optimizely_fullstack.json +++ /dev/null @@ -1,1641 +0,0 @@ -[ - { - "description": "Missing Data File URL", - "input": { - "message": { - "type": "identify", - "channel": "web", - "properties": {}, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id" - } - } - }, - "output": { - "error": "Data File Url is not present. Aborting" - } - }, - { - "description": "Identify call: Missing Variation ID in integration object", - "input": { - "message": { - "type": "identify", - "channel": "web", - "properties": {}, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campagin_id", - "experimentId": "test_experiment_id" - } - } - }, - "output": { - "error": "Variation ID is not present in the integrations object" - } - }, - { - "description": "Missing Account ID", - "input": { - "message": { - "type": "identify", - "channel": "web", - "properties": {}, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "campaignId": "test_campagin_id", - "experimentId": "test_experiment_id" - } - } - }, - "output": { - "error": "Account ID is not present. Aborting" - } - }, - { - "description": "Missing Campaign ID", - "input": { - "message": { - "type": "identify", - "channel": "web", - "properties": {}, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "experimentId": "test_experiment_id" - } - } - }, - "output": { - "error": "Campaign ID is not present. Aborting" - } - }, - { - "description": "Missing Experiment ID", - "input": { - "message": { - "type": "identify", - "channel": "web", - "properties": {}, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campagin_id" - } - } - }, - "output": { - "error": "Experiment ID is not present. Aborting" - } - }, - { - "description": "Page: Track Categorized Page and Track Named Pages toggle are disabled", - "input": { - "message": { - "type": "page", - "channel": "web", - "name": "Home", - "properties": {}, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "123" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campagin_id", - "experimentId": "test_experiment_id", - "trackCategorizedPages": false, - "trackNamedPages": false - } - } - }, - "output": { - "error": "Both 'Track Categorized Pages' and 'Track Named Pages' toggles are disabled in webapp. Please enable at one of them to send page/screen events to Optimizely." - } - }, - { - "description": "Invalid Configuration (Track known users toggle is on and userId is missing in request)", - "input": { - "message": { - "type": "track", - "channel": "web", - "event": "Product Added", - "properties": { - "price": 999, - "quantity": 1 - }, - "context": { - "traits": { - "firstName": "John", - "age": 27 - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "optimizely_fullstack": { - "variationId": "123" - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campagin_id", - "experimentId": "test_experiment_id", - "trackCategorizedPages": false, - "trackNamedPages": false, - "trackKnownUsers": true - } - } - }, - "output": { - "error": "UserId is required for event tracking when the 'Track Known Users' setting is enabled. Please include a 'userId' in your event payload" - } - }, - { - "description": "Invalid Configuration (Track known users toggle is off and anonymousId is missing in request)", - "input": { - "message": { - "type": "track", - "channel": "web", - "event": "Product Added", - "properties": { - "price": 999, - "quantity": 1 - }, - "context": { - "traits": { - "firstName": "John", - "age": 27 - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "123" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campagin_id", - "experimentId": "test_experiment_id" - } - } - }, - "output": { - "error": "AnonymousId is required when 'Track Known Users' setting is disabled" - } - }, - { - "description": "Track call without event", - "input": { - "message": { - "type": "track", - "channel": "web", - "properties": {}, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campagin_id", - "experimentId": "test_experiment_id" - } - } - }, - "output": { - "error": "Event is not present. Aborting." - } - }, - { - "description": "Invalid data file url", - "input": { - "message": { - "type": "track", - "event": "Product Added", - "channel": "web", - "properties": {}, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/wrong_cdn.json", - "accountId": "test_account_id", - "campaignId": "test_campagin_id", - "experimentId": "test_experiment_id" - } - } - }, - "output": { - "error": "Data File Lookup Failed due to {\"code\":\"document_not_found\",\"message\":\"document_not_found\"}" - } - }, - { - "description": "Invalid data file url", - "input": { - "message": { - "type": "track", - "event": "Product Added", - "channel": "web", - "properties": {}, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "123" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campagin_id", - "experimentId": "test_experiment_id", - "eventMapping": [ - { - "from": "Product Added", - "to": "product_added" - } - ] - } - } - }, - "output": { - "error": "Event 'product_added' is not present in data file. Make sure event exists in Optimizely." - } - }, - { - "description": "Identify call (Decision Event) with userId", - "input": { - "message": { - "type": "identify", - "channel": "web", - "properties": {}, - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe", - "country": "US" - }, - "sessionId": 1685626914716 - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "timestamp": "2023-02-10T12:16:07.251Z", - "userId": "userId123", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_1" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "attributeMapping": [ - { - "from": "organization", - "to": "company" - }, - { - "from": "fullName", - "to": "name" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": false, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "attributes": [ - { - "entity_id": "test_attribute_id_5", - "key": "company", - "type": "custom", - "value": "RudderStack" - }, - { - "entity_id": "test_attribute_id_2", - "key": "name", - "type": "custom", - "value": "John Doe" - } - ], - "snapshots": [ - { - "decisions": [ - { - "campaign_id": "test_campaign_id", - "experiment_id": "test_experiment_id", - "variation_id": "test_variation_id_1" - } - ], - "events": [ - { - "entity_id": "test_campaign_id", - "type": "campaign_activated", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff" - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Identify call (Decision Event) with anonymousId", - "input": { - "message": { - "type": "identify", - "channel": "web", - "properties": {}, - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe", - "country": "US" - }, - "sessionId": 1685626914716 - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "timestamp": "2023-02-10T12:16:07.251Z", - "userId": "userId123", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_1" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": false - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": false, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "97c46c81-3140-456d-b2a9-690d70aaca35", - "snapshots": [ - { - "decisions": [ - { - "campaign_id": "test_campaign_id", - "experiment_id": "test_experiment_id", - "variation_id": "test_variation_id_1" - } - ], - "events": [ - { - "entity_id": "test_campaign_id", - "type": "campaign_activated", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff" - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Identify call (Decision Event) with projectId is empty", - "input": { - "message": { - "type": "identify", - "channel": "web", - "properties": {}, - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe", - "country": "US" - }, - "sessionId": 1685626914716 - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "timestamp": "2023-02-10T12:16:07.251Z", - "userId": "userId123", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_1" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "projectId": "", - "attributeMapping": [ - { - "from": "organization", - "to": "company" - }, - { - "from": "fullName", - "to": "name" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": false, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "attributes": [ - { - "entity_id": "test_attribute_id_5", - "key": "company", - "type": "custom", - "value": "RudderStack" - }, - { - "entity_id": "test_attribute_id_2", - "key": "name", - "type": "custom", - "value": "John Doe" - } - ], - "snapshots": [ - { - "decisions": [ - { - "campaign_id": "test_campaign_id", - "experiment_id": "test_experiment_id", - "variation_id": "test_variation_id_1" - } - ], - "events": [ - { - "entity_id": "test_campaign_id", - "type": "campaign_activated", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff" - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track call (Conversion event) with userId", - "input": { - "message": { - "type": "track", - "event": "product_added", - "userId": "userId123", - "channel": "web", - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe" - }, - "sessionId": 1685626914716 - }, - "rudderId": "5354b3f2-cb72-4355-a2b5-a298c3837c7d", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "timestamp": "2023-02-10T12:16:07.251Z", - "properties": { - "foo": "bar", - "revenue": 123, - "quantity": 2 - }, - "anonymousId": "856365b8-da4b-4c13-9098-84df18559446", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_2" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "eventMapping": [ - { - "from": "Product Searched", - "to": "Searched" - }, - { - "from": "product_added", - "to": "Product Added" - } - ], - "attributeMapping": [ - { - "from": "organization", - "to": "company" - }, - { - "from": "fullName", - "to": "name" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": true, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "attributes": [ - { - "entity_id": "test_attribute_id_5", - "key": "company", - "type": "custom", - "value": "RudderStack" - }, - { - "entity_id": "test_attribute_id_2", - "key": "name", - "type": "custom", - "value": "John Doe" - } - ], - "snapshots": [ - { - "decisions": [], - "events": [ - { - "entity_id": "test_event_id_1", - "key": "Product Added", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "quantity": 2, - "revenue": 12300, - "tags": { - "foo": "bar" - } - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track call (Conversion event) without event mapping configured in webapp", - "input": { - "message": { - "type": "track", - "event": "Product Added", - "channel": "web", - "properties": {}, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "timestamp": "2023-02-10T12:16:07.251Z", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "123" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campagin_id", - "experimentId": "test_experiment_id" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": false, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "97c46c81-3140-456d-b2a9-690d70aaca35", - "snapshots": [ - { - "decisions": [], - "events": [ - { - "entity_id": "test_event_id_1", - "key": "Product Added", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "tags": {} - } - ] - } - ] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track call: Missing Variation ID in integration object ", - "input": { - "message": { - "type": "track", - "event": "product_added", - "userId": "userId123", - "channel": "web", - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe" - }, - "sessionId": 1685626914716 - }, - "rudderId": "5354b3f2-cb72-4355-a2b5-a298c3837c7d", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "timestamp": "2023-02-10T12:16:07.251Z", - "properties": { - "foo": "bar", - "revenue": 123, - "quantity": 2 - }, - "anonymousId": "856365b8-da4b-4c13-9098-84df18559446", - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "eventMapping": [ - { - "from": "Product Searched", - "to": "Searched" - }, - { - "from": "product_added", - "to": "Product Added" - } - ], - "attributeMapping": [ - { - "from": "organization", - "to": "company" - }, - { - "from": "fullName", - "to": "name" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": true, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "attributes": [ - { - "entity_id": "test_attribute_id_5", - "key": "company", - "type": "custom", - "value": "RudderStack" - }, - { - "entity_id": "test_attribute_id_2", - "key": "name", - "type": "custom", - "value": "John Doe" - } - ], - "snapshots": [ - { - "decisions": [], - "events": [ - { - "entity_id": "test_event_id_1", - "key": "Product Added", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "quantity": 2, - "revenue": 12300, - "tags": { - "foo": "bar" - } - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track Categorized and Named Page", - "input": { - "message": { - "type": "page", - "name": "Meal", - "userId": "userId123", - "channel": "web", - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe" - }, - "sessionId": 1685626914716 - }, - "rudderId": "5354b3f2-cb72-4355-a2b5-a298c3837c7d", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "timestamp": "2023-02-10T12:16:07.251Z", - "properties": { - "foo": "bar", - "category": "food" - }, - "anonymousId": "856365b8-da4b-4c13-9098-84df18559446", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_1" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "trackCategorizedPages": true, - "trackNamedPages": true, - "pageMapping": [ - { - "from": "meal", - "to": "Viewed Meal Page" - }, - { - "from": "food", - "to": "Product Added" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": true, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "snapshots": [ - { - "decisions": [], - "events": [ - { - "entity_id": "test_event_id_1", - "key": "Product Added", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "tags": { - "foo": "bar", - "category": "food" - } - }, - { - "entity_id": "test_event_id_4", - "key": "Viewed Meal page", - "timestamp": 1676031367251, - "uuid": "generated_uuid", - "tags": { - "foo": "bar", - "category": "food" - } - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track Categorized and Named Page without event mapping configured in webapp", - "input": { - "message": { - "type": "page", - "name": "home", - "userId": "userId123", - "channel": "web", - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe" - }, - "sessionId": 1685626914716 - }, - "rudderId": "5354b3f2-cb72-4355-a2b5-a298c3837c7d", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "timestamp": "2023-02-10T12:16:07.251Z", - "properties": { - "foo": "bar", - "category": "index" - }, - "anonymousId": "856365b8-da4b-4c13-9098-84df18559446", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_1" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "trackCategorizedPages": true, - "trackNamedPages": true, - "pageMapping": [ - { - "from": "", - "to": "" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": true, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "snapshots": [ - { - "decisions": [], - "events": [ - { - "entity_id": "test_event_id_8", - "key": "Index", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "tags": { - "foo": "bar", - "category": "index" - } - }, - { - "entity_id": "test_event_id_7", - "key": "Home", - "timestamp": 1676031367251, - "uuid": "generated_uuid", - "tags": { - "foo": "bar", - "category": "index" - } - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track Categorized Page: trackCategorizedPages,trackNamedPages toggle are enabled and name is not provided", - "input": { - "message": { - "type": "page", - "userId": "userId123", - "channel": "web", - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe" - }, - "sessionId": 1685626914716 - }, - "rudderId": "5354b3f2-cb72-4355-a2b5-a298c3837c7d", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "timestamp": "2023-02-10T12:16:07.251Z", - "properties": { - "foo": "bar", - "category": "food" - }, - "anonymousId": "856365b8-da4b-4c13-9098-84df18559446", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_1" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "trackCategorizedPages": true, - "trackNamedPages": true, - "pageMapping": [ - { - "from": "meal", - "to": "Viewed Meal Page" - }, - { - "from": "food", - "to": "Product Added" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": true, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "snapshots": [ - { - "decisions": [], - "events": [ - { - "entity_id": "test_event_id_1", - "key": "Product Added", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "tags": { - "foo": "bar", - "category": "food" - } - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track Named Page: trackCategorizedPages,trackNamedPages toggle are enabled and category is not provided", - "input": { - "message": { - "type": "page", - "userId": "userId123", - "name": "Meal", - "channel": "web", - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe" - }, - "sessionId": 1685626914716 - }, - "rudderId": "5354b3f2-cb72-4355-a2b5-a298c3837c7d", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "timestamp": "2023-02-10T12:16:07.251Z", - "properties": { - "foo": "bar" - }, - "anonymousId": "856365b8-da4b-4c13-9098-84df18559446", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_1" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "trackCategorizedPages": true, - "trackNamedPages": true, - "pageMapping": [ - { - "from": "meal", - "to": "Viewed Meal Page" - }, - { - "from": "food", - "to": "Product Added" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": true, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "snapshots": [ - { - "decisions": [], - "events": [ - { - "entity_id": "test_event_id_4", - "key": "Viewed Meal page", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "tags": { - "foo": "bar" - } - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track Named Page: trackCategorizedPages,trackNamedPages toggle are enabled and category mapping is wrong", - "input": { - "message": { - "type": "page", - "userId": "userId123", - "name": "Meal", - "channel": "web", - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe" - }, - "sessionId": 1685626914716 - }, - "rudderId": "5354b3f2-cb72-4355-a2b5-a298c3837c7d", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "timestamp": "2023-02-10T12:16:07.251Z", - "properties": { - "foo": "bar" - }, - "anonymousId": "856365b8-da4b-4c13-9098-84df18559446", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_1" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "trackCategorizedPages": true, - "trackNamedPages": true, - "pageMapping": [ - { - "from": "meal", - "to": "Viewed Meal Page" - }, - { - "from": "food", - "to": "ABC" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": true, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "snapshots": [ - { - "decisions": [], - "events": [ - { - "entity_id": "test_event_id_4", - "key": "Viewed Meal page", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "tags": { - "foo": "bar" - } - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track Named Page: mapping is not provided for page name in webapp", - "input": { - "message": { - "type": "page", - "userId": "userId123", - "name": "Meal", - "channel": "web", - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe" - }, - "sessionId": 1685626914716 - }, - "rudderId": "5354b3f2-cb72-4355-a2b5-a298c3837c7d", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "timestamp": "2023-02-10T12:16:07.251Z", - "properties": { - "foo": "bar" - }, - "anonymousId": "856365b8-da4b-4c13-9098-84df18559446", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_1" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "trackCategorizedPages": false, - "trackNamedPages": true, - "pageMapping": [ - { - "from": "Home", - "to": "Viewed Home Page" - }, - { - "from": "food", - "to": "Product Added" - } - ] - } - } - }, - "output": { - "error": "Events [meal] are not present in the data file. Make sure events exist in Optimizely." - } - }, - { - "description": "Track Categorized and Named Screen", - "input": { - "message": { - "type": "screen", - "name": "Home", - "userId": "userId123", - "channel": "web", - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe" - }, - "sessionId": 1685626914716 - }, - "rudderId": "5354b3f2-cb72-4355-a2b5-a298c3837c7d", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "timestamp": "2023-02-10T12:16:07.251Z", - "properties": { - "foo": "bar", - "category": "food" - }, - "anonymousId": "856365b8-da4b-4c13-9098-84df18559446", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_1" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "trackCategorizedPages": true, - "trackNamedPages": true, - "pageMapping": [ - { - "from": "home", - "to": "Viewed Main Screen" - }, - { - "from": "food", - "to": "Product Added" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": true, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "snapshots": [ - { - "decisions": [], - "events": [ - { - "entity_id": "test_event_id_1", - "key": "Product Added", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "tags": { - "foo": "bar", - "category": "food" - } - }, - { - "entity_id": "test_event_id_6", - "key": "Viewed Main screen", - "timestamp": 1676031367251, - "uuid": "generated_uuid", - "tags": { - "foo": "bar", - "category": "food" - } - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - } -] diff --git a/test/__tests__/data/optimizely_fullstack_router.json b/test/__tests__/data/optimizely_fullstack_router.json deleted file mode 100644 index 6be928afc9..0000000000 --- a/test/__tests__/data/optimizely_fullstack_router.json +++ /dev/null @@ -1,494 +0,0 @@ -[ - { - "input": [ - { - "message": { - "type": "identify", - "channel": "web", - "properties": {}, - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe", - "country": "US" - }, - "sessionId": 1685626914716 - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "timestamp": "2023-02-10T12:16:07.251Z", - "userId": "userId123", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_1" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "attributeMapping": [ - { - "from": "organization", - "to": "company" - }, - { - "from": "fullName", - "to": "name" - } - ] - } - }, - "metadata": { - "jobId": 1 - } - }, - { - "message": { - "type": "track", - "event": "product_added", - "userId": "userId123", - "channel": "web", - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe" - }, - "sessionId": 1685626914716 - }, - "rudderId": "5354b3f2-cb72-4355-a2b5-a298c3837c7d", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "timestamp": "2023-02-10T12:16:07.251Z", - "properties": { - "foo": "bar", - "revenue": 123, - "quantity": 2 - }, - "anonymousId": "856365b8-da4b-4c13-9098-84df18559446", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_2" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "eventMapping": [ - { - "from": "Product Searched", - "to": "Searched" - }, - { - "from": "product_added", - "to": "Product Added" - } - ], - "attributeMapping": [ - { - "from": "organization", - "to": "company" - }, - { - "from": "fullName", - "to": "name" - } - ] - } - }, - "metadata": { - "jobId": 2 - } - }, - { - "message": { - "type": "page", - "userId": "userId123", - "channel": "web", - "context": { - "traits": { - "organization": "RudderStack", - "fullName": "John Doe" - }, - "sessionId": 1685626914716 - }, - "rudderId": "5354b3f2-cb72-4355-a2b5-a298c3837c7d", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "timestamp": "2023-02-10T12:16:07.251Z", - "properties": { - "foo": "bar", - "category": "food" - }, - "anonymousId": "856365b8-da4b-4c13-9098-84df18559446", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "test_variation_id_1" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "trackCategorizedPages": true, - "trackNamedPages": false, - "pageMapping": [ - { - "from": "meal", - "to": "Viewed Meal Page" - }, - { - "from": "food", - "to": "Product Added" - } - ] - } - }, - "metadata": { - "jobId": 3 - } - }, - { - "message": { - "type": "page", - "channel": "web", - "name": "Home", - "properties": {}, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true, - "optimizely_fullstack": { - "variationId": "123" - } - } - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campagin_id", - "experimentId": "test_experiment_id", - "trackCategorizedPages": false, - "trackNamedPages": false - } - }, - "metadata": { - "jobId": 4 - } - } - ], - "output": [ - { - "batched": false, - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": false, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "attributes": [ - { - "entity_id": "test_attribute_id_5", - "key": "company", - "type": "custom", - "value": "RudderStack" - }, - { - "entity_id": "test_attribute_id_2", - "key": "name", - "type": "custom", - "value": "John Doe" - } - ], - "snapshots": [ - { - "decisions": [ - { - "campaign_id": "test_campaign_id", - "experiment_id": "test_experiment_id", - "variation_id": "test_variation_id_1" - } - ], - "events": [ - { - "entity_id": "test_campaign_id", - "type": "campaign_activated", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff" - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "attributeMapping": [ - { - "from": "organization", - "to": "company" - }, - { - "from": "fullName", - "to": "name" - } - ] - } - }, - "metadata": [ - { - "jobId": 1 - } - ], - "statusCode": 200 - }, - { - "batched": false, - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": true, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "attributes": [ - { - "entity_id": "test_attribute_id_5", - "key": "company", - "type": "custom", - "value": "RudderStack" - }, - { - "entity_id": "test_attribute_id_2", - "key": "name", - "type": "custom", - "value": "John Doe" - } - ], - "snapshots": [ - { - "decisions": [], - "events": [ - { - "entity_id": "test_event_id_1", - "key": "Product Added", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "quantity": 2, - "revenue": 12300, - "tags": { - "foo": "bar" - } - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "eventMapping": [ - { - "from": "Product Searched", - "to": "Searched" - }, - { - "from": "product_added", - "to": "Product Added" - } - ], - "attributeMapping": [ - { - "from": "organization", - "to": "company" - }, - { - "from": "fullName", - "to": "name" - } - ] - } - }, - "metadata": [ - { - "jobId": 2 - } - ], - "statusCode": 200 - }, - { - "batched": false, - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://logx.optimizely.com/v1/events", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "account_id": "test_account_id", - "anonymize_ip": true, - "enrich_decisions": true, - "client_name": "RudderStack", - "client_version": "1.0.0", - "visitors": [ - { - "visitor_id": "userId123", - "snapshots": [ - { - "decisions": [], - "events": [ - { - "entity_id": "test_event_id_1", - "key": "Product Added", - "timestamp": 1676031367251, - "uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "tags": { - "foo": "bar", - "category": "food" - } - } - ] - } - ], - "session_id": "1685626914716" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "destination": { - "Config": { - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "accountId": "test_account_id", - "campaignId": "test_campaign_id", - "experimentId": "test_experiment_id", - "trackKnownUsers": true, - "anonymizeIp": true, - "trackCategorizedPages": true, - "trackNamedPages": false, - "pageMapping": [ - { - "from": "meal", - "to": "Viewed Meal Page" - }, - { - "from": "food", - "to": "Product Added" - } - ] - } - }, - "metadata": [ - { - "jobId": 3 - } - ], - "statusCode": 200 - }, - { - "batched": false, - "destination": { - "Config": { - "accountId": "test_account_id", - "campaignId": "test_campagin_id", - "dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json", - "experimentId": "test_experiment_id", - "trackCategorizedPages": false, - "trackNamedPages": false - } - }, - "error": "Both 'Track Categorized Pages' and 'Track Named Pages' toggles are disabled in webapp. Please enable at one of them to send page/screen events to Optimizely.", - "metadata": [ - { - "jobId": 4 - } - ], - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration" - }, - "statusCode": 400 - } - ] - } -] diff --git a/test/__tests__/data/pardot_proxy_input.json b/test/__tests__/data/pardot_proxy_input.json deleted file mode 100644 index f5f62dea72..0000000000 --- a/test/__tests__/data/pardot_proxy_input.json +++ /dev/null @@ -1,106 +0,0 @@ -[ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://pi.pardot.com/api/prospect/version/4/do/upsert/id/123435", - "headers": { - "Authorization": "Bearer myToken", - "Pardot-Business-Unit-Id": "0Uv2v000000k9tHCAQ" - }, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "first_name": "Roger12", - "last_name": "Federer12", - "website": "https://rudderstack.com", - "score": 14, - "campaign_id": 42213 - } - }, - "files": {}, - "params": { - "destination": "pardot" - } - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://pi.pardot.com/api/prospect/version/4/do/upsert/email/Roger_12@waltair.io", - "headers": { - "Authorization": "Bearer myToken", - "Pardot-Business-Unit-Id": "0Uv2v000000k9tHCAQ" - }, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "first_name": "Roger_12", - "last_name": "Federer_12", - "website": "https://rudderstack.com", - "score": 14, - "campaign_id": 42213 - } - }, - "files": {}, - "params": { - "destination": "pardot" - } - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://pi.pardot.com/api/prospect/version/4/do/upsert/fid/00Q6r000002LKhTPVR", - "headers": { - "Authorization": "Bearer myToken", - "Pardot-Business-Unit-Id": "0Uv2v000000k9tHCAQ" - }, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "first_name": "Nick", - "last_name": "Kyrgios", - "website": "https://rudderstack.com", - "score": 12, - "campaign_id": 42213 - } - }, - "files": {}, - "params": { - "destination": "pardot" - } - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://pi.pardot.com/api/prospect/version/4/do/upsert/email/rolex_waltair@mywebsite.io", - "headers": { - "Authorization": "Bearer myExpiredToken", - "Pardot-Business-Unit-Id": "0Uv2v000000k9tHCAQ" - }, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "first_name": "Rolex", - "last_name": "Waltair", - "website": "https://rudderstack.com", - "score": 15, - "campaign_id": 42213 - } - }, - "files": {}, - "params": { - "destination": "pardot" - } - } -] \ No newline at end of file diff --git a/test/__tests__/data/pardot_proxy_output.json b/test/__tests__/data/pardot_proxy_output.json deleted file mode 100644 index 46783b3d69..0000000000 --- a/test/__tests__/data/pardot_proxy_output.json +++ /dev/null @@ -1,378 +0,0 @@ -[ - { - "output": { - "message": "Request Processed Successfully", - "status": 200, - "destinationResponse": { - "response": { - "@attributes": { - "stat": "ok", - "version": 1 - }, - "prospect": { - "id": 123435, - "campaign_id": 42213, - "salutation": null, - "first_name": "Roger12", - "last_name": "Federer12", - "email": "Roger12@waltair.io", - "password": null, - "company": null, - "website": "https://rudderstack.com", - "job_title": null, - "department": null, - "country": "AU", - "address_one": null, - "address_two": null, - "city": null, - "state": null, - "territory": null, - "zip": null, - "phone": null, - "fax": null, - "source": null, - "annual_revenue": null, - "employees": null, - "industry": null, - "years_in_business": null, - "comments": null, - "notes": null, - "score": 14, - "grade": null, - "last_activity_at": null, - "recent_interaction": "Never active.", - "crm_lead_fid": null, - "crm_contact_fid": null, - "crm_owner_fid": "00G2v000004WYXaEAO", - "crm_account_fid": null, - "salesforce_fid": null, - "crm_last_sync": null, - "crm_url": null, - "is_do_not_email": null, - "is_do_not_call": null, - "opted_out": null, - "is_reviewed": 1, - "is_starred": null, - "created_at": "2022-01-21 18:21:46", - "updated_at": "2022-01-21 18:48:41", - "campaign": { - "id": 42113, - "name": "Test", - "crm_fid": "7012y000000MNOCLL4" - }, - "assigned_to": { - "user": { - "id": 38443703, - "email": "test_rudderstack@testcompany.com", - "first_name": "Rudderstack", - "last_name": "User", - "job_title": null, - "role": "Administrator", - "account": 489853, - "created_at": "2021-02-26 06:25:17", - "updated_at": "2021-02-26 06:25:17" - } - }, - "Are_you_shipping_large_fragile_or_bulky_items": false, - "Calendly": false, - "Country_Code": "AU", - "Currency": "AUD", - "Inventory_or_Warehouse_Management_System": false, - "Lead_Status": "New", - "Marketing_Stage": "SAL", - "Record_Type_ID": "TestCompany Lead", - "profile": { - "id": 304, - "name": "Default", - "profile_criteria": [ - { - "id": 1500, - "name": "Shipping Volume", - "matches": "Unknown" - }, - { - "id": 1502, - "name": "Industry", - "matches": "Unknown" - }, - { - "id": 1506, - "name": "Job Title", - "matches": "Unknown" - }, - { - "id": 1508, - "name": "Department", - "matches": "Unknown" - } - ] - }, - "visitors": null, - "visitor_activities": null, - "lists": null - } - }, - "status": 200 - } - } - }, - { - "output": { - "message": "Request Processed Successfully", - "status": 201, - "destinationResponse": { - "response": { - "@attributes": { - "stat": "ok", - "version": 1 - }, - "prospect": { - "id": 123435, - "campaign_id": 42213, - "salutation": null, - "first_name": "Roger_12", - "last_name": "Federer_12", - "email": "Roger_12@waltair.io", - "password": null, - "company": null, - "website": "https://rudderstack.com", - "job_title": null, - "department": null, - "country": "AU", - "address_one": null, - "address_two": null, - "city": null, - "state": null, - "territory": null, - "zip": null, - "phone": null, - "fax": null, - "source": null, - "annual_revenue": null, - "employees": null, - "industry": null, - "years_in_business": null, - "comments": null, - "notes": null, - "score": 14, - "grade": null, - "last_activity_at": null, - "recent_interaction": "Never active.", - "crm_lead_fid": null, - "crm_contact_fid": null, - "crm_owner_fid": "00G2v000004WYXaEAO", - "crm_account_fid": null, - "salesforce_fid": null, - "crm_last_sync": null, - "crm_url": null, - "is_do_not_email": null, - "is_do_not_call": null, - "opted_out": null, - "is_reviewed": 1, - "is_starred": null, - "created_at": "2022-01-21 18:21:46", - "updated_at": "2022-01-21 18:48:41", - "campaign": { - "id": 42113, - "name": "Test", - "crm_fid": "7012y000000MNOCLL4" - }, - "assigned_to": { - "user": { - "id": 38443703, - "email": "test_rudderstack@testcompany.com", - "first_name": "Rudderstack", - "last_name": "User", - "job_title": null, - "role": "Administrator", - "account": 489853, - "created_at": "2021-02-26 06:25:17", - "updated_at": "2021-02-26 06:25:17" - } - }, - "Are_you_shipping_large_fragile_or_bulky_items": false, - "Calendly": false, - "Country_Code": "AU", - "Currency": "AUD", - "Inventory_or_Warehouse_Management_System": false, - "Lead_Status": "New", - "Marketing_Stage": "SAL", - "Record_Type_ID": "TestCompany Lead", - "profile": { - "id": 304, - "name": "Default", - "profile_criteria": [ - { - "id": 1500, - "name": "Shipping Volume", - "matches": "Unknown" - }, - { - "id": 1502, - "name": "Industry", - "matches": "Unknown" - }, - { - "id": 1506, - "name": "Job Title", - "matches": "Unknown" - }, - { - "id": 1508, - "name": "Department", - "matches": "Unknown" - } - ] - }, - "visitors": null, - "visitor_activities": null, - "lists": null - } - }, - "status": 201 - } - } - }, - { - "output": { - "message": "Request Processed Successfully", - "status": 200, - "destinationResponse": { - "response": { - "@attributes": { - "stat": "ok", - "version": 1 - }, - "prospect": { - "id": 123435, - "campaign_id": 42213, - "salutation": null, - "first_name": "Roger_12", - "last_name": "Federer_12", - "email": "Roger_12@federer.io", - "password": null, - "company": null, - "website": "https://rudderstack.com", - "job_title": null, - "department": null, - "country": "AU", - "address_one": null, - "address_two": null, - "city": null, - "state": null, - "territory": null, - "zip": null, - "phone": null, - "fax": null, - "source": null, - "annual_revenue": null, - "employees": null, - "industry": null, - "years_in_business": null, - "comments": null, - "notes": null, - "score": 14, - "grade": null, - "last_activity_at": null, - "recent_interaction": "Never active.", - "crm_lead_fid": "00Q6r000002LKhTPVR", - "crm_contact_fid": null, - "crm_owner_fid": "00G2v000004WYXaEAO", - "crm_account_fid": null, - "salesforce_fid": "00Q6r000002LKhTPVR", - "crm_last_sync": "2022-01-21 18:47:37", - "crm_url": "https://testcompany.my.salesforce.com/00Q6r000002LKhTPVR", - "is_do_not_email": null, - "is_do_not_call": null, - "opted_out": null, - "is_reviewed": 1, - "is_starred": null, - "created_at": "2022-01-21 18:21:46", - "updated_at": "2022-01-21 18:48:41", - "campaign": { - "id": 42113, - "name": "Test", - "crm_fid": "7012y000000MNOCLL4" - }, - "assigned_to": { - "user": { - "id": 38443703, - "email": "test_rudderstack@testcompany.com", - "first_name": "Rudderstack", - "last_name": "User", - "job_title": null, - "role": "Administrator", - "account": 489853, - "created_at": "2021-02-26 06:25:17", - "updated_at": "2021-02-26 06:25:17" - } - }, - "Are_you_shipping_large_fragile_or_bulky_items": false, - "Calendly": false, - "Country_Code": "AU", - "Currency": "AUD", - "Inventory_or_Warehouse_Management_System": false, - "Lead_Status": "New", - "Marketing_Stage": "SAL", - "Record_Type_ID": "TestCompany Lead", - "profile": { - "id": 304, - "name": "Default", - "profile_criteria": [ - { - "id": 1500, - "name": "Shipping Volume", - "matches": "Unknown" - }, - { - "id": 1502, - "name": "Industry", - "matches": "Unknown" - }, - { - "id": 1506, - "name": "Job Title", - "matches": "Unknown" - }, - { - "id": 1508, - "name": "Department", - "matches": "Unknown" - } - ] - }, - "visitors": null, - "visitor_activities": null, - "lists": null - } - }, - "status": 200 - } - } - }, - { - "output": { - "message": "access_token is invalid, unknown, or malformed: Inactive token during Pardot response transformation", - "status": 500, - "authErrorCategory": "REFRESH_TOKEN", - "destinationResponse": { - "@attributes": { - "stat": "fail", - "version": 1, - "err_code": 184 - }, - "err": "access_token is invalid, unknown, or malformed: Inactive token" - }, - "statTags": { - "destType": "PARDOT", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - } -] diff --git a/test/__tests__/optimizely_fullstack-cdk.test.ts b/test/__tests__/optimizely_fullstack-cdk.test.ts deleted file mode 100644 index b51cd18b11..0000000000 --- a/test/__tests__/optimizely_fullstack-cdk.test.ts +++ /dev/null @@ -1,60 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { processCdkV2Workflow } from '../../src/cdk/v2/handler'; -import tags from '../../src/v0/util/tags'; - -const integration = 'optimizely_fullstack'; -const destName = 'Optimizely Fullstack'; - -jest.mock('../../src/v0/util/index', () => { - const originalModule = jest.requireActual('../../src/v0/util/index'); - return { - ...originalModule, - generateUUID: jest.fn(() => 'generated_uuid'), - }; -}); - -// Processor Test files -const testDataFile = fs.readFileSync(path.resolve(__dirname, `./data/${integration}.json`), { - encoding: 'utf8', -}); -const testData = JSON.parse(testDataFile); - -// Router Test files -const routerTestDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router.json`), - { encoding: 'utf8' }, -); -const routerTestData = JSON.parse(routerTestDataFile); - -describe(`${destName} Tests`, () => { - describe('Processor Tests', () => { - testData.forEach((dataPoint, index) => { - it(`${destName} - payload: ${index}`, async () => { - try { - const output = await processCdkV2Workflow( - integration, - dataPoint.input, - tags.FEATURES.PROCESSOR, - ); - expect(output).toEqual(dataPoint.output); - } catch (error: any) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); - - describe('Router Tests', () => { - routerTestData.forEach((dataPoint) => { - it('Optimizely fullstack router test case', async () => { - const output = await processCdkV2Workflow( - integration, - dataPoint.input, - tags.FEATURES.ROUTER, - ); - expect(output).toEqual(dataPoint.output); - }); - }); - }); -}); diff --git a/test/__tests__/pardot.test.js b/test/__tests__/pardot.test.js deleted file mode 100644 index d766d3b856..0000000000 --- a/test/__tests__/pardot.test.js +++ /dev/null @@ -1,28 +0,0 @@ -const fs = require("fs"); -const path = require("path"); - -const integration = "pardot"; -const name = "pardot"; - -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -//for router test -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Router Tests`, () => { - describe("Router Tests", () => { - it(`${name} Payload`, async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/proxy.test.ts b/test/__tests__/proxy.test.ts index 9f13c198fc..15769fc8dc 100644 --- a/test/__tests__/proxy.test.ts +++ b/test/__tests__/proxy.test.ts @@ -1,12 +1,13 @@ const name = 'Proxy'; -import fs from 'fs'; -import path from 'path'; +import fs, { appendFileSync } from 'fs'; +import path, { join } from 'path'; import request from 'supertest'; import { createHttpTerminator } from 'http-terminator'; import { mockedAxiosClient } from '../__mocks__/network'; import Koa from 'koa'; import bodyParser from 'koa-bodyparser'; import { applicationRoutes } from '../../src/routes'; +import { responses } from '../testHelper'; let server: any; const OLD_ENV = process.env; @@ -37,7 +38,6 @@ const version = '1'; const destinations = [ 'marketo', 'braze', - 'pardot', 'google_adwords_remarketing_lists', 'google_adwords_enhanced_conversions', 'facebook_pixel', @@ -48,7 +48,7 @@ const destinations = [ 'marketo_static_list', 'criteo_audience', 'tiktok_ads', - 'intercom' + 'intercom', ]; // start of generic tests @@ -89,6 +89,20 @@ destinations.forEach((destination) => { expect(response.body).toEqual(expectedData[index]); }); }); + afterAll(() => { + if (process.env.GEN_AXIOS_FOR_TESTS === 'true') { + const callsDataStr = responses.join('\n'); + const calls = ` + export const networkCallsData = [ + ${callsDataStr} + ] + `; + appendFileSync( + join(__dirname, '..', 'integrations', 'destinations', destination, 'network.ts'), + calls, + ); + } + }); }); }); // destination tests end diff --git a/test/deleteUsers/README.md b/test/deleteUsers/README.md deleted file mode 100644 index c3170f3a8c..0000000000 --- a/test/deleteUsers/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# DeleteUsers Tests - -All the tests data for deleteUsers are to be present in **tests**/data/deleteUsers/${destination}/ - -### Files and their significance - -- **`handler_input.json`** - Input data for `handleDeletionOfUsers` function in `versionedRouter.js`(alias for `_deleteUsers_proxy_input.json`) -- **`handler_output.json`** - Output of `handleDeletionOfUsers` function in `versionedRouter.js`(alias for `_deleteUsers_proxy_output.json`) -- **`nw_client_data.json`** - the mock http responses(An example can be seen in the case of `ga`) - -### Fields in new files - -#### nw_client_data.json - -- Type: Array> -- The array of object is how many responses have to be sent back -- Each of the object contains below mentioned fields - - type: - - Indicates what type of http client invocation it is - - Recommended to be sent - - Supported values: - - post - - get - - delete - - constructor - - if nothing is mentioned, `post` is considered by default - - reqParams: - - Type: Array - - Optional - - Indicates the expected arguments that are to be sent to the http client instance - - We would `recommend` to also add this as part of your `nw_client_data.json` - - response: - - Type: object - - Required - - The response that needs to be returned from the http client diff --git a/test/deleteUsers/data/af/handler_input.json b/test/deleteUsers/data/af/handler_input.json deleted file mode 100644 index 7685ec7a73..0000000000 --- a/test/deleteUsers/data/af/handler_input.json +++ /dev/null @@ -1,177 +0,0 @@ -[ - { - "request": { - "body": [ - { - "destType": "AF", - "userAttributes": [ - { - "userId": "test_user_id", - "android_advertising_id": "1665148898336-5539842602053895577" - } - ], - "config": { - "devKey": "ef1d42390426e3f7c90ac78272e74344", - "appleAppId": "123456789", - "androidAppId": "AnAID", - "apiToken": "dummyApiToken" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "AF", - "userAttributes": [ - { - "userId": "test_user_id", - "ios_advertising_id": "1665148898336-5539842602053895577" - } - ], - "config": { - "devKey": "ef1d42390426e3f7c90ac78272e74344", - "appleAppId": "123456789", - "androidAppId": "AnAID", - "apiToken": "dummyApiToken", - "statusCallbackUrls": "https://examplecontroller.com/opengdpr_callbacks" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "AF", - "userAttributes": [ - { - "userId": "test_user_id", - "appsflyer_id": "jklhajksfh" - }, - { - "userId": "user_sdk2", - "appsflyer_id": "jklhajksfh" - } - ], - "config": { - "devKey": "ef1d42390426e3f7c90ac78272e74344", - "apiToken": "dummyApiToken" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "AF", - "userAttributes": [ - { - "userId": "test_user_id", - "appsflyer_id": "jklhajksfh" - }, - { - "userId": "user_sdk2", - "appsflyer_id": "jklhajksfh" - } - ], - "config": { - "devKey": "ef1d42390426e3f7c90ac78272e74344", - "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" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "AF", - "userAttributes": [ - { - "email": "testUser@testMail.com", - "android_advertising_id": "1234" - }, - { - "userId": "user_sdk2", - "android_advertising_id": "1234" - } - ], - "config": { - "devKey": "abcde", - "appleAppId": "asdfasdf", - "groupTypeTrait": "email", - "groupValueTrait": "age", - "trackProductsOnce": false, - "trackRevenuePerProduct": false, - "apiToken": "dummyApiToken" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "AF", - "userAttributes": [ - { - "email": "testUser@testMail.com", - "ios_advertising_id": "1234" - }, - { - "userId": "user_sdk2", - "ios_advertising_id": "1234" - } - ], - "config": { - "devKey": "abcde", - "androidAppId": "com.rudder.rs", - "groupTypeTrait": "email", - "groupValueTrait": "age", - "trackProductsOnce": false, - "trackRevenuePerProduct": false, - "apiToken": "dummyApiToken" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "AF", - "userAttributes": [ - { - "email": "testUser@testMail.com", - "userId": "user1234" - }, - { - "userId": "user_sdk2", - "ios_advertising_id": "1234" - } - ], - "config": { - "devKey": "abcde", - "androidAppId": "com.rudder.rs", - "groupTypeTrait": "email", - "groupValueTrait": "age", - "trackProductsOnce": false, - "trackRevenuePerProduct": false, - "apiToken": "dummyApiToken" - } - } - ] - } - } -] diff --git a/test/deleteUsers/data/af/handler_output.json b/test/deleteUsers/data/af/handler_output.json deleted file mode 100644 index 33363c69d3..0000000000 --- a/test/deleteUsers/data/af/handler_output.json +++ /dev/null @@ -1,44 +0,0 @@ -[ - [ - { - "statusCode": 400, - "error": "User deletion request failed" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ], - [ - { - "statusCode": 400, - "error": "API Token and one of Apple ID or Android App Id are required fields for user deletion" - } - ], - [ - { - "statusCode": 400, - "error": "You can send utmost 3 callBackUrls" - } - ], - [ - { - "statusCode": 400, - "error": "androidAppId is required for android_advertising_id type identifier" - } - ], - [ - { - "statusCode": 400, - "error": "appleAppId is required for ios_advertising_id type identifier" - } - ], - [ - { - "statusCode": 400, - "error": "none of the possible identityTypes i.e.(ios_advertising_id, android_advertising_id, appsflyer_id) is provided for deletion" - } - ] -] diff --git a/test/deleteUsers/data/af/nw_client_data.json b/test/deleteUsers/data/af/nw_client_data.json deleted file mode 100644 index b7ecfc1596..0000000000 --- a/test/deleteUsers/data/af/nw_client_data.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - [ - { - "type": "post", - "reqParams": [ - "https://hq1.appsflyer.com/gdpr/opengdpr_requests?api_token=dummyApiToken", - { - "subject_request_type": "erasure", - "subject_identities": { - "identity_format": "raw", - "identity_type": "android_advertising_id", - "identity_value": "1665148898336-5539842602053895577" - }, - "property_id": "AnAID", - "subject_request_id": "f31a16f4-2357-47b5-aba0-d83742f2fd66", - "submitted_time": "2022-12-26T12:51:27.570Z" - } - ], - "response": { - "code": 400, - "statusText": "fail", - "response": { - "data": { - "error": { - "code": 400, - "af_gdpr_code": "e411", - "message": "AppID given in 'property_id' is incorrect or does not belong to your account" - } - }, - "status": 400 - } - } - } - ], - [ - { - "type": "post", - "reqParams": [ - "https://hq1.appsflyer.com/gdpr/opengdpr_requests?api_token=dummyApiToken", - { - "subject_request_type": "erasure", - "subject_identities": { - "identity_format": "raw", - "identity_type": "ios_advertising_id", - "identity_value": "1665148898336-5539842602053895577" - }, - "property_id": "123456789", - "subject_request_id": "f31a16f4-2357-47b5-aba0-d83742f2fd66", - "submitted_time": "2022-12-26T12:51:27.570Z" - } - ], - "response": { - "status": 200, - "statusText": "success" - } - } - ] -] diff --git a/test/deleteUsers/data/am/handler_input.json b/test/deleteUsers/data/am/handler_input.json deleted file mode 100644 index 66b97d4a4d..0000000000 --- a/test/deleteUsers/data/am/handler_input.json +++ /dev/null @@ -1,380 +0,0 @@ -[ - { - "request": { - "body": [ - { - "jobId": "423451324652346", - "destType": "AM", - "userAttributes": [ - { - "userIderror": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - } - ], - "config": { - "apiKey": "1234", - "apiSecret": "abcd" - } - } - ] - } - } -] - - diff --git a/test/deleteUsers/data/am/handler_output.json b/test/deleteUsers/data/am/handler_output.json deleted file mode 100644 index c453a831d9..0000000000 --- a/test/deleteUsers/data/am/handler_output.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - [ - { - "statusCode": 400, - "error": "User deletion request failed" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ], - [ - { - "statusCode": 400, - "error": "Config for deletion not present" - } - ], - [ - { - "statusCode": 400, - "error": "api key/secret for deletion not present" - } - ] -] diff --git a/test/deleteUsers/data/am/nw_client_data.json b/test/deleteUsers/data/am/nw_client_data.json deleted file mode 100644 index 3abf39691a..0000000000 --- a/test/deleteUsers/data/am/nw_client_data.json +++ /dev/null @@ -1,91 +0,0 @@ -[ - [ - { - "type": "post", - "reqParams": [ - "https://amplitude.com/api/2/deletions/users", - { - "userIds": ["Batch1"] - }, - { - "Content-Type": "application/json", - "Authorization": "Basic MTIzNDphYmNk" - } - ], - "response": { - "code": 400, - "statusText": "fail", - "response": { - "data": { - "code": 403, - "message": "HTTP 403: Forbidden (Invalid API Key)", - "status": "Forbidden" - }, - "status": 400 - } - } - }, - { - "type": "post", - "reqParams": [ - "https://amplitude.com/api/2/deletions/users", - { - "userIds": ["Batch2"] - }, - { - "Content-Type": "application/json", - "Authorization": "Basic MTIzNDphYmNk" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": "Nothing scheduled due to invalid amplitude/user ids for app XXXXX" - } - } - } - ], - [ - { - "type": "post", - "reqParams": [ - "https://amplitude.com/api/2/deletions/users", - { - "userIds": ["Batch1"] - }, - { - "Content-Type": "application/json", - "Authorization": "Basic MTIzNDphYmNk" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": "Mocking" - } - } - }, - { - "type": "post", - "reqParams": [ - "https://amplitude.com/api/2/deletions/users", - { - "userIds": ["Batch2"] - }, - { - "Content-Type": "application/json", - "Authorization": "Basic MTIzNDphYmNk" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": "Mocking" - } - } - } - ] -] diff --git a/test/deleteUsers/data/braze/handler_input.json b/test/deleteUsers/data/braze/handler_input.json deleted file mode 100644 index 6a8ad60f4d..0000000000 --- a/test/deleteUsers/data/braze/handler_input.json +++ /dev/null @@ -1,393 +0,0 @@ -[ - { - "request": { - "body": [ - { - "destType": "BRAZE", - "userAttributes": [ - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - } - ], - "config": { - "dataCenter": "US-03", - "restApiKey": "1234" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "BRAZE", - "userAttributes": [ - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - } - ], - "config": { - "dataCenter": "US-03", - "restApiKey": "1234" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "BRAZE", - "userAttributes": [ - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - } - ] - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "BRAZE", - "userAttributes": [ - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - } - ], - "config": { - "dataCenter": "US-03" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "BRAZE", - "userAttributes": [ - { - "name": "a" - } - ], - "config": { - "restApiKey": "b1bd90e2-d203-480a-962c-f7bb03ea0afe", - "dataCenter": "US-03" - } - } - ] - } - } -] diff --git a/test/deleteUsers/data/braze/handler_output.json b/test/deleteUsers/data/braze/handler_output.json deleted file mode 100644 index 7df562646a..0000000000 --- a/test/deleteUsers/data/braze/handler_output.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - [ - { - "statusCode": 400, - "error": "User deletion request failed" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ], - [ - { - "statusCode": 400, - "error": "Config for deletion not present" - } - ], - [ - { - "statusCode": 400, - "error": "data center / api key for deletion not present" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ] -] diff --git a/test/deleteUsers/data/braze/nw_client_data.json b/test/deleteUsers/data/braze/nw_client_data.json deleted file mode 100644 index 34b2d488da..0000000000 --- a/test/deleteUsers/data/braze/nw_client_data.json +++ /dev/null @@ -1,97 +0,0 @@ -[ - [ - { - "type": "post", - "reqParams": [ - "https://rest.iad-03.braze.com/users/delete", - { - "externalIds": ["Batch1"] - }, - { - "Content-Type": "application/json", - "Authorization": "Bearer ${restApiKey}" - } - ], - "response": { - "code": 400, - "statusText": "fail", - "response": { - "data": { - "code": 400, - "message": "Bad Req", - "status": "Fail Case" - }, - "status": 400 - } - } - }, - { - "type": "post", - "reqParams": [ - "https://rest.iad-03.braze.com/users/delete", - { - "externalIds": ["Batch2"] - }, - { - "Content-Type": "application/json", - "Authorization": "Bearer ${restApiKey}" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": "1" - } - } - } - ], - [ - { - "type": "post", - "reqParams": [ - "https://rest.iad-03.braze.com/users/delete", - { - "externalIds": ["Batch4"] - }, - { - "Content-Type": "application/json", - "Authorization": "Bearer ${restApiKey}" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": { - "deleted": 50, - "message": "success" - } - } - } - }, - { - "type": "post", - "reqParams": [ - "https://rest.iad-03.braze.com/users/delete", - { - "externalIds": ["Batch"] - }, - { - "Content-Type": "application/json", - "Authorization": "Bearer ${restApiKey}" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": { - "deleted": 50, - "message": "success" - } - } - } - } - ] -] diff --git a/test/deleteUsers/data/clevertap/handler_input.json b/test/deleteUsers/data/clevertap/handler_input.json deleted file mode 100644 index 61c9446cf7..0000000000 --- a/test/deleteUsers/data/clevertap/handler_input.json +++ /dev/null @@ -1,441 +0,0 @@ -[ - { - "request": { - "body": [ - { - "destType": "CLEVERTAP", - "userAttributes": [ - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - } - ], - "config": { - "accountId": "476550467", - "trackAnonymous": true, - "enableObjectIdMapping": false - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "CLEVERTAP", - "userAttributes": [ - { - "email": "testUser@testMail.com" - }, - { - "userId": "user_sdk2" - } - ], - "config": { - "passcode": "fbee74a147828e2932c701d19dc1f2dcfa4ac0048be3aa3a88d427090a59dc1c0fa002f1", - "trackAnonymous": true, - "enableObjectIdMapping": false - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "CLEVERTAP", - "userAttributes": [ - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - }, - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - } - ], - "config": { - "accountId": "testFail", - "passcode": "tofail", - "trackAnonymous": true, - "enableObjectIdMapping": false - } - } - ] - } - } -] diff --git a/test/deleteUsers/data/clevertap/handler_output.json b/test/deleteUsers/data/clevertap/handler_output.json deleted file mode 100644 index cff9494cef..0000000000 --- a/test/deleteUsers/data/clevertap/handler_output.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - [ - { - "statusCode": 400, - "error": "Project ID and Passcode is required for delete user" - } - ], - [ - { - "statusCode": 400, - "error": "Project ID and Passcode is required for delete user" - } - ], - [ - { - "statusCode": 400, - "error": "User deletion request failed" - } - ] -] diff --git a/test/deleteUsers/data/clevertap/nw_client_data.json b/test/deleteUsers/data/clevertap/nw_client_data.json deleted file mode 100644 index 75a4f4550f..0000000000 --- a/test/deleteUsers/data/clevertap/nw_client_data.json +++ /dev/null @@ -1,177 +0,0 @@ -[ - [ - { - "type": "post", - "reqParams": [ - "https://api.clevertap.com/1/delete/profiles.json", - { - "identity": [ - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "user_sdk2" - ] - }, - { - "X-CleverTap-Account-Id": "testFail", - "X-CleverTap-Passcode": "tofail" - } - ], - "response": { - "code": 400, - "statusText": "fail", - "response": { - "data": { - "code": 400, - "message": "Bad Req", - "status": "Fail Case" - }, - "status": 400 - } - } - }, - { - "type": "post", - "reqParams": [ - "https://api.clevertap.com/1/delete/profiles.json", - { - "identity": [ - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2", - "test_user_id", - "user_sdk2" - ] - }, - { - "X-CleverTap-Account-Id": "testFail", - "X-CleverTap-Passcode": "tofail" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": "rpoxy" - } - } - } - ] -] diff --git a/test/deleteUsers/data/engage/handler_input.json b/test/deleteUsers/data/engage/handler_input.json deleted file mode 100644 index c999787e60..0000000000 --- a/test/deleteUsers/data/engage/handler_input.json +++ /dev/null @@ -1,133 +0,0 @@ -[ - { - "request": { - "body": [ - { - "destType": "ENGAGE", - "userAttributes": [ - { - "userId": "1" - }, - { - "userId": "2" - }, - { - "userId": "3" - } - ], - "config": { - "publicKey": "abcd", - "privateKey": "efgh" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "ENGAGE", - "userAttributes": [ - { - "userId": "4" - }, - { - "userId": "5" - }, - { - "userId": "6" - } - ], - "config": { - "publicKey": "abcd", - "privateKey": "efgh" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "ENGAGE", - "userAttributes": [ - { - "userId": "7" - }, - { - "userId": "8" - }, - { - "userId": "9" - } - ], - "config": { - "publicKey": "abcd", - "privateKey": "efgh" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "ENGAGE", - "userAttributes": [ - { - "userId": "1" - } - ], - "config": { - "publicKey": "abcd", - "privateKey": "efgh" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "ENGAGE", - "userAttributes": [ - { - "userId": "userid1" - }, - { - "userId": "user_sdk2" - } - ], - "config": { - "privateKey": "abcd" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "ENGAGE", - "userAttributes": [ - { - "email": "testUser@testMail.com" - }, - { - "userId": "user_sdk2" - } - ], - "config": { - "publicKey": "abcd", - "privateKey": "efgh" - } - } - ] - } - } -] diff --git a/test/deleteUsers/data/engage/handler_output.json b/test/deleteUsers/data/engage/handler_output.json deleted file mode 100644 index 1c3f854391..0000000000 --- a/test/deleteUsers/data/engage/handler_output.json +++ /dev/null @@ -1,39 +0,0 @@ -[ - [ - { - "statusCode": 400, - "error": "User deletion request failed" - } - ], - [ - { - "statusCode": 400, - "error": "User deletion request failed" - } - ], - [ - { - "statusCode": 400, - "error": "User deletion request failed" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ], - - [ - { - "statusCode": 400, - "error": "Public key is a required field for user deletion" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ] -] diff --git a/test/deleteUsers/data/engage/nw_client_data.json b/test/deleteUsers/data/engage/nw_client_data.json deleted file mode 100644 index 833b440766..0000000000 --- a/test/deleteUsers/data/engage/nw_client_data.json +++ /dev/null @@ -1,197 +0,0 @@ -[ - [ - { - "type": "delete", - "reqParams": [ - "https://api.engage.so/v1/users/1", - {}, - { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZDplZmdo" - } - ], - "response": { - "code": 400, - "statusText": "fail", - "response": { - "data": { - "code": 400, - "message": "Bad Req", - "status": "Fail first" - }, - "status": 400 - } - } - }, - { - "type": "delete", - "reqParams": [ - "https://api.engage.so/v1/users/2", - {}, - { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZDplZmdo" - } - ], - "response": { - "status": 200, - "statusText": "success" - } - }, - { - "type": "delete", - "reqParams": [ - "https://api.engage.so/v1/users/3", - {}, - { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZDplZmdo" - } - ], - "response": { - "status": 200, - "statusText": "success" - } - } - ], - [ - { - "type": "delete", - "reqParams": [ - "https://api.engage.so/v1/users/4", - {}, - { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZDplZmdo" - } - ], - "response": { - "status": 200, - "statusText": "success" - } - }, - { - "type": "delete", - "reqParams": [ - "https://api.engage.so/v1/users/5", - {}, - { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZDplZmdo" - } - ], - "response": { - "status": 200, - "statusText": "success" - } - }, - { - "type": "delete", - "reqParams": [ - "https://api.engage.so/v1/users/6", - { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZDplZmdo" - } - ], - "response": { - "code": 400, - "statusText": "fail", - "response": { - "data": { - "code": 400, - "message": "Bad Req", - "status": "fail 6 " - }, - "status": 400 - } - } - } - ], - [ - { - "type": "delete", - "reqParams": [ - "https://api.engage.so/v1/users/7", - { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZDplZmdo" - } - ], - "response": { - "status": 200, - "statusText": "success" - } - }, - { - "type": "delete", - "reqParams": [ - "https://api.engage.so/v1/users/8", - { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZDplZmdo" - } - ], - "response": { - "code": 400, - "statusText": "fail", - "response": { - "data": { - "code": 400, - "message": "Bad Req", - "status": "fail mid case 8" - }, - "status": 400 - } - } - }, - { - "type": "delete", - "reqParams": [ - "https://api.engage.so/v1/users/9", - { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZDplZmdo" - } - ], - "response": { - "status": 200, - "statusText": "success" - } - } - ], - [ - { - "type": "delete", - "reqParams": [ - "https://api.engage.so/v1/users/1", - {}, - { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZDplZmdo" - } - ], - "response": { - "status": 200, - "statusText": "success" - } - } - ], - [ - { - "type": "delete", - "reqParams": [ - "https://api.engage.so/v1/users/user_sdk2", - {}, - { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZDplZmdo" - } - ], - "response": { - "status": 200, - "statusText": "success" - } - } - ] -] diff --git a/test/deleteUsers/data/ga/handler_input.json b/test/deleteUsers/data/ga/handler_input.json deleted file mode 100644 index 7470e3cc29..0000000000 --- a/test/deleteUsers/data/ga/handler_input.json +++ /dev/null @@ -1,83 +0,0 @@ -[ - { - "getValue": { - "x-rudder-dest-info": "{\"secret\": { \"access_token\": \"valid_token\" }}" - }, - "request": { - "body": [ - { - "destType": "GA", - "userAttributes": [ - { - "userId": "test_user_1" - }, - { - "userId": "test_user_2" - } - ], - "config": { - "trackingID": "UA-123456789-5", - "useNativeSDK": false - } - } - ] - } - }, - { - "getValue": { - "x-rudder-dest-info": "{\"secret\": { \"access_token\": \"expired_token\" }}" - }, - "request": { - "body": [ - { - "destType": "GA", - "userAttributes": [ - { - "userId": "test_user_3" - }, - { - "userId": "test_user_4" - } - ], - "config": { - "trackingID": "UA-123456789-6", - "useNativeSDK": false - } - } - ] - } - }, - { - "getValue": { - "x-rudder-dest-info": "{\"secret\": { \"access_token\": \"valid_token_1\" }}" - }, - "request": { - "body": [ - { - "destType": "GA", - "userAttributes": [ - { - "userId": "test_user_5" - }, - { - "userId": "test_user_6" - }, - { - "userId": "test_user_7" - }, - { - "userId": "test_user_8" - }, - { - "userId": "test_user_9" - } - ], - "config": { - "trackingID": "UA-123456789-7", - "useNativeSDK": false - } - } - ] - } - } -] diff --git a/test/deleteUsers/data/ga/handler_output.json b/test/deleteUsers/data/ga/handler_output.json deleted file mode 100644 index db31670781..0000000000 --- a/test/deleteUsers/data/ga/handler_output.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - [ - { - "statusCode": 200, - "status": "successful" - } - ], - [ - { - "statusCode": 500, - "authErrorCategory": "REFRESH_TOKEN", - "error": "invalid credentials" - } - ], - [ - { - "statusCode": 403, - "error": "Error occurred while completing deletion request: [dummy response] The parameter used to query is not correct" - } - ] -] diff --git a/test/deleteUsers/data/ga/nw_client_data.json b/test/deleteUsers/data/ga/nw_client_data.json deleted file mode 100644 index 7cbeaf726c..0000000000 --- a/test/deleteUsers/data/ga/nw_client_data.json +++ /dev/null @@ -1,316 +0,0 @@ -[ - [ - { - "type": "post", - "reqParams": [ - "https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert", - { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_1" - }, - "webPropertyId": "UA-123456789-5" - }, - { - "headers": { - "Authorization": "Bearer valid_token", - "Accept": "application/json", - "Content-Type": "application/json" - } - } - ], - "response": { - "data": { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_1" - }, - "webPropertyId": "UA-123456789-5", - "deletionRequestTime": "2022-11-04T10:39:57.933Z" - }, - "status": 200, - "statusText": "OK" - } - }, - { - "type": "post", - "reqParams": [ - "https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert", - { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_1" - }, - "webPropertyId": "UA-123456789-5" - }, - { - "headers": { - "Authorization": "Bearer valid_token", - "Accept": "application/json", - "Content-Type": "application/json" - } - } - ], - "response": { - "data": { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_2" - }, - "webPropertyId": "UA-123456789-5", - "deletionRequestTime": "2022-11-04T10:39:57.933Z" - }, - "status": 200, - "statusText": "OK" - } - } - ], - [ - { - "type": "post", - "reqParams": [ - "https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert", - { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_3" - }, - "webPropertyId": "UA-123456789-6" - }, - { - "headers": { - "Authorization": "Bearer expired_token", - "Accept": "application/json", - "Content-Type": "application/json" - } - } - ], - "response": { - "data": { - "error": { - "code": 401, - "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", - "status": "UNAUTHENTICATED" - } - }, - "status": 200, - "statusText": "OK" - } - }, - { - "type": "post", - "reqParams": [ - "https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert", - { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_4" - }, - "webPropertyId": "UA-123456789-6" - }, - { - "headers": { - "Authorization": "Bearer expired_token", - "Accept": "application/json", - "Content-Type": "application/json" - } - } - ], - "response": { - "data": { - "error": { - "code": 401, - "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", - "status": "UNAUTHENTICATED" - } - }, - "status": 200, - "statusText": "OK" - } - } - ], - [ - { - "type": "post", - "reqParams": [ - "https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert", - { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_5" - }, - "webPropertyId": "UA-123456789-7" - }, - { - "headers": { - "Authorization": "Bearer valid_token_1", - "Accept": "application/json", - "Content-Type": "application/json" - } - } - ], - "response": { - "data": { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_5" - }, - "webPropertyId": "UA-123456789-7", - "deletionRequestTime": "2022-11-04T10:39:57.933Z" - }, - "status": 200, - "statusText": "OK" - } - }, - { - "type": "post", - "reqParams": [ - "https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert", - { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_6" - }, - "webPropertyId": "UA-123456789-7" - }, - { - "headers": { - "Authorization": "Bearer valid_token_1", - "Accept": "application/json", - "Content-Type": "application/json" - } - } - ], - "response": { - "data": { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_6" - }, - "webPropertyId": "UA-123456789-7", - "deletionRequestTime": "2022-11-04T10:39:57.933Z" - }, - "status": 200, - "statusText": "OK" - } - }, - { - "type": "post", - "reqParams": [ - "https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert", - { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_7" - }, - "webPropertyId": "UA-123456789-7" - }, - { - "headers": { - "Authorization": "Bearer valid_token_1", - "Accept": "application/json", - "Content-Type": "application/json" - } - } - ], - "response": { - "response": { - "data": { - "error": { - "errors": [ - { - "domain": "global", - "reason": "invalidParameter", - "message": "[dummy response] The parameter used to query is not correct" - } - ], - "code": 403, - "message": "[dummy response] The parameter used to query is not correct" - } - }, - "status": 403, - "statusText": "Bad Request" - } - } - }, - { - "type": "post", - "reqParams": [ - "https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert", - { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_8" - }, - "webPropertyId": "UA-123456789-7" - }, - { - "headers": { - "Authorization": "Bearer valid_token_1", - "Accept": "application/json", - "Content-Type": "application/json" - } - } - ], - "response": { - "data": { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_8" - }, - "webPropertyId": "UA-123456789-7", - "deletionRequestTime": "2022-11-04T10:39:57.933Z" - }, - "status": 200, - "statusText": "OK" - } - }, - { - "type": "post", - "reqParams": [ - "https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert", - { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_9" - }, - "webPropertyId": "UA-123456789-7" - }, - { - "headers": { - "Authorization": "Bearer valid_token_1", - "Accept": "application/json", - "Content-Type": "application/json" - } - } - ], - "response": { - "data": { - "kind": "analytics#userDeletionRequest", - "id": { - "type": "USER_ID", - "userId": "test_user_9" - }, - "webPropertyId": "UA-123456789-7", - "deletionRequestTime": "2022-11-04T10:39:57.933Z" - }, - "status": 200, - "statusText": "OK" - } - } - ] -] diff --git a/test/deleteUsers/data/intercom/handler_input.json b/test/deleteUsers/data/intercom/handler_input.json deleted file mode 100644 index d843db83bc..0000000000 --- a/test/deleteUsers/data/intercom/handler_input.json +++ /dev/null @@ -1,90 +0,0 @@ -[ - { - "request": { - "body": [ - { - "destType": "INTERCOM", - "userAttributes": [ - { - "userId": "1" - }, - { - "userId": "12" - } - ], - "config": { - "apiKey": "API_KEY" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "INTERCOM", - "userAttributes": [ - { - "userId": "7" - }, - { - "userId": "9" - } - ], - "config": { - "apiKey": "API_KEY" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "INTERCOM", - "userAttributes": [ - { - "userId": "6188c2c5f47e464b4abf3235" - }, - { - "userId": "user_sdk2" - } - ] - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "INTERCOM", - "userAttributes": [ - { - "userId": "6188c2c5f47e464b4abf3235" - }, - { - "userId": "user_sdk2" - } - ], - "config": {} - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "INTERCOM", - "userAttributes": [{}], - "config": { - "apiKey": "a=" - } - } - ] - } - } -] diff --git a/test/deleteUsers/data/intercom/handler_output.json b/test/deleteUsers/data/intercom/handler_output.json deleted file mode 100644 index 156c6ec114..0000000000 --- a/test/deleteUsers/data/intercom/handler_output.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - [ - { - "statusCode": 400, - "error": "User deletion request failed" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ], - [ - { - "statusCode": 400, - "error": "Config for deletion not present" - } - ], - [ - { - "statusCode": 400, - "error": "api key for deletion not present" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ] -] diff --git a/test/deleteUsers/data/intercom/nw_client_data.json b/test/deleteUsers/data/intercom/nw_client_data.json deleted file mode 100644 index 462a68cbfd..0000000000 --- a/test/deleteUsers/data/intercom/nw_client_data.json +++ /dev/null @@ -1,96 +0,0 @@ -[ - [ - { - "type": "post", - "reqParams": [ - "https://api.intercom.io/users/1", - { - "intercom_user_id": 1 - }, - { - "Accept": "application/json", - "Authorization": "Bearer API_KEY" - } - ], - "response": { - "code": 401, - "statusText": "Unauthorized", - "response": { - "data": { - "type": "error.list", - "request_id": "0022e6v5qc7m04jeu5pg", - "errors": [ - { - "code": "unauthorized", - "message": "Access Token Invalid" - } - ] - }, - "status": 400 - } - } - }, - { - "type": "post", - "reqParams": [ - "https://api.intercom.io/user_delete_requests", - { - "intercom_user_id": 12 - }, - { - "Accept": "application/json", - "Authorization": "Bearer API_KEY" - } - ], - "response": { - "status": 200, - "statusText": "ok", - "data": { - "id": 12 - } - } - } - ], - [ - { - "type": "post", - "reqParams": [ - "https://api.intercom.io/user_delete_requests", - { - "intercom_user_id": 7 - }, - { - "Accept": "application/json", - "Authorization": "Bearer API_KEY" - } - ], - "response": { - "status": 200, - "statusText": "ok", - "data": { - "id": 7 - } - } - }, - { - "type": "post", - "reqParams": [ - "https://api.intercom.io/user_delete_requests", - { - "intercom_user_id": 9 - }, - { - "Accept": "application/json", - "Authorization": "Bearer API_KEY" - } - ], - "response": { - "status": 200, - "statusText": "ok", - "data": { - "id": 9 - } - } - } - ] -] diff --git a/test/deleteUsers/data/mp/handler_input.json b/test/deleteUsers/data/mp/handler_input.json deleted file mode 100644 index 17bf5818c2..0000000000 --- a/test/deleteUsers/data/mp/handler_input.json +++ /dev/null @@ -1,3155 +0,0 @@ -[ - { - "request": { - "body": [ - { - "destType": "MP", - "userAttributes": [ - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - } - ], - "config": { - "token": "testToken", - "prefixProperties": true, - "useNativeSDK": false - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "MP", - "userAttributes": [ - { - "userId": "rudder1" - }, - { - "userId": "rudder1" - } - ], - "config": { - "token": "testToken", - "prefixProperties": true, - "useNativeSDK": false - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "MP", - "userAttributes": [ - { - "userId": "test_user_id" - }, - { - "userId": "user_sdk2" - } - ], - "config": { - "apiKey": "dummyApiKey", - "prefixProperties": true, - "useNativeSDK": false - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "MP", - "userAttributes": [ - { - "name": "test1" - } - ], - "config": { - "token": "testToken", - "prefixProperties": true, - "useNativeSDK": false - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "MP", - "userAttributes": [ - { - "userId": "rudder1" - }, - { - "userId": "rudder2" - }, - { - "userId": "rudder3" - } - ], - "config": { - "token": "test_token", - "prefixProperties": true, - "useNativeSDK": false, - "userDeletionApi": "task", - "gdprApiToken": "test_gdpr_token" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "MP", - "userAttributes": [ - { - "userId": "rudder1" - } - ], - "config": { - "token": "test_token", - "prefixProperties": true, - "useNativeSDK": false, - "userDeletionApi": "task", - "dataResidency": "eu" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "MP", - "userAttributes": [ - { - "userId": "rudder1" - } - ], - "config": { - "token": "test_token", - "prefixProperties": true, - "useNativeSDK": false, - "dataResidency": "eu" - } - } - ] - } - } -] diff --git a/test/deleteUsers/data/mp/handler_output.json b/test/deleteUsers/data/mp/handler_output.json deleted file mode 100644 index ddf8387375..0000000000 --- a/test/deleteUsers/data/mp/handler_output.json +++ /dev/null @@ -1,44 +0,0 @@ -[ - [ - { - "statusCode": 400, - "error": "User deletion request failed for `delete profile` api" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ], - [ - { - "statusCode": 400, - "error": "API Token is a required field for user deletion" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ], - [ - { - "statusCode": 400, - "error": "GDPR API Token is a required field for creating deletion task in mixpanel" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ] -] diff --git a/test/deleteUsers/data/mp/nw_client_data.json b/test/deleteUsers/data/mp/nw_client_data.json deleted file mode 100644 index 7a045d9065..0000000000 --- a/test/deleteUsers/data/mp/nw_client_data.json +++ /dev/null @@ -1,6159 +0,0 @@ -[ - [ - { - "type": "post", - "reqParams": [ - "https://api.mixpanel.com/engage", - [ - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - } - ], - { - "Content-Type": "application/json", - "Accept": "text/plain" - } - ], - "response": { - "code": 400, - "statusText": "fail", - "response": { - "data": { - "code": 400, - "message": "Bad Req", - "status": "Fail Case" - }, - "status": 400 - } - } - }, - { - "type": "post", - "reqParams": [ - "https://api.mixpanel.com/engage", - [ - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - } - ], - { - "Content-Type": "application/json", - "Accept": "text/plain" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": "1" - } - } - } - ], - { - "type": "post", - "reqParams": [ - "https://api.mixpanel.com/engage", - [ - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - }, - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - } - ], - { - "Content-Type": "application/json", - "Accept": "text/plain" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": "1" - } - } - }, - [ - { - "type": "post", - "reqParams": [ - "https://mixpanel.com/api/app/data-deletions/v3.0/?token=test_token", - { - "distinct_ids": ["rudder1", "rudder3"], - "compliance_type": "CCPA" - }, - { - "Content-Type": "application/json", - "Authorization": "Bearer test_gdpr_token" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": "1" - } - } - }, - { - "type": "post", - "reqParams": [ - "https://mixpanel.com/api/app/data-deletions/v3.0/?token=test_token", - { - "distinct_ids": ["rudder2"], - "compliance_type": "GDPR" - }, - { - "Content-Type": "application/json", - "Authorization": "Bearer test_gdpr_token" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": "1" - } - } - } - ], - { - "type": "post", - "reqParams": [ - "https://api-eu.mixpanel.com/engage", - [ - { - "$distinct_id": "rudder1", - "$token": "dummyAccessToken", - "$delete": null, - "$ignore_alias": true - } - ], - { - "Content-Type": "application/json", - "Accept": "text/plain" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": "1" - } - } - } -] diff --git a/test/deleteUsers/data/sendgrid/handler_input.json b/test/deleteUsers/data/sendgrid/handler_input.json deleted file mode 100644 index 253657dbde..0000000000 --- a/test/deleteUsers/data/sendgrid/handler_input.json +++ /dev/null @@ -1,921 +0,0 @@ -[ - { - "request": { - "body": [ - { - "destType": "SENDGRID", - "userAttributes": [ - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - } - ], - "config": { - "apiKey": "1234" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "SENDGRID", - "userAttributes": [ - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - }, - { - "userId": "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" - }, - { - "userId": "user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2" - } - ], - "config": { - "apiKey": "1234" - } - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "SENDGRID", - "userAttributes": [ - { - "userId": "eab57ccf-6322-498e-9338-7761c6dc0656" - }, - { - "userId": "47983ca9-7cc6-4942-8ff0-ac443g95658d" - } - ], - "config": {} - } - ] - } - }, - { - "request": { - "body": [ - { - "destType": "SENDGRID", - "userAttributes": { - "userId": "eab57ccf-6322-498e-9338-7761c6dc0656" - }, - "config": { - "apiKey": "1234" - } - } - ] - } - } -] diff --git a/test/deleteUsers/data/sendgrid/handler_output.json b/test/deleteUsers/data/sendgrid/handler_output.json deleted file mode 100644 index 201821f50a..0000000000 --- a/test/deleteUsers/data/sendgrid/handler_output.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - [ - { - "statusCode": 400, - "error": "User deletion request failed" - } - ], - [ - { - "statusCode": 200, - "status": "successful" - } - ], - [ - { - "statusCode": 400, - "error": "apiKey is required for deleting user" - } - ], - [ - { - "statusCode": 400, - "error": "userAttributes is not an array" - } - ] -] diff --git a/test/deleteUsers/data/sendgrid/nw_client_data.json b/test/deleteUsers/data/sendgrid/nw_client_data.json deleted file mode 100644 index e6bc96bb7f..0000000000 --- a/test/deleteUsers/data/sendgrid/nw_client_data.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - [ - { - "type": "delete", - "reqParams": [ - "https://api.sendgrid.com/v3/marketing/contacts?ids=[batch1]", - { - "Authorization": "Bearer 1234" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - "message": { - "job_id": "bb33b1f9-e7d6-4a6c-bf1c-a2143275e257" - } - } - } - }, - { - "type": "delete", - "reqParams": [ - "https://api.sendgrid.com/v3/marketing/contacts?ids=[batch2]", - { - "Authorization": "Bearer 1234" - } - ], - "response": { - "code": 400, - "statusText": "fail", - "response": { - "data": { - "code": 400, - "message": "Bad Req", - "status": "Fail Case" - }, - "status": 400 - } - } - }, - { - "type": "delete", - "reqParams": [ - "https://api.sendgrid.com/v3/marketing/contacts?ids=[batch3]", - { - "Authorization": "Bearer 1234" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": { - "job_id": "bb33b1f9-e7d6-4a6c-bf1c-a2143275e257" - } - } - } - } - ], - [ - { - "type": "delete", - "reqParams": [ - "https://api.sendgrid.com/v3/marketing/contacts?ids=[batch1]", - { - "Authorization": "Bearer 1234" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - "message": { - "job_id": "bb33b1f9-e7d6-4a6c-bf1c-a2143275e257" - } - } - } - }, - { - "type": "delete", - "reqParams": [ - "https://api.sendgrid.com/v3/marketing/contacts?ids=[batch2]", - { - "Authorization": "Bearer 1234" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": { - "job_id": "bb33b1f9-e7d6-4a6c-bf1c-a2143275e257" - } - } - } - }, - { - "type": "delete", - "reqParams": [ - "https://api.sendgrid.com/v3/marketing/contacts?ids=[batch3]", - { - "Authorization": "Bearer 1234" - } - ], - "response": { - "status": 200, - "statusText": "OK", - "data": { - " message": { - "job_id": "bb33b1f9-e7d6-4a6c-bf1c-a2143275e257" - } - } - } - } - ] -] diff --git a/test/deleteUsers/deleteUsers.test.ts b/test/deleteUsers/deleteUsers.test.ts deleted file mode 100644 index 18cebc7085..0000000000 --- a/test/deleteUsers/deleteUsers.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -const name = 'DeleteUsers'; -import logger from '../../src/logger'; -import { formAxiosMock, validateMockAxiosClientReqParams } from '../__mocks__/gen-axios.mock'; -const deleteUserDestinations = [ - 'am', - 'braze', - 'intercom', - 'mp', - 'af', - 'clevertap', - 'engage', - 'ga', - 'sendgrid', -]; -// Note: Useful for troubleshooting not to be used in production -const exclusionDestList: string[] = []; -import RegulationController from '../../src/controllers/regulation'; - -// delete user tests -deleteUserDestinations - .filter((d) => !exclusionDestList.includes(d)) - .forEach((destination) => { - const inputData = require(`./data/${destination}/handler_input.json`); - const expectedData = require(`./data/${destination}/handler_output.json`); - - let axiosResponses; - describe(`${name} Tests: ${destination}`, () => { - jest.unmock('axios'); - beforeAll(() => { - try { - axiosResponses = require(`./data/${destination}/nw_client_data.json`); - } catch (error) { - // Do nothing - logger.error(`Error while reading /${destination}/nw_client_data.json: ${error}`); - } - if (Array.isArray(axiosResponses)) { - formAxiosMock(axiosResponses); - } else { - // backward compatibility - jest.mock('axios'); - } - }); - - inputData.forEach((input, index) => { - it(`Payload - ${index}`, async () => { - try { - input.get = jest.fn((destInfoKey) => { - return input.getValue && input.getValue[destInfoKey]; - }); - - const output = await RegulationController.deleteUsers(input); - // validate the axios arguments - if (Array.isArray(axiosResponses) && Array.isArray(axiosResponses[index])) { - axiosResponses[index].forEach((axsRsp) => { - validateMockAxiosClientReqParams({ - resp: axsRsp, - }); - }); - } - expect(output.body).toEqual(expectedData[index]); - } catch (error: any) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); - }); diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 374649dfad..5e011e4115 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -1,21 +1,51 @@ import { join } from 'path'; import Koa from 'koa'; import request from 'supertest'; +// Mocking of axios calls +import axios from 'axios'; +// new-library we are using import bodyParser from 'koa-bodyparser'; import { Command } from 'commander'; import { createHttpTerminator } from 'http-terminator'; -import { TestCaseData } from './testTypes'; +import { MockHttpCallsData, TestCaseData } from './testTypes'; import { applicationRoutes } from '../../src/routes/index'; -import { getTestDataFilePaths, getTestData } from './testUtils'; -import tags from '../../src/v0/util/tags'; +import MockAxiosAdapter from 'axios-mock-adapter'; +import { + getTestDataFilePaths, + getTestData, + getMockHttpCallsData, + getAllTestMockDataFilePaths, + addMock, +} from './testUtils'; +import tags, { FEATURES } from '../../src/v0/util/tags'; import { Server } from 'http'; +import { appendFileSync } from 'fs'; +import { responses } from '../testHelper'; +import utils from '../../src/v0/util'; +import isMatch from 'lodash/isMatch'; // To run single destination test cases // npm run test:ts -- component --destination=adobe_analytics + +// Use below command to generate mocks +// npm run test:ts -- component --destination=zendesk --generate=true +// npm run test:ts:component:generateNwMocks -- --destination=zendesk const command = new Command(); command.allowUnknownOption().option('-d, --destination ', 'Enter Destination Name').parse(); +// This option will only work when destination option is also provided +command + .allowUnknownOption() + .option('-g, --generate ', 'Enter "true" If you want to generate network file') + .parse(); const opts = command.opts(); +if (opts.generate === 'true' && !opts.destination) { + throw new Error('Invalid option, generate should be true for a destination'); +} + +if (opts.generate === 'true') { + process.env.GEN_AXIOS_FOR_TESTS = 'true'; +} let server: Server; @@ -31,9 +61,38 @@ beforeAll(async () => { }); afterAll(async () => { + if (opts.generate === 'true') { + const callsDataStr = responses.join('\n'); + const calls = ` + export const networkCallsData = [ + ${callsDataStr} + ] + `; + appendFileSync(join(__dirname, 'destinations', opts.destination, 'network.ts'), calls); + } await createHttpTerminator({ server }).terminate(); }); +let mock; +if (!opts.generate || opts.generate === 'false') { + // unmock already existing axios-mocking + mock = new MockAxiosAdapter(axios, { onNoMatch: 'passthrough' }); + const registerAxiosMocks = (axiosMocks: MockHttpCallsData[]) => { + axiosMocks.forEach((axiosMock) => addMock(mock, axiosMock)); + }; + // // all the axios requests will be stored in this map + const allTestMockDataFilePaths = getAllTestMockDataFilePaths(__dirname, opts.destination); + const allAxiosRequests = allTestMockDataFilePaths + .filter((d) => !d.includes('/af/')) + .map((currPath) => { + const mockNetworkCallsData: MockHttpCallsData[] = getMockHttpCallsData(currPath); + return mockNetworkCallsData; + }) + .flat(); + registerAxiosMocks(allAxiosRequests); +} + +// END const rootDir = __dirname; const allTestDataFilePaths = getTestDataFilePaths(rootDir, opts.destination); const DEFAULT_VERSION = 'v0'; @@ -65,7 +124,7 @@ const testRoute = async (route, tcData: TestCaseData) => { const outputResp = tcData.output.response || ({} as any); expect(response.status).toEqual(outputResp.status); - if (outputResp && outputResp.body) { + if (outputResp?.body) { expect(response.body).toEqual(outputResp.body); } @@ -87,7 +146,7 @@ const destinationTestHandler = async (tcData: TestCaseData) => { route = `/${join(tcData.version || DEFAULT_VERSION, 'destinations', tcData.name, 'proxy')}`; break; case tags.FEATURES.USER_DELETION: - route = 'deleteUsers'; + route = '/deleteUsers'; break; case tags.FEATURES.PROCESSOR: // Processor transformation @@ -114,8 +173,14 @@ const sourceTestHandler = async (tcData) => { // Trigger the test suites describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { + beforeEach(() => { + jest.clearAllMocks(); + }); + // add special mocks for specific destinations const testData: TestCaseData[] = getTestData(testDataPath); test.each(testData)('$name - $module - $feature -> $description', async (tcData) => { + tcData?.mockFns?.(mock); + switch (tcData.module) { case tags.MODULES.DESTINATION: await destinationTestHandler(tcData); diff --git a/test/integrations/destinations/active_campaign/network.ts b/test/integrations/destinations/active_campaign/network.ts new file mode 100644 index 0000000000..34834096b1 --- /dev/null +++ b/test/integrations/destinations/active_campaign/network.ts @@ -0,0 +1,1966 @@ +export const networkCallsData = [ + { + httpReq: { + data: { + contact: { + email: 'jamesDoe@gmail.com', + firstName: 'James', + lastName: 'Doe', + phone: '92374162212', + }, + }, + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contact/sync', + }, + httpRes: { + data: { + contact: { + cdate: '2018-09-28T13:50:41-05:00', + email: 'jamesDoe@gmail.com', + id: '2', + links: { + bounceLogs: 'https://:account.api-us1.com/api/:version/contacts/113/bounceLogs', + contactAutomations: + 'https://:account.api-us1.com/api/:version/contacts/113/contactAutomations', + contactData: 'https://:account.api-us1.com/api/:version/contacts/113/contactData', + contactDeals: 'https://:account.api-us1.com/api/:version/contacts/113/contactDeals', + contactGoals: 'https://:account.api-us1.com/api/:version/contacts/113/contactGoals', + contactLists: 'https://:account.api-us1.com/api/:version/contacts/113/contactLists', + contactLogs: 'https://:account.api-us1.com/api/:version/contacts/113/contactLogs', + contactTags: 'https://:account.api-us1.com/api/:version/contacts/113/contactTags', + deals: 'https://:account.api-us1.com/api/:version/contacts/113/deals', + fieldValues: 'https://:account.api-us1.com/api/:version/contacts/113/fieldValues', + geoIps: 'https://:account.api-us1.com/api/:version/contacts/113/geoIps', + notes: 'https://:account.api-us1.com/api/:version/contacts/113/notes', + organization: 'https://:account.api-us1.com/api/:version/contacts/113/organization', + plusAppend: 'https://:account.api-us1.com/api/:version/contacts/113/plusAppend', + scoreValues: 'https://:account.api-us1.com/api/:version/contacts/113/scoreValues', + trackingLogs: 'https://:account.api-us1.com/api/:version/contacts/113/trackingLogs', + }, + organization: '', + orgid: '', + udate: '2018-09-28T13:50:41-05:00', + }, + fieldValues: [ + { + cdate: '2020-08-01T10:54:59-05:00', + contact: '113', + field: '1', + id: '11797', + links: { + field: 'https://:account.api-us1.com/api/3/fieldValues/11797/field', + owner: 'https://:account.api-us1.com/api/3/fieldValues/11797/owner', + }, + owner: '113', + udate: '2020-08-01T14:13:34-05:00', + value: 'The Value for First Field', + }, + { + cdate: '2020-08-01T10:54:59-05:00', + contact: '113', + field: '6', + id: '11798', + links: { + field: 'https://:account.api-us1.com/api/3/fieldValues/11798/field', + owner: 'https://:account.api-us1.com/api/3/fieldValues/11798/owner', + }, + owner: '113', + udate: '2020-08-01T14:13:34-05:00', + value: '2008-01-20', + }, + ], + }, + status: 201, + }, + }, + { + httpReq: { + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://active.campaigns.rudder.com/api/3/tags?limit=100', + }, + httpRes: { + data: { + meta: { total: '5' }, + tag: { + cdate: '2018-09-29T19:21:25-05:00', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/16/contactGoalTags', + }, + }, + tags: [ + { + cdate: '2018-08-17T09:43:15-05:00', + description: '', + id: '1', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/1/contactGoalTags', + }, + tag: 'one', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:16-05:00', + description: '', + id: '2', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/2/contactGoalTags', + }, + tag: 'two', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:18-05:00', + description: '', + id: '3', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/3/contactGoalTags', + }, + tag: 'three', + tagType: 'contact', + }, + { + cdate: '2018-08-28T11:54:36-05:00', + description: '', + id: '4', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/4/contactGoalTags', + }, + tag: 'test1', + tagType: 'template', + }, + { + cdate: '2018-08-28T11:54:38-05:00', + description: '', + id: '5', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/5/contactGoalTags', + }, + tag: 'DIY_Hobby', + tagType: 'template', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + data: { tag: { description: '', tag: 'Test_User', tagType: 'contact' } }, + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/tags', + }, + httpRes: { + data: { + meta: { total: '5' }, + tag: { + cdate: '2018-09-29T19:21:25-05:00', + description: '', + id: 1, + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/16/contactGoalTags', + }, + tag: 'Test_User', + tagType: 'contact', + }, + tags: [ + { + cdate: '2018-08-17T09:43:15-05:00', + description: '', + id: '1', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/1/contactGoalTags', + }, + tag: 'one', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:16-05:00', + description: '', + id: '2', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/2/contactGoalTags', + }, + tag: 'two', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:18-05:00', + description: '', + id: '3', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/3/contactGoalTags', + }, + tag: 'three', + tagType: 'contact', + }, + { + cdate: '2018-08-28T11:54:36-05:00', + description: '', + id: '4', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/4/contactGoalTags', + }, + tag: 'test1', + tagType: 'template', + }, + { + cdate: '2018-08-28T11:54:38-05:00', + description: '', + id: '5', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/5/contactGoalTags', + }, + tag: 'DIY_Hobby', + tagType: 'template', + }, + ], + }, + status: 201, + }, + }, + { + httpReq: { + data: { tag: { description: '', tag: 'Interested_User', tagType: 'contact' } }, + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/tags', + }, + httpRes: { + data: { + meta: { total: '5' }, + tag: { + cdate: '2018-09-29T19:21:25-05:00', + description: '', + id: 2, + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/16/contactGoalTags', + }, + tag: 'Interested_User', + tagType: 'contact', + }, + tags: [ + { + cdate: '2018-08-17T09:43:15-05:00', + description: '', + id: '1', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/1/contactGoalTags', + }, + tag: 'one', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:16-05:00', + description: '', + id: '2', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/2/contactGoalTags', + }, + tag: 'two', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:18-05:00', + description: '', + id: '3', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/3/contactGoalTags', + }, + tag: 'three', + tagType: 'contact', + }, + { + cdate: '2018-08-28T11:54:36-05:00', + description: '', + id: '4', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/4/contactGoalTags', + }, + tag: 'test1', + tagType: 'template', + }, + { + cdate: '2018-08-28T11:54:38-05:00', + description: '', + id: '5', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/5/contactGoalTags', + }, + tag: 'DIY_Hobby', + tagType: 'template', + }, + ], + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactTag: { contact: '2', tag: '5' } }, + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactTags', + }, + httpRes: { + data: { + contactTag: { + cdate: '2017-06-08T16:11:53-05:00', + contact: '2', + id: 3, + links: { contact: '/1/contact', tag: '/1/tag' }, + }, + tag: '5', + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactTag: { contact: '2', tag: 1 } }, + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactTags', + }, + httpRes: { + data: { + contactTag: { + cdate: '2017-06-08T16:11:53-05:00', + contact: '2', + id: 4, + links: { contact: '/1/contact', tag: '/1/tag' }, + }, + tag: 1, + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactTag: { contact: '2', tag: 2 } }, + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactTags', + }, + httpRes: { + data: { + contactTag: { + cdate: '2017-06-08T16:11:53-05:00', + contact: '2', + id: 5, + links: { contact: '/1/contact', tag: '/1/tag' }, + }, + tag: 2, + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactList: { contact: '2', list: 2, status: '1' } }, + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactLists', + }, + httpRes: { data: { contactList: { contact: '2', list: 2, status: '1' } }, status: 200 }, + }, + { + httpReq: { + data: { contactList: { contact: '2', list: 3, status: '2' } }, + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactLists', + }, + httpRes: { data: { contactList: { contact: '2', list: 3, status: '2' } }, status: 200 }, + }, + { + httpReq: { + headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': 'dummyApiToken' }, + + method: 'GET', + + url: 'https://active.campaigns.rudder.com/api/3/fields?limit=100', + }, + httpRes: { + data: { + fieldOptions: [], + fieldRels: [], + fields: [ + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Random description', + id: '4', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Random', + type: 'multivalue', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Likes description', + id: '3', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Likes', + type: 'multivalue', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:43:38-06:00', + cols: '0', + defval: null, + descript: null, + id: '2', + isrequired: '0', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/2/options', + relations: 'https://:account.api-us1.com/api/:version/fields/2/relations', + }, + options: [], + ordernum: '2', + perstag: 'ANOTHER_TEST_TITLE', + relations: [], + rows: '0', + service: '', + show_in_list: '0', + title: 'Another Test Title', + type: '', + udate: '2018-11-15T21:43:38-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Country description', + id: '1', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Country', + type: 'textarea', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Office description', + id: '0', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Office', + type: 'textarea', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + ], + meta: { total: '4' }, + }, + status: 200, + }, + }, + { + httpReq: { + data: { + contact: { + email: 'jamesDoe@gmail.com', + firstName: 'James', + lastName: 'Doe', + phone: '92374162212', + }, + }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contact/sync', + }, + httpRes: { + data: { + contact: { + cdate: '2018-09-28T13:50:41-05:00', + email: 'jamesDoe@gmail.com', + id: '2', + links: { + bounceLogs: 'https://:account.api-us1.com/api/:version/contacts/113/bounceLogs', + contactAutomations: + 'https://:account.api-us1.com/api/:version/contacts/113/contactAutomations', + contactData: 'https://:account.api-us1.com/api/:version/contacts/113/contactData', + contactDeals: 'https://:account.api-us1.com/api/:version/contacts/113/contactDeals', + contactGoals: 'https://:account.api-us1.com/api/:version/contacts/113/contactGoals', + contactLists: 'https://:account.api-us1.com/api/:version/contacts/113/contactLists', + contactLogs: 'https://:account.api-us1.com/api/:version/contacts/113/contactLogs', + contactTags: 'https://:account.api-us1.com/api/:version/contacts/113/contactTags', + deals: 'https://:account.api-us1.com/api/:version/contacts/113/deals', + fieldValues: 'https://:account.api-us1.com/api/:version/contacts/113/fieldValues', + geoIps: 'https://:account.api-us1.com/api/:version/contacts/113/geoIps', + notes: 'https://:account.api-us1.com/api/:version/contacts/113/notes', + organization: 'https://:account.api-us1.com/api/:version/contacts/113/organization', + plusAppend: 'https://:account.api-us1.com/api/:version/contacts/113/plusAppend', + scoreValues: 'https://:account.api-us1.com/api/:version/contacts/113/scoreValues', + trackingLogs: 'https://:account.api-us1.com/api/:version/contacts/113/trackingLogs', + }, + organization: '', + orgid: '', + udate: '2018-09-28T13:50:41-05:00', + }, + fieldValues: [ + { + cdate: '2020-08-01T10:54:59-05:00', + contact: '113', + field: '1', + id: '11797', + links: { + field: 'https://:account.api-us1.com/api/3/fieldValues/11797/field', + owner: 'https://:account.api-us1.com/api/3/fieldValues/11797/owner', + }, + owner: '113', + udate: '2020-08-01T14:13:34-05:00', + value: 'The Value for First Field', + }, + { + cdate: '2020-08-01T10:54:59-05:00', + contact: '113', + field: '6', + id: '11798', + links: { + field: 'https://:account.api-us1.com/api/3/fieldValues/11798/field', + owner: 'https://:account.api-us1.com/api/3/fieldValues/11798/owner', + }, + owner: '113', + udate: '2020-08-01T14:13:34-05:00', + value: '2008-01-20', + }, + ], + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactList: { contact: '2', list: 2, status: '1' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactLists', + }, + httpRes: { data: { contactList: { contact: '2', list: 2, status: '1' } }, status: 200 }, + }, + { + httpReq: { + data: { contactList: { contact: '2', list: 3, status: '2' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactLists', + }, + httpRes: { data: { contactList: { contact: '2', list: 3, status: '2' } }, status: 200 }, + }, + { + httpReq: { + headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': 'dummyApiKey' }, + + method: 'GET', + + url: 'https://active.campaigns.rudder.com/api/3/fields?limit=100', + }, + httpRes: { + data: { + fieldOptions: [], + fieldRels: [], + fields: [ + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Random description', + id: '4', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Random', + type: 'multivalue', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Likes description', + id: '3', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Likes', + type: 'multivalue', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:43:38-06:00', + cols: '0', + defval: null, + descript: null, + id: '2', + isrequired: '0', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/2/options', + relations: 'https://:account.api-us1.com/api/:version/fields/2/relations', + }, + options: [], + ordernum: '2', + perstag: 'ANOTHER_TEST_TITLE', + relations: [], + rows: '0', + service: '', + show_in_list: '0', + title: 'Another Test Title', + type: '', + udate: '2018-11-15T21:43:38-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Country description', + id: '1', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Country', + type: 'textarea', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Office description', + id: '0', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Office', + type: 'textarea', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + ], + meta: { total: '4' }, + }, + status: 200, + }, + }, + { + httpReq: { + data: { + contact: { + email: 'jamesDoe@gmail.com', + firstName: 'James', + lastName: 'Doe', + phone: '92374162212', + }, + }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contact/sync', + }, + httpRes: { + data: { + contact: { + cdate: '2018-09-28T13:50:41-05:00', + email: 'jamesDoe@gmail.com', + id: '2', + links: { + bounceLogs: 'https://:account.api-us1.com/api/:version/contacts/113/bounceLogs', + contactAutomations: + 'https://:account.api-us1.com/api/:version/contacts/113/contactAutomations', + contactData: 'https://:account.api-us1.com/api/:version/contacts/113/contactData', + contactDeals: 'https://:account.api-us1.com/api/:version/contacts/113/contactDeals', + contactGoals: 'https://:account.api-us1.com/api/:version/contacts/113/contactGoals', + contactLists: 'https://:account.api-us1.com/api/:version/contacts/113/contactLists', + contactLogs: 'https://:account.api-us1.com/api/:version/contacts/113/contactLogs', + contactTags: 'https://:account.api-us1.com/api/:version/contacts/113/contactTags', + deals: 'https://:account.api-us1.com/api/:version/contacts/113/deals', + fieldValues: 'https://:account.api-us1.com/api/:version/contacts/113/fieldValues', + geoIps: 'https://:account.api-us1.com/api/:version/contacts/113/geoIps', + notes: 'https://:account.api-us1.com/api/:version/contacts/113/notes', + organization: 'https://:account.api-us1.com/api/:version/contacts/113/organization', + plusAppend: 'https://:account.api-us1.com/api/:version/contacts/113/plusAppend', + scoreValues: 'https://:account.api-us1.com/api/:version/contacts/113/scoreValues', + trackingLogs: 'https://:account.api-us1.com/api/:version/contacts/113/trackingLogs', + }, + organization: '', + orgid: '', + udate: '2018-09-28T13:50:41-05:00', + }, + fieldValues: [ + { + cdate: '2020-08-01T10:54:59-05:00', + contact: '113', + field: '1', + id: '11797', + links: { + field: 'https://:account.api-us1.com/api/3/fieldValues/11797/field', + owner: 'https://:account.api-us1.com/api/3/fieldValues/11797/owner', + }, + owner: '113', + udate: '2020-08-01T14:13:34-05:00', + value: 'The Value for First Field', + }, + { + cdate: '2020-08-01T10:54:59-05:00', + contact: '113', + field: '6', + id: '11798', + links: { + field: 'https://:account.api-us1.com/api/3/fieldValues/11798/field', + owner: 'https://:account.api-us1.com/api/3/fieldValues/11798/owner', + }, + owner: '113', + udate: '2020-08-01T14:13:34-05:00', + value: '2008-01-20', + }, + ], + }, + status: 201, + }, + }, + { + httpReq: { + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://active.campaigns.rudder.com/api/3/tags?limit=100', + }, + httpRes: { + data: { + meta: { total: '5' }, + tag: { + cdate: '2018-09-29T19:21:25-05:00', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/16/contactGoalTags', + }, + }, + tags: [ + { + cdate: '2018-08-17T09:43:15-05:00', + description: '', + id: '1', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/1/contactGoalTags', + }, + tag: 'one', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:16-05:00', + description: '', + id: '2', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/2/contactGoalTags', + }, + tag: 'two', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:18-05:00', + description: '', + id: '3', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/3/contactGoalTags', + }, + tag: 'three', + tagType: 'contact', + }, + { + cdate: '2018-08-28T11:54:36-05:00', + description: '', + id: '4', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/4/contactGoalTags', + }, + tag: 'test1', + tagType: 'template', + }, + { + cdate: '2018-08-28T11:54:38-05:00', + description: '', + id: '5', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/5/contactGoalTags', + }, + tag: 'DIY_Hobby', + tagType: 'template', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + data: { tag: { description: '', tag: 'Test_User', tagType: 'contact' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/tags', + }, + httpRes: { + data: { + meta: { total: '5' }, + tag: { + cdate: '2018-09-29T19:21:25-05:00', + description: '', + id: 6, + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/16/contactGoalTags', + }, + tag: 'Test_User', + tagType: 'contact', + }, + tags: [ + { + cdate: '2018-08-17T09:43:15-05:00', + description: '', + id: '1', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/1/contactGoalTags', + }, + tag: 'one', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:16-05:00', + description: '', + id: '2', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/2/contactGoalTags', + }, + tag: 'two', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:18-05:00', + description: '', + id: '3', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/3/contactGoalTags', + }, + tag: 'three', + tagType: 'contact', + }, + { + cdate: '2018-08-28T11:54:36-05:00', + description: '', + id: '4', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/4/contactGoalTags', + }, + tag: 'test1', + tagType: 'template', + }, + { + cdate: '2018-08-28T11:54:38-05:00', + description: '', + id: '5', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/5/contactGoalTags', + }, + tag: 'DIY_Hobby', + tagType: 'template', + }, + ], + }, + status: 201, + }, + }, + { + httpReq: { + data: { tag: { description: '', tag: 'Interested_User', tagType: 'contact' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/tags', + }, + httpRes: { + data: { + meta: { total: '5' }, + tag: { + cdate: '2018-09-29T19:21:25-05:00', + description: '', + id: 7, + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/16/contactGoalTags', + }, + tag: 'Interested_User', + tagType: 'contact', + }, + tags: [ + { + cdate: '2018-08-17T09:43:15-05:00', + description: '', + id: '1', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/1/contactGoalTags', + }, + tag: 'one', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:16-05:00', + description: '', + id: '2', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/2/contactGoalTags', + }, + tag: 'two', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:18-05:00', + description: '', + id: '3', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/3/contactGoalTags', + }, + tag: 'three', + tagType: 'contact', + }, + { + cdate: '2018-08-28T11:54:36-05:00', + description: '', + id: '4', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/4/contactGoalTags', + }, + tag: 'test1', + tagType: 'template', + }, + { + cdate: '2018-08-28T11:54:38-05:00', + description: '', + id: '5', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/5/contactGoalTags', + }, + tag: 'DIY_Hobby', + tagType: 'template', + }, + ], + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactTag: { contact: '2', tag: '5' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactTags', + }, + httpRes: { + data: { + contactTag: { + cdate: '2017-06-08T16:11:53-05:00', + contact: '2', + id: 8, + links: { contact: '/1/contact', tag: '/1/tag' }, + }, + tag: '5', + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactTag: { contact: '2', tag: 6 } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactTags', + }, + httpRes: { + data: { + contactTag: { + cdate: '2017-06-08T16:11:53-05:00', + contact: '2', + id: 9, + links: { contact: '/1/contact', tag: '/1/tag' }, + }, + tag: 6, + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactTag: { contact: '2', tag: 7 } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactTags', + }, + httpRes: { + data: { + contactTag: { + cdate: '2017-06-08T16:11:53-05:00', + contact: '2', + id: 10, + links: { contact: '/1/contact', tag: '/1/tag' }, + }, + tag: 7, + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactList: { contact: '2', list: 2, status: '1' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactLists', + }, + httpRes: { data: { contactList: { contact: '2', list: 2, status: '1' } }, status: 200 }, + }, + { + httpReq: { + data: { contactList: { contact: '2', list: 3, status: '2' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactLists', + }, + httpRes: { data: { contactList: { contact: '2', list: 3, status: '2' } }, status: 200 }, + }, + { + httpReq: { + headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': 'dummyApiKey' }, + + method: 'GET', + + url: 'https://active.campaigns.rudder.com/api/3/fields?limit=100', + }, + httpRes: { + data: { + fieldOptions: [], + fieldRels: [], + fields: [ + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Random description', + id: '4', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Random', + type: 'multivalue', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Likes description', + id: '3', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Likes', + type: 'multivalue', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:43:38-06:00', + cols: '0', + defval: null, + descript: null, + id: '2', + isrequired: '0', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/2/options', + relations: 'https://:account.api-us1.com/api/:version/fields/2/relations', + }, + options: [], + ordernum: '2', + perstag: 'ANOTHER_TEST_TITLE', + relations: [], + rows: '0', + service: '', + show_in_list: '0', + title: 'Another Test Title', + type: '', + udate: '2018-11-15T21:43:38-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Country description', + id: '1', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Country', + type: 'textarea', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Office description', + id: '0', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Office', + type: 'textarea', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + ], + meta: { total: '4' }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + 'Api-Token': 'dummyApiKey', + + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://active.campaigns.rudder.com/api/3/eventTrackingEvents', + }, + httpRes: { + data: { + eventTrackingEvents: [{ name: '__pagevisit' }, { name: '__redir' }], + meta: { total: 2 }, + }, + status: 200, + }, + }, + { + httpReq: { + data: { eventTrackingEvent: { name: 'ScreenViewed' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/eventTrackingEvents', + }, + httpRes: { data: { eventTrackingEvent: { name: 'ScreenViewed' } }, status: 201 }, + }, + { + httpReq: { + headers: { 'Api-Token': 'dummyApiKey', Accept: 'application/json, text/plain, */*' }, + + method: 'GET', + + url: 'https://active.campaigns.rudder.com/api/3/eventTrackingEvents', + }, + httpRes: { + data: { + eventTrackingEvents: [{ name: '__pagevisit' }, { name: '__redir' }], + meta: { total: 2 }, + }, + status: 200, + }, + }, + { + httpReq: { + data: { eventTrackingEvent: { name: 'Tracking Action' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/eventTrackingEvents', + }, + httpRes: { data: { eventTrackingEvent: { name: 'Tracking Action' } }, status: 201 }, + }, + { + httpReq: { + data: { contact: { email: 'jamesDoe@gmail.com', phone: '92374162212' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contact/sync', + }, + httpRes: { + data: { + contact: { + cdate: '2018-09-28T13:50:41-05:00', + email: 'jamesDoe@gmail.com', + id: '2', + links: { + bounceLogs: 'https://:account.api-us1.com/api/:version/contacts/113/bounceLogs', + contactAutomations: + 'https://:account.api-us1.com/api/:version/contacts/113/contactAutomations', + contactData: 'https://:account.api-us1.com/api/:version/contacts/113/contactData', + contactDeals: 'https://:account.api-us1.com/api/:version/contacts/113/contactDeals', + contactGoals: 'https://:account.api-us1.com/api/:version/contacts/113/contactGoals', + contactLists: 'https://:account.api-us1.com/api/:version/contacts/113/contactLists', + contactLogs: 'https://:account.api-us1.com/api/:version/contacts/113/contactLogs', + contactTags: 'https://:account.api-us1.com/api/:version/contacts/113/contactTags', + deals: 'https://:account.api-us1.com/api/:version/contacts/113/deals', + fieldValues: 'https://:account.api-us1.com/api/:version/contacts/113/fieldValues', + geoIps: 'https://:account.api-us1.com/api/:version/contacts/113/geoIps', + notes: 'https://:account.api-us1.com/api/:version/contacts/113/notes', + organization: 'https://:account.api-us1.com/api/:version/contacts/113/organization', + plusAppend: 'https://:account.api-us1.com/api/:version/contacts/113/plusAppend', + scoreValues: 'https://:account.api-us1.com/api/:version/contacts/113/scoreValues', + trackingLogs: 'https://:account.api-us1.com/api/:version/contacts/113/trackingLogs', + }, + organization: '', + orgid: '', + udate: '2018-09-28T13:50:41-05:00', + }, + fieldValues: [ + { + cdate: '2020-08-01T10:54:59-05:00', + contact: '113', + field: '1', + id: '11797', + links: { + field: 'https://:account.api-us1.com/api/3/fieldValues/11797/field', + owner: 'https://:account.api-us1.com/api/3/fieldValues/11797/owner', + }, + owner: '113', + udate: '2020-08-01T14:13:34-05:00', + value: 'The Value for First Field', + }, + { + cdate: '2020-08-01T10:54:59-05:00', + contact: '113', + field: '6', + id: '11798', + links: { + field: 'https://:account.api-us1.com/api/3/fieldValues/11798/field', + owner: 'https://:account.api-us1.com/api/3/fieldValues/11798/owner', + }, + owner: '113', + udate: '2020-08-01T14:13:34-05:00', + value: '2008-01-20', + }, + ], + }, + status: 201, + }, + }, + { + httpReq: { + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://active.campaigns.rudder.com/api/3/tags?limit=100', + }, + httpRes: { + data: { + meta: { total: '5' }, + tag: { + cdate: '2018-09-29T19:21:25-05:00', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/16/contactGoalTags', + }, + }, + tags: [ + { + cdate: '2018-08-17T09:43:15-05:00', + description: '', + id: '1', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/1/contactGoalTags', + }, + tag: 'one', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:16-05:00', + description: '', + id: '2', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/2/contactGoalTags', + }, + tag: 'two', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:18-05:00', + description: '', + id: '3', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/3/contactGoalTags', + }, + tag: 'three', + tagType: 'contact', + }, + { + cdate: '2018-08-28T11:54:36-05:00', + description: '', + id: '4', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/4/contactGoalTags', + }, + tag: 'test1', + tagType: 'template', + }, + { + cdate: '2018-08-28T11:54:38-05:00', + description: '', + id: '5', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/5/contactGoalTags', + }, + tag: 'DIY_Hobby', + tagType: 'template', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + data: { tag: { description: '', tag: 'Test_User', tagType: 'contact' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/tags', + }, + httpRes: { + data: { + meta: { total: '5' }, + tag: { + cdate: '2018-09-29T19:21:25-05:00', + description: '', + id: 11, + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/16/contactGoalTags', + }, + tag: 'Test_User', + tagType: 'contact', + }, + tags: [ + { + cdate: '2018-08-17T09:43:15-05:00', + description: '', + id: '1', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/1/contactGoalTags', + }, + tag: 'one', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:16-05:00', + description: '', + id: '2', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/2/contactGoalTags', + }, + tag: 'two', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:18-05:00', + description: '', + id: '3', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/3/contactGoalTags', + }, + tag: 'three', + tagType: 'contact', + }, + { + cdate: '2018-08-28T11:54:36-05:00', + description: '', + id: '4', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/4/contactGoalTags', + }, + tag: 'test1', + tagType: 'template', + }, + { + cdate: '2018-08-28T11:54:38-05:00', + description: '', + id: '5', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/5/contactGoalTags', + }, + tag: 'DIY_Hobby', + tagType: 'template', + }, + ], + }, + status: 201, + }, + }, + { + httpReq: { + data: { tag: { description: '', tag: 'Interested_User', tagType: 'contact' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/tags', + }, + httpRes: { + data: { + meta: { total: '5' }, + tag: { + cdate: '2018-09-29T19:21:25-05:00', + description: '', + id: 12, + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/16/contactGoalTags', + }, + tag: 'Interested_User', + tagType: 'contact', + }, + tags: [ + { + cdate: '2018-08-17T09:43:15-05:00', + description: '', + id: '1', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/1/contactGoalTags', + }, + tag: 'one', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:16-05:00', + description: '', + id: '2', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/2/contactGoalTags', + }, + tag: 'two', + tagType: 'contact', + }, + { + cdate: '2018-08-17T13:41:18-05:00', + description: '', + id: '3', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/3/contactGoalTags', + }, + tag: 'three', + tagType: 'contact', + }, + { + cdate: '2018-08-28T11:54:36-05:00', + description: '', + id: '4', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/4/contactGoalTags', + }, + tag: 'test1', + tagType: 'template', + }, + { + cdate: '2018-08-28T11:54:38-05:00', + description: '', + id: '5', + links: { + contactGoalTags: 'https://:account.api-us1.com/api/:version/tags/5/contactGoalTags', + }, + tag: 'DIY_Hobby', + tagType: 'template', + }, + ], + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactTag: { contact: '2', tag: '5' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactTags', + }, + httpRes: { + data: { + contactTag: { + cdate: '2017-06-08T16:11:53-05:00', + contact: '2', + id: 13, + links: { contact: '/1/contact', tag: '/1/tag' }, + }, + tag: '5', + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactTag: { contact: '2', tag: 11 } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactTags', + }, + httpRes: { + data: { + contactTag: { + cdate: '2017-06-08T16:11:53-05:00', + contact: '2', + id: 14, + links: { contact: '/1/contact', tag: '/1/tag' }, + }, + tag: 11, + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactTag: { contact: '2', tag: 12 } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactTags', + }, + httpRes: { + data: { + contactTag: { + cdate: '2017-06-08T16:11:53-05:00', + contact: '2', + id: 15, + links: { contact: '/1/contact', tag: '/1/tag' }, + }, + tag: 12, + }, + status: 201, + }, + }, + { + httpReq: { + data: { contactList: { contact: '2', list: 2, status: '1' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactLists', + }, + httpRes: { data: { contactList: { contact: '2', list: 2, status: '1' } }, status: 200 }, + }, + { + httpReq: { + data: { contactList: { contact: '2', list: 3, status: '2' } }, + headers: { + 'Api-Token': 'dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'POST', + + url: 'https://active.campaigns.rudder.com/api/3/contactLists', + }, + httpRes: { data: { contactList: { contact: '2', list: 3, status: '2' } }, status: 200 }, + }, + { + httpReq: { + headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': 'dummyApiKey' }, + + method: 'GET', + + url: 'https://active.campaigns.rudder.com/api/3/fields?limit=100', + }, + httpRes: { + data: { + fieldOptions: [], + fieldRels: [], + fields: [ + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Random description', + id: '4', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Random', + type: 'multivalue', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Likes description', + id: '3', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Likes', + type: 'multivalue', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:43:38-06:00', + cols: '0', + defval: null, + descript: null, + id: '2', + isrequired: '0', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/2/options', + relations: 'https://:account.api-us1.com/api/:version/fields/2/relations', + }, + options: [], + ordernum: '2', + perstag: 'ANOTHER_TEST_TITLE', + relations: [], + rows: '0', + service: '', + show_in_list: '0', + title: 'Another Test Title', + type: '', + udate: '2018-11-15T21:43:38-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Country description', + id: '1', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Country', + type: 'textarea', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + { + cdate: '2018-11-15T21:42:40-06:00', + cols: '2', + defval: 'Defaut Value', + descript: 'Office description', + id: '0', + isrequired: '1', + links: { + options: 'https://:account.api-us1.com/api/:version/fields/1/options', + relations: 'https://:account.api-us1.com/api/:version/fields/1/relations', + }, + options: [], + ordernum: '3', + perstag: 'PERSONALIZEDTAG', + relations: [], + rows: '2', + service: 'google', + show_in_list: '1', + title: 'Office', + type: 'textarea', + udate: '2018-11-15T21:49:52-06:00', + visible: '1', + }, + ], + meta: { total: '4' }, + }, + status: 200, + }, + }, +]; diff --git a/test/integrations/destinations/af/deleteUsers/data.ts b/test/integrations/destinations/af/deleteUsers/data.ts new file mode 100644 index 0000000000..c552b79f67 --- /dev/null +++ b/test/integrations/destinations/af/deleteUsers/data.ts @@ -0,0 +1,302 @@ +import { cloneDeep } from 'lodash'; +import { FEATURES } from '../../../../../src/v0/util/tags'; +import { networkCallsData } from '../network'; +import { addMock } from '../../../testUtils'; +import MockAdapter from 'axios-mock-adapter'; +import utils from '../../../../../src/v0/util'; + +const defaultMockFns = () => { + jest.spyOn(Date.prototype, 'toISOString').mockReturnValue('2023-09-24T11:22:24.018Z'); + jest.spyOn(utils, 'generateUUID').mockReturnValue('97fcd7b2-cc24-47d7-b776-057b7b199513'); +}; + +const requests = [ + { + request: { + body: [ + { + destType: 'AF', + userAttributes: [ + { + userId: 'test_user_id', + appsflyer_id: 'jklhajksfh', + }, + { + userId: 'user_sdk2', + appsflyer_id: 'jklhajksfh', + }, + ], + config: { + devKey: 'ef1d42390426e3f7c90ac78272e74344', + apiToken: 'dummyApiToken', + }, + }, + ], + }, + }, + { + request: { + body: [ + { + destType: 'AF', + userAttributes: [ + { + userId: 'test_user_id', + appsflyer_id: 'jklhajksfh', + }, + { + userId: 'user_sdk2', + appsflyer_id: 'jklhajksfh', + }, + ], + config: { + devKey: 'ef1d42390426e3f7c90ac78272e74344', + 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', + }, + }, + ], + }, + }, + { + request: { + body: [ + { + destType: 'AF', + userAttributes: [ + { + email: 'testUser@testMail.com', + android_advertising_id: '1234', + }, + { + userId: 'user_sdk2', + android_advertising_id: '1234', + }, + ], + config: { + devKey: 'abcde', + appleAppId: 'asdfasdf', + groupTypeTrait: 'email', + groupValueTrait: 'age', + trackProductsOnce: false, + trackRevenuePerProduct: false, + apiToken: 'dummyApiToken', + }, + }, + ], + }, + }, + { + request: { + body: [ + { + destType: 'AF', + userAttributes: [ + { + email: 'testUser@testMail.com', + ios_advertising_id: '1234', + }, + { + userId: 'user_sdk2', + ios_advertising_id: '1234', + }, + ], + config: { + devKey: 'abcde', + androidAppId: 'com.rudder.rs', + groupTypeTrait: 'email', + groupValueTrait: 'age', + trackProductsOnce: false, + trackRevenuePerProduct: false, + apiToken: 'dummyApiToken', + }, + }, + ], + }, + }, + { + request: { + body: [ + { + destType: 'AF', + userAttributes: [ + { + email: 'testUser@testMail.com', + userId: 'user1234', + }, + { + userId: 'user_sdk2', + ios_advertising_id: '1234', + }, + ], + config: { + devKey: 'abcde', + androidAppId: 'com.rudder.rs', + groupTypeTrait: 'email', + groupValueTrait: 'age', + trackProductsOnce: false, + trackRevenuePerProduct: false, + apiToken: 'dummyApiToken', + }, + }, + ], + }, + }, +]; +const resultBodies = [ + [ + { + statusCode: 400, + error: + 'API Token and one of Apple ID or Android App Id are required fields for user deletion', + }, + ], + [ + { + statusCode: 400, + error: 'You can send utmost 3 callBackUrls', + }, + ], + [ + { + statusCode: 400, + error: 'androidAppId is required for android_advertising_id type identifier', + }, + ], + [ + { + statusCode: 400, + error: 'appleAppId is required for ios_advertising_id type identifier', + }, + ], + [ + { + statusCode: 400, + error: + 'none of the possible identityTypes i.e.(ios_advertising_id, android_advertising_id, appsflyer_id) is provided for deletion', + }, + ], +]; +const parentCaseVars = { + name: 'af', + description: 'Test ', + feature: FEATURES.USER_DELETION, + module: 'destination', + version: 'v0', + input: {}, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, +}; +const nonNetworkCases = requests.map((req, index) => { + const testCase = cloneDeep(parentCaseVars); + testCase.description = `Test ${2 + index}`; + testCase.input = req; + testCase.output.response.status = resultBodies[index][0].statusCode; + //@ts-ignore + testCase.output.response.body = resultBodies[index]; + return testCase; +}); + +export const data = [ + { + name: 'af', + description: 'Test 0', + feature: FEATURES.USER_DELETION, + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'AF', + userAttributes: [ + { + userId: 'test_user_id', + android_advertising_id: '1665148898336-5539842602053895577', + }, + ], + config: { + devKey: 'ef1d42390426e3f7c90ac78272e74344', + appleAppId: '123456789', + androidAppId: 'AnAID', + apiToken: 'dummyApiToken', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'User deletion request failed', + }, + ], + }, + }, + mockFns: (mockAdapter: MockAdapter) => { + const nwData = networkCallsData[0]; + addMock(mockAdapter, nwData); + defaultMockFns(); + }, + }, + { + name: 'af', + description: 'Test 1', + feature: FEATURES.USER_DELETION, + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'AF', + userAttributes: [ + { + userId: 'test_user_id', + ios_advertising_id: '1665148898336-5539842602053895577', + }, + ], + config: { + devKey: 'ef1d42390426e3f7c90ac78272e74344', + appleAppId: '123456789', + androidAppId: 'AnAID', + apiToken: 'dummyApiToken', + statusCallbackUrls: 'https://examplecontroller.com/opengdpr_callbacks', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + mockFns: (mockAdapter: MockAdapter) => { + const nwData = networkCallsData[1]; + addMock(mockAdapter, nwData); + defaultMockFns(); + }, + }, + ...nonNetworkCases, +]; diff --git a/test/integrations/destinations/af/network.ts b/test/integrations/destinations/af/network.ts new file mode 100644 index 0000000000..2e9557539e --- /dev/null +++ b/test/integrations/destinations/af/network.ts @@ -0,0 +1,67 @@ +import { JSON_MIME_TYPE } from '../../../../src/v0/util/constant'; + +export const networkCallsData = [ + { + httpReq: { + method: 'post', + url: 'https://hq1.appsflyer.com/api/gdpr/v1/opendsr_request', + headers: { + 'Content-Type': JSON_MIME_TYPE, + + Authorization: 'Bearer dummyApiToken', + }, + data: { + subject_request_type: 'erasure', + subject_identities: [ + { + identity_format: 'raw', + identity_type: 'android_advertising_id', + identity_value: '1665148898336-5539842602053895577', + }, + ], + property_id: 'AnAID', + subject_request_id: '97fcd7b2-cc24-47d7-b776-057b7b199513', + submitted_time: '2023-09-24T11:22:24.018Z', + }, + }, + httpRes: { + data: { + error: { + code: 400, + af_gdpr_code: 'e411', + message: "AppID given in 'property_id' is incorrect or does not belong to your account", + }, + }, + status: 400, + }, + }, + { + httpReq: { + method: 'post', + url: 'https://hq1.appsflyer.com/api/gdpr/v1/opendsr_request', + data: { + subject_request_type: 'erasure', + subject_identities: [ + { + identity_format: 'raw', + identity_type: 'ios_advertising_id', + identity_value: '1665148898336-5539842602053895577', + }, + ], + status_callback_urls: ['https://examplecontroller.com/opengdpr_callbacks'], + property_id: '123456789', + subject_request_id: '97fcd7b2-cc24-47d7-b776-057b7b199513', + submitted_time: '2023-09-24T11:22:24.018Z', + }, + headers: { + 'Content-Type': JSON_MIME_TYPE, + + Authorization: 'Bearer dummyApiToken', + }, + }, + httpRes: { + status: 200, + statusText: 'success', + }, + }, +]; diff --git a/test/integrations/destinations/am/deleteUsers/data.ts b/test/integrations/destinations/am/deleteUsers/data.ts new file mode 100644 index 0000000000..bd10a4d7e0 --- /dev/null +++ b/test/integrations/destinations/am/deleteUsers/data.ts @@ -0,0 +1,396 @@ +export const data = [ + { + name: 'am', + description: 'Test 0', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + jobId: '423451324652346', + destType: 'AM', + userAttributes: [ + { + userIderror: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + ], + config: { + apiKey: '1234', + apiSecret: 'abcd', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'User deletion request failed', + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/am/network.ts b/test/integrations/destinations/am/network.ts new file mode 100644 index 0000000000..81daa29621 --- /dev/null +++ b/test/integrations/destinations/am/network.ts @@ -0,0 +1,209 @@ +const deleteNwData = [ + { + httpReq: { + method: 'post', + url: 'https://amplitude.com/api/2/deletions/users', + data: { + user_ids: [ + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + ], + requester: 'RudderStack', + ignore_invalid_id: 'true', + }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic MTIzNDphYmNk', + }, + }, + httpRes: { + data: { + code: 403, + message: 'HTTP 403: Forbidden (Invalid API Key)', + status: 'Forbidden', + }, + status: 400, + }, + }, + { + httpReq: { + method: 'post', + url: 'https://amplitude.com/api/2/deletions/users', + data: { + user_ids: [ + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + ], + requester: 'RudderStack', + ignore_invalid_id: 'true', + }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic MTIzNDphYmNk', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': 'Nothing scheduled due to invalid amplitude/user ids for app XXXXX', + }, + }, + }, + { + httpReq: { + method: 'post', + url: 'https://amplitude.com/api/2/deletions/users', + data: { + userIds: ['Batch1'], + }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic MTIzNDphYmNk', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': 'Mocking', + }, + }, + }, + { + httpReq: { + method: 'post', + url: 'https://amplitude.com/api/2/deletions/users', + data: { + userIds: ['Batch2'], + }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic MTIzNDphYmNk', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': 'Mocking', + }, + }, + }, +]; +export const networkCallsData = [...deleteNwData]; diff --git a/test/integrations/destinations/braze/deleteUsers/data.ts b/test/integrations/destinations/braze/deleteUsers/data.ts new file mode 100644 index 0000000000..cad61fd12d --- /dev/null +++ b/test/integrations/destinations/braze/deleteUsers/data.ts @@ -0,0 +1,483 @@ +export const data = [ + { + name: 'braze', + description: 'Test 0', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'BRAZE', + userAttributes: [ + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + ], + config: { + dataCenter: 'US-03', + restApiKey: '1234', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'User deletion request failed', + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'Test 1', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'BRAZE', + userAttributes: [ + { + userId: 'test_user_id10', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id18', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id51', + }, + ], + config: { + dataCenter: 'US-03', + restApiKey: '1234', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'Test 2', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'BRAZE', + userAttributes: [ + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + ], + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'Config for deletion not present', + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'Test 3', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'BRAZE', + userAttributes: [ + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + ], + config: { + dataCenter: 'US-03', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'data center / api key for deletion not present', + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'Test 4', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'BRAZE', + userAttributes: [ + { + name: 'a', + }, + ], + config: { + restApiKey: 'b1bd90e2-d203-480a-962c-f7bb03ea0afe', + dataCenter: 'US-03', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/braze/network.ts b/test/integrations/destinations/braze/network.ts new file mode 100644 index 0000000000..4dfd5fa2a5 --- /dev/null +++ b/test/integrations/destinations/braze/network.ts @@ -0,0 +1,191 @@ +const deleteNwData = [ + { + httpReq: { + method: 'post', + url: 'https://rest.iad-03.braze.com/users/delete', + data: { + external_ids: [ + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + ], + }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer 1234', + }, + }, + httpRes: { + data: { + code: 400, + message: 'Bad Req', + status: 'Fail Case', + }, + status: 400, + }, + }, + { + httpReq: { + method: 'post', + url: 'https://rest.iad-03.braze.com/users/delete', + data: { + external_ids: [ + 'test_user_id10', + 'user_sdk2', + 'test_user_id18', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + ], + }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer 1234', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + deleted: 50, + message: 'success', + }, + }, + }, + { + httpReq: { + method: 'post', + url: 'https://rest.iad-03.braze.com/users/delete', + data: { external_ids: ['test_user_id51'] }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer 1234', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': { + deleted: '1', + message: 'success', + }, + }, + }, + }, + { + httpReq: { + method: 'post', + url: 'https://rest.iad-03.braze.com/users/delete', + data: { + externalIds: ['test_user_id'], + }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer 1234', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': { + deleted: 1, + message: 'success', + }, + }, + }, + }, +]; +export const networkCallsData = [...deleteNwData]; diff --git a/test/integrations/destinations/canny/data.ts b/test/integrations/destinations/canny/data.ts index dfd6028908..3c6823ca1b 100644 --- a/test/integrations/destinations/canny/data.ts +++ b/test/integrations/destinations/canny/data.ts @@ -1,3 +1,6 @@ +import { enhanceRequestOptions } from '../../../../src/adapters/network'; +import qs from 'qs'; + export const data = [ { name: 'canny', diff --git a/test/integrations/destinations/canny/network.ts b/test/integrations/destinations/canny/network.ts new file mode 100644 index 0000000000..db1b639632 --- /dev/null +++ b/test/integrations/destinations/canny/network.ts @@ -0,0 +1,83 @@ +export const networkCallsData = [ + { + httpReq: { + headers: { + Accept: 'application/json', + 'Content-Type': 'application/x-www-form-urlencoded', + }, + data: 'apiKey=apikey123&email=test%40rudderstack.com', + method: 'POST', + url: 'https://canny.io/api/v1/users/retrieve', + }, + httpRes: { + data: { + data: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '52d14c90fff7c80abcd12345', + isAdmin: true, + lastActivity: '2022-07-18T14:24:43.632Z', + name: 'Rudder Test', + url: 'https://ruderstack.canny.io/admin/users/dummyUser', + userID: null, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Accept: 'application/json', + 'Content-Type': 'application/x-www-form-urlencoded', + }, + data: 'apiKey=apikey123&email=test%40rudderstack.com', + method: 'POST', + url: 'https://canny.io/api/v1/users/retrieve', + }, + httpRes: { + data: { + data: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '52d14c90fff7c80abcd12345', + isAdmin: true, + lastActivity: '2022-07-18T14:24:43.632Z', + name: 'Rudder Test', + url: 'https://ruderstack.canny.io/admin/users/dummyUser', + userID: null, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Accept: 'application/json', + 'Content-Type': 'application/x-www-form-urlencoded', + }, + data: 'apiKey=apikey123&email=test%40rudderstack.com', + method: 'POST', + url: 'https://canny.io/api/v1/users/retrieve', + }, + httpRes: { + data: { + data: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '52d14c90fff7c80abcd12345', + isAdmin: true, + lastActivity: '2022-07-18T14:24:43.632Z', + name: 'Rudder Test', + url: 'https://ruderstack.canny.io/admin/users/dummyUser', + userID: null, + }, + }, + status: 200, + }, + }, +]; diff --git a/test/integrations/destinations/clevertap/deleteUsers/data.ts b/test/integrations/destinations/clevertap/deleteUsers/data.ts new file mode 100644 index 0000000000..c0eb447a53 --- /dev/null +++ b/test/integrations/destinations/clevertap/deleteUsers/data.ts @@ -0,0 +1,495 @@ +export const data = [ + { + name: 'clevertap', + description: 'Test 0', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'CLEVERTAP', + userAttributes: [ + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + ], + config: { + accountId: '476550467', + trackAnonymous: true, + enableObjectIdMapping: false, + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'Project ID and Passcode is required for delete user', + }, + ], + }, + }, + }, + { + name: 'clevertap', + description: 'Test 1', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'CLEVERTAP', + userAttributes: [ + { + email: 'testUser@testMail.com', + }, + { + userId: 'user_sdk2', + }, + ], + config: { + passcode: 'fbee74a147828e2932c701d19dc1f2dcfa4ac0048be3aa3a88d427090a59dc1c0fa002f1', + trackAnonymous: true, + enableObjectIdMapping: false, + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'Project ID and Passcode is required for delete user', + }, + ], + }, + }, + }, + { + name: 'clevertap', + description: 'Test 2', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'CLEVERTAP', + userAttributes: [ + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + ], + config: { + accountId: 'testFail', + passcode: 'tofail', + trackAnonymous: true, + enableObjectIdMapping: false, + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'User deletion request failed', + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/clevertap/network.ts b/test/integrations/destinations/clevertap/network.ts new file mode 100644 index 0000000000..458d6faba0 --- /dev/null +++ b/test/integrations/destinations/clevertap/network.ts @@ -0,0 +1,175 @@ +const deleteNwData = [ + { + httpReq: { + method: 'post', + url: 'https://api.clevertap.com/1/delete/profiles.json', + data: { + identity: [ + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'user_sdk2', + ], + }, + headers: { + 'Content-Type': 'application/json', + 'X-CleverTap-Account-Id': 'testFail', + 'X-CleverTap-Passcode': 'tofail', + }, + }, + httpRes: { + data: { + code: 400, + message: 'Bad Req', + status: 'Fail Case', + }, + status: 400, + }, + }, + { + httpReq: { + method: 'post', + url: 'https://api.clevertap.com/1/delete/profiles.json', + data: { + identity: [ + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + 'test_user_id', + 'user_sdk2', + ], + }, + headers: { + 'Content-Type': 'application/json', + 'X-CleverTap-Account-Id': 'testFail', + 'X-CleverTap-Passcode': 'tofail', + }, + maxContentLength: 100000000, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': 'rpoxy', + }, + }, + }, +]; +export const networkCallsData = [...deleteNwData]; diff --git a/test/integrations/destinations/engage/deleteUsers/data.ts b/test/integrations/destinations/engage/deleteUsers/data.ts new file mode 100644 index 0000000000..5a6ea9d268 --- /dev/null +++ b/test/integrations/destinations/engage/deleteUsers/data.ts @@ -0,0 +1,241 @@ +export const data = [ + { + name: 'engage', + description: 'Test 0', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'ENGAGE', + userAttributes: [ + { + userId: '1', + }, + { + userId: '2', + }, + { + userId: '3', + }, + ], + config: { + publicKey: 'abcd', + privateKey: 'efgh', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'User deletion request failed', + }, + ], + }, + }, + }, + { + name: 'engage', + description: 'Test 1', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'ENGAGE', + userAttributes: [ + { + userId: '4', + }, + { + userId: '5', + }, + { + userId: '6', + }, + ], + config: { + publicKey: 'abcd', + privateKey: 'efgh', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'User deletion request failed', + }, + ], + }, + }, + }, + { + name: 'engage', + description: 'Test 2', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'ENGAGE', + userAttributes: [ + { + userId: '7', + }, + { + userId: '8', + }, + { + userId: '9', + }, + ], + config: { + publicKey: 'abcd', + privateKey: 'efgh', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'User deletion request failed', + }, + ], + }, + }, + }, + { + name: 'engage', + description: 'Test 3', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'ENGAGE', + userAttributes: [ + { + userId: '12', + }, + ], + config: { + publicKey: 'abcd', + privateKey: 'efgh', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, + { + name: 'engage', + description: 'Test 4', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'ENGAGE', + userAttributes: [ + { + userId: 'userid1', + }, + { + userId: 'user_sdk2', + }, + ], + config: { + privateKey: 'abcd', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'Public key is a required field for user deletion', + }, + ], + }, + }, + }, + { + name: 'engage', + description: 'Test 5', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'ENGAGE', + userAttributes: [ + { + email: 'testUser@testMail.com', + }, + { + userId: 'user_sdk2', + }, + ], + config: { + publicKey: 'abcd', + privateKey: 'efgh', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/engage/network.ts b/test/integrations/destinations/engage/network.ts new file mode 100644 index 0000000000..a675603d4e --- /dev/null +++ b/test/integrations/destinations/engage/network.ts @@ -0,0 +1,141 @@ +const deleteNwData = [ + { + httpReq: { + method: 'delete', + url: 'https://api.engage.so/v1/users/1', + }, + httpRes: { + data: { + code: 400, + message: 'Bad Req', + status: 'Fail first', + }, + status: 400, + }, + }, + { + httpReq: { + method: 'delete', + url: 'https://api.engage.so/v1/users/2', + }, + httpRes: { + status: 200, + statusText: 'success', + }, + }, + { + httpReq: { + method: 'delete', + url: 'https://api.engage.so/v1/users/3', + }, + httpRes: { + status: 200, + statusText: 'success', + }, + }, + { + httpReq: { + method: 'delete', + + url: 'https://api.engage.so/v1/users/4', + }, + httpRes: { + status: 200, + statusText: 'success', + }, + }, + { + httpReq: { + method: 'delete', + + url: 'https://api.engage.so/v1/users/5', + }, + httpRes: { + status: 200, + statusText: 'success', + }, + }, + { + httpReq: { + method: 'delete', + + url: 'https://api.engage.so/v1/users/6', + 'Content-Type': 'application/json', + Authorization: 'Basic YWJjZDplZmdo', + }, + httpRes: { + data: { + code: 400, + message: 'Bad Req', + status: 'fail 6 ', + }, + status: 400, + }, + }, + { + httpReq: { + method: 'delete', + + url: 'https://api.engage.so/v1/users/7', + 'Content-Type': 'application/json', + Authorization: 'Basic YWJjZDplZmdo', + }, + httpRes: { + status: 200, + statusText: 'success', + }, + }, + { + httpReq: { + method: 'delete', + + url: 'https://api.engage.so/v1/users/8', + 'Content-Type': 'application/json', + Authorization: 'Basic YWJjZDplZmdo', + }, + httpRes: { + data: { + code: 400, + message: 'Bad Req', + status: 'fail mid case 8', + }, + status: 400, + }, + }, + { + httpReq: { + method: 'delete', + + url: 'https://api.engage.so/v1/users/9', + 'Content-Type': 'application/json', + Authorization: 'Basic YWJjZDplZmdo', + }, + httpRes: { + status: 200, + statusText: 'success', + }, + }, + { + httpReq: { + method: 'delete', + + url: 'https://api.engage.so/v1/users/12', + }, + httpRes: { + status: 200, + statusText: 'success', + }, + }, + { + httpReq: { + method: 'delete', + + url: 'https://api.engage.so/v1/users/user_sdk2', + }, + httpRes: { + status: 200, + statusText: 'success', + }, + }, +]; +export const networkCallsData = [...deleteNwData]; diff --git a/test/integrations/destinations/ga/deleteUsers/data.ts b/test/integrations/destinations/ga/deleteUsers/data.ts new file mode 100644 index 0000000000..d11881e8fe --- /dev/null +++ b/test/integrations/destinations/ga/deleteUsers/data.ts @@ -0,0 +1,139 @@ +export const data = [ + { + name: 'ga', + description: 'Test 0', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + headers: { + 'x-rudder-dest-info': '{"secret": { "access_token": "valid_token" }}', + }, + body: [ + { + destType: 'GA', + userAttributes: [ + { + userId: 'test_user_1', + }, + { + userId: 'test_user_2', + }, + ], + config: { + trackingID: 'UA-123456789-5', + useNativeSDK: false, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, + { + name: 'ga', + description: 'Test 1', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + headers: { + 'x-rudder-dest-info': '{"secret": { "access_token": "expired_token" }}', + }, + body: [ + { + destType: 'GA', + userAttributes: [ + { + userId: 'test_user_3', + }, + { + userId: 'test_user_4', + }, + ], + config: { + trackingID: 'UA-123456789-6', + useNativeSDK: false, + }, + }, + ], + }, + }, + output: { + response: { + status: 500, + body: [ + { + statusCode: 500, + authErrorCategory: 'REFRESH_TOKEN', + error: 'invalid credentials', + }, + ], + }, + }, + }, + { + name: 'ga', + description: 'Test 2', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + headers: { + 'x-rudder-dest-info': '{"secret": { "access_token": "valid_token_1" }}', + }, + body: [ + { + destType: 'GA', + userAttributes: [ + { + userId: 'test_user_5', + }, + { + userId: 'test_user_6', + }, + { + userId: 'test_user_7', + }, + { + userId: 'test_user_8', + }, + { + userId: 'test_user_9', + }, + ], + config: { + trackingID: 'UA-123456789-7', + useNativeSDK: false, + }, + }, + ], + }, + }, + output: { + response: { + status: 403, + body: [ + { + statusCode: 403, + error: + 'Error occurred while completing deletion request: [dummy response] The parameter used to query is not correct', + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/ga/network.ts b/test/integrations/destinations/ga/network.ts new file mode 100644 index 0000000000..bef0b7a047 --- /dev/null +++ b/test/integrations/destinations/ga/network.ts @@ -0,0 +1,293 @@ +const deleteNwData = [ + { + httpReq: { + method: 'post', + url: 'https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert', + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_1', + }, + webPropertyId: 'UA-123456789-5', + }, + headers: { + Authorization: 'Bearer valid_token', + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_1', + }, + webPropertyId: 'UA-123456789-5', + deletionRequestTime: '2022-11-04T10:39:57.933Z', + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + method: 'post', + url: 'https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert', + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_2', + }, + webPropertyId: 'UA-123456789-5', + }, + headers: { + Authorization: 'Bearer valid_token', + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_2', + }, + webPropertyId: 'UA-123456789-5', + deletionRequestTime: '2022-11-04T10:39:57.933Z', + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + method: 'post', + url: 'https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert', + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_3', + }, + webPropertyId: 'UA-123456789-6', + }, + headers: { + Authorization: 'Bearer expired_token', + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + data: { + error: { + code: 401, + message: + 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.', + status: 'UNAUTHENTICATED', + }, + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + method: 'post', + url: 'https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert', + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_4', + }, + webPropertyId: 'UA-123456789-6', + }, + headers: { + Authorization: 'Bearer expired_token', + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + data: { + error: { + code: 401, + message: + 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.', + status: 'UNAUTHENTICATED', + }, + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + method: 'post', + url: 'https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert', + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_5', + }, + webPropertyId: 'UA-123456789-7', + }, + headers: { + Authorization: 'Bearer valid_token_1', + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_5', + }, + webPropertyId: 'UA-123456789-7', + deletionRequestTime: '2022-11-04T10:39:57.933Z', + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + method: 'post', + url: 'https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert', + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_6', + }, + webPropertyId: 'UA-123456789-7', + }, + headers: { + Authorization: 'Bearer valid_token_1', + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_6', + }, + webPropertyId: 'UA-123456789-7', + deletionRequestTime: '2022-11-04T10:39:57.933Z', + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + method: 'post', + url: 'https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert', + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_7', + }, + webPropertyId: 'UA-123456789-7', + }, + headers: { + Authorization: 'Bearer valid_token_1', + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + data: { + error: { + errors: [ + { + domain: 'global', + reason: 'invalidParameter', + message: '[dummy response] The parameter used to query is not correct', + }, + ], + code: 403, + message: '[dummy response] The parameter used to query is not correct', + }, + }, + status: 403, + statusText: 'Bad Request', + }, + }, + { + httpReq: { + method: 'post', + url: 'https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert', + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_8', + }, + webPropertyId: 'UA-123456789-7', + }, + headers: { + Authorization: 'Bearer valid_token_1', + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_8', + }, + webPropertyId: 'UA-123456789-7', + deletionRequestTime: '2022-11-04T10:39:57.933Z', + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + method: 'post', + url: 'https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert', + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_9', + }, + webPropertyId: 'UA-123456789-7', + }, + headers: { + Authorization: 'Bearer valid_token_1', + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_9', + }, + webPropertyId: 'UA-123456789-7', + deletionRequestTime: '2022-11-04T10:39:57.933Z', + }, + status: 200, + statusText: 'OK', + }, + }, +]; +export const networkCallsData = [...deleteNwData]; diff --git a/test/integrations/destinations/intercom/deleteUsers/data.ts b/test/integrations/destinations/intercom/deleteUsers/data.ts new file mode 100644 index 0000000000..a45af0a98f --- /dev/null +++ b/test/integrations/destinations/intercom/deleteUsers/data.ts @@ -0,0 +1,180 @@ +export const data = [ + { + name: 'intercom', + description: 'Test 0', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'INTERCOM', + userAttributes: [ + { + userId: '1', + }, + { + userId: '12', + }, + ], + config: { + apiKey: 'API_KEY', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'User deletion request failed', + }, + ], + }, + }, + }, + { + name: 'intercom', + description: 'Test 1', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'INTERCOM', + userAttributes: [ + { + userId: '7', + }, + { + userId: '9', + }, + ], + config: { + apiKey: 'API_KEY', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, + { + name: 'intercom', + description: 'Test 2', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'INTERCOM', + userAttributes: [ + { + userId: '6188c2c5f47e464b4abf3235', + }, + { + userId: 'user_sdk2', + }, + ], + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'Config for deletion not present', + }, + ], + }, + }, + }, + { + name: 'intercom', + description: 'Test 3', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'INTERCOM', + userAttributes: [ + { + userId: '6188c2c5f47e464b4abf3235', + }, + { + userId: 'user_sdk2', + }, + ], + config: {}, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'api key for deletion not present', + }, + ], + }, + }, + }, + { + name: 'intercom', + description: 'Test 4', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'INTERCOM', + userAttributes: [{}], + config: { + apiKey: 'a=', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/intercom/network.ts b/test/integrations/destinations/intercom/network.ts new file mode 100644 index 0000000000..9f064d63ea --- /dev/null +++ b/test/integrations/destinations/intercom/network.ts @@ -0,0 +1,93 @@ +const deleteNwData = [ + { + httpReq: { + method: 'post', + url: 'https://api.intercom.io/user_delete_requests', + data: { + intercom_user_id: '1', + }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer API_KEY', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + data: { + type: 'error.list', + request_id: '0022e6v5qc7m04jeu5pg', + errors: [ + { + code: 'unauthorized', + message: 'Access Token Invalid', + }, + ], + }, + status: 400, + }, + }, + { + httpReq: { + method: 'post', + url: 'https://api.intercom.io/user_delete_requests', + data: { + intercom_user_id: '12', + }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer API_KEY', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + status: 200, + statusText: 'ok', + data: { + id: 12, + }, + }, + }, + { + httpReq: { + method: 'post', + url: 'https://api.intercom.io/user_delete_requests', + data: { + intercom_user_id: '7', + }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer API_KEY', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + status: 200, + statusText: 'ok', + data: { + id: 7, + }, + }, + }, + { + httpReq: { + method: 'post', + url: 'https://api.intercom.io/user_delete_requests', + data: { + intercom_user_id: '9', + }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer API_KEY', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + status: 200, + statusText: 'ok', + data: { + id: 9, + }, + }, + }, +]; +export const networkCallsData = [...deleteNwData]; diff --git a/test/integrations/destinations/marketo_static_list/network.ts b/test/integrations/destinations/marketo_static_list/network.ts new file mode 100644 index 0000000000..c369e1af26 --- /dev/null +++ b/test/integrations/destinations/marketo_static_list/network.ts @@ -0,0 +1,22 @@ +export const networkCallsData = [ + { + httpReq: { + method: 'GET', + params: { + client_id: 'marketo_client_id_success', + client_secret: 'marketo_client_secret_success', + grant_type: 'client_credentials', + }, + url: 'https://marketo_acct_id_success.mktorest.com/identity/oauth/token', + }, + httpRes: { + data: { + access_token: 'access_token_success', + expires_in: 3599, + scope: 'integrations@rudderstack.com', + token_type: 'bearer', + }, + status: 200, + }, + }, +]; diff --git a/test/integrations/destinations/mautic/network.ts b/test/integrations/destinations/mautic/network.ts new file mode 100644 index 0000000000..593a630641 --- /dev/null +++ b/test/integrations/destinations/mautic/network.ts @@ -0,0 +1,3232 @@ +export const networkCallsData = [ + { + httpReq: { + headers: { + Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://ruddertest2.mautic.net/api/contacts?where%5B0%5D%5Bcol%5D=email&where%5B0%5D%5Bexpr%5D=eq&where%5B0%5D%5Bval%5D=abc@xyz.com', + }, + httpRes: { data: { contacts: {}, total: 0 }, status: 200 }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://ruddertest2.mautic.net/api/contacts?where%5B0%5D%5Bcol%5D=email&where%5B0%5D%5Bexpr%5D=eq&where%5B0%5D%5Bval%5D=abc@xyz.com', + }, + httpRes: { data: { contacts: {}, total: 0 }, status: 200 }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://ruddertest2.mautic.net/api/contacts?where%5B0%5D%5Bcol%5D=email&where%5B0%5D%5Bexpr%5D=eq&where%5B0%5D%5Bval%5D=hijibi@gmail.com', + }, + httpRes: { + data: { + contacts: { + '247': { + color: null, + createdBy: 1, + createdByUser: 'shruti rudderlabs', + dateAdded: '2022-08-21T16:30:21+00:00', + dateIdentified: '2022-08-21T16:30:21+00:00', + dateModified: '2022-08-21T18:08:06+00:00', + doNotContact: [], + fields: { + all: { + address1: null, + address2: null, + attribution: null, + attribution_date: null, + b2b_or_b2c: null, + car_or_truck: null, + cart_status: 'Full', + city: 'kolkata', + company: null, + company_size: null, + country: 'India', + crm_id: null, + datetime: null, + email: 'hijibi@gmail.com', + facebook: null, + fax: null, + firstname: 'hijibiji', + foursquare: null, + haspurchased: '0', + id: '247', + instagram: null, + last_active: null, + lastname: 'Test', + linkedin: null, + mobile: null, + nps__recommend: 9, + phone: '123456789', + points: 123, + position: 'lead', + preferred_locale: null, + products: null, + prospect_or_customer: 'Customer', + role: 'Individual Contributor', + sandbox: '0', + skype: null, + state: null, + subscription_status: 'New', + timezone: null, + title: 'abcd', + twitter: null, + website: 'https://test.com', + zipcode: null, + }, + core: { + address1: { + alias: 'address1', + default_value: null, + group: 'core', + id: '11', + is_fixed: '1', + label: 'Address Line 1', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + address2: { + alias: 'address2', + default_value: null, + group: 'core', + id: '12', + is_fixed: '1', + label: 'Address Line 2', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + attribution: { + alias: 'attribution', + default_value: null, + group: 'core', + id: '21', + is_fixed: '1', + label: 'Attribution', + normalizedValue: null, + object: 'lead', + properties: 'a:2:{s:9:"roundmode";i:4;s:9:"precision";i:2;}', + type: 'number', + value: null, + }, + attribution_date: { + alias: 'attribution_date', + default_value: null, + group: 'core', + id: '20', + is_fixed: '1', + label: 'Attribution Date', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: null, + }, + b2b_or_b2c: { + alias: 'b2b_or_b2c', + default_value: null, + group: 'core', + id: '47', + is_fixed: '0', + label: 'B2B or B2C', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:3:"B2B";s:5:"value";s:3:"B2B";}i:1;a:2:{s:5:"label";s:3:"B2C";s:5:"value";s:3:"B2C";}}}', + type: 'select', + value: null, + }, + car_or_truck: { + alias: 'car_or_truck', + default_value: null, + group: 'core', + id: '52', + is_fixed: '0', + label: 'Car or Truck', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:3:"Car";s:5:"value";s:3:"Car";}i:1;a:2:{s:5:"label";s:5:"Truck";s:5:"value";s:5:"Truck";}i:2;a:2:{s:5:"label";s:4:"Both";s:5:"value";s:4:"Both";}}}', + type: 'select', + value: null, + }, + cart_status: { + alias: 'cart_status', + default_value: null, + group: 'core', + id: '55', + is_fixed: '0', + label: 'Cart Status', + normalizedValue: 'Full', + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:5:"Empty";s:5:"value";s:5:"Empty";}i:1;a:2:{s:5:"label";s:4:"Full";s:5:"value";s:4:"Full";}}}', + type: 'select', + value: 'Full', + }, + city: { + alias: 'city', + default_value: null, + group: 'core', + id: '13', + is_fixed: '1', + label: 'City', + normalizedValue: 'kolkata', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'kolkata', + }, + company: { + alias: 'company', + default_value: null, + group: 'core', + id: '4', + is_fixed: '1', + label: 'Primary company', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + company_size: { + alias: 'company_size', + default_value: null, + group: 'core', + id: '53', + is_fixed: '0', + label: 'Company size Custom', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:7:{i:0;a:2:{s:5:"label";s:15:"Less than 1,000";s:5:"value";s:15:"Less than 1,000";}i:1;a:2:{s:5:"label";s:14:"1,000 - 10,000";s:5:"value";s:14:"1,000 - 10,000";}i:2;a:2:{s:5:"label";s:16:"10,000 - 100,000";s:5:"value";s:16:"10,000 - 100,000";}i:3;a:2:{s:5:"label";s:17:"100,000 - 500,000";s:5:"value";s:17:"100,000 - 500,000";}i:4;a:2:{s:5:"label";s:12:"500,000 - 1M";s:5:"value";s:12:"500,000 - 1M";}i:5;a:2:{s:5:"label";s:7:"1M - 5M";s:5:"value";s:7:"1M - 5M";}i:6;a:2:{s:5:"label";s:3:"5M+";s:5:"value";s:3:"5M+";}}}', + type: 'select', + value: null, + }, + country: { + alias: 'country', + default_value: null, + group: 'core', + id: '16', + is_fixed: '1', + label: 'Country', + normalizedValue: 'India', + object: 'lead', + properties: 'a:0:{}', + type: 'country', + value: 'India', + }, + crm_id: { + alias: 'crm_id', + default_value: null, + group: 'core', + id: '45', + is_fixed: '0', + label: 'CRM ID', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + datetime: { + alias: 'datetime', + default_value: null, + group: 'core', + id: '50', + is_fixed: '0', + label: 'Webinar date/time signup', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: null, + }, + email: { + alias: 'email', + default_value: null, + group: 'core', + id: '6', + is_fixed: '1', + label: 'Email', + normalizedValue: 'hijibi@gmail.com', + object: 'lead', + properties: 'a:0:{}', + type: 'email', + value: 'hijibi@gmail.com', + }, + fax: { + alias: 'fax', + default_value: null, + group: 'core', + id: '10', + is_fixed: '0', + label: 'Fax', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + firstname: { + alias: 'firstname', + default_value: null, + group: 'core', + id: '2', + is_fixed: '1', + label: 'First Name', + normalizedValue: 'hijibiji', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'hijibiji', + }, + haspurchased: { + alias: 'haspurchased', + default_value: null, + group: 'core', + id: '46', + is_fixed: '0', + label: 'hasPurchased', + normalizedValue: 'No', + object: 'lead', + properties: 'a:2:{s:2:"no";s:2:"No";s:3:"yes";s:3:"Yes";}', + type: 'boolean', + value: '0', + }, + last_active: { + alias: 'last_active', + default_value: null, + group: 'core', + id: '58', + is_fixed: '1', + label: 'Date Last Active', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: null, + }, + lastname: { + alias: 'lastname', + default_value: null, + group: 'core', + id: '3', + is_fixed: '1', + label: 'Last Name', + normalizedValue: 'Test', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'Test', + }, + mobile: { + alias: 'mobile', + default_value: null, + group: 'core', + id: '7', + is_fixed: '1', + label: 'Mobile', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + nps__recommend: { + alias: 'nps__recommend', + default_value: null, + group: 'core', + id: '56', + is_fixed: '0', + label: 'NPS - Recommend', + normalizedValue: 9, + object: 'lead', + properties: 'a:2:{s:9:"roundmode";s:1:"3";s:9:"precision";s:0:"";}', + type: 'number', + value: 9, + }, + phone: { + alias: 'phone', + default_value: null, + group: 'core', + id: '8', + is_fixed: '1', + label: 'Phone', + normalizedValue: '123456789', + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: '123456789', + }, + points: { + alias: 'points', + default_value: '0', + group: 'core', + id: '9', + is_fixed: '1', + label: 'Points', + normalizedValue: 123, + object: 'lead', + properties: 'a:0:{}', + type: 'number', + value: 123, + }, + position: { + alias: 'position', + default_value: null, + group: 'core', + id: '5', + is_fixed: '1', + label: 'Position', + normalizedValue: 'lead', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'lead', + }, + preferred_locale: { + alias: 'preferred_locale', + default_value: null, + group: 'core', + id: '17', + is_fixed: '1', + label: 'Preferred Locale', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'locale', + value: null, + }, + products: { + alias: 'products', + default_value: null, + group: 'core', + id: '48', + is_fixed: '0', + label: 'Products', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:27:"Mautic Marketing Automation";s:5:"value";s:27:"Mautic Marketing Automation";}i:1;a:2:{s:5:"label";s:28:"Maven Marketing Intelligence";s:5:"value";s:28:"Maven Marketing Intelligence";}i:2;a:2:{s:5:"label";s:28:"Maestro Marketing Management";s:5:"value";s:28:"Maestro Marketing Management";}}}', + type: 'select', + value: null, + }, + prospect_or_customer: { + alias: 'prospect_or_customer', + default_value: null, + group: 'core', + id: '51', + is_fixed: '0', + label: 'Prospect or Customer', + normalizedValue: 'Customer', + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:8:"Prospect";s:5:"value";s:8:"Prospect";}i:1;a:2:{s:5:"label";s:8:"Customer";s:5:"value";s:8:"Customer";}}}', + type: 'select', + value: 'Customer', + }, + role: { + alias: 'role', + default_value: null, + group: 'core', + id: '57', + is_fixed: '0', + label: 'Role', + normalizedValue: 'Individual Contributor', + object: 'lead', + properties: + 'a:1:{s:4:"list";a:5:{i:0;a:2:{s:5:"label";s:22:"Individual Contributor";s:5:"value";s:22:"Individual Contributor";}i:1;a:2:{s:5:"label";s:7:"Manager";s:5:"value";s:7:"Manager";}i:2;a:2:{s:5:"label";s:8:"Director";s:5:"value";s:8:"Director";}i:3;a:2:{s:5:"label";s:9:"Executive";s:5:"value";s:9:"Executive";}i:4;a:2:{s:5:"label";s:10:"Consultant";s:5:"value";s:10:"Consultant";}}}', + type: 'select', + value: 'Individual Contributor', + }, + sandbox: { + alias: 'sandbox', + default_value: null, + group: 'core', + id: '54', + is_fixed: '0', + label: 'Sandbox', + normalizedValue: 'No', + object: 'lead', + properties: 'a:2:{s:2:"no";s:2:"No";s:3:"yes";s:3:"Yes";}', + type: 'boolean', + value: '0', + }, + state: { + alias: 'state', + default_value: null, + group: 'core', + id: '14', + is_fixed: '1', + label: 'State', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'region', + value: null, + }, + subscription_status: { + alias: 'subscription_status', + default_value: null, + group: 'core', + id: '49', + is_fixed: '0', + label: 'Subscription Status', + normalizedValue: 'New', + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:3:"New";s:5:"value";s:3:"New";}i:1;a:2:{s:5:"label";s:8:"Existing";s:5:"value";s:8:"Existing";}i:2;a:2:{s:5:"label";s:6:"Former";s:5:"value";s:6:"Former";}}}', + type: 'select', + value: 'New', + }, + timezone: { + alias: 'timezone', + default_value: null, + group: 'core', + id: '18', + is_fixed: '1', + label: 'Preferred Timezone', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'timezone', + value: null, + }, + title: { + alias: 'title', + default_value: null, + group: 'core', + id: '1', + is_fixed: '1', + label: 'Title', + normalizedValue: 'abcd', + object: 'lead', + properties: 'a:1:{s:4:"list";a:3:{i:0;s:2:"Mr";i:1;s:3:"Mrs";i:2;s:4:"Miss";}}', + type: 'lookup', + value: 'abcd', + }, + website: { + alias: 'website', + default_value: null, + group: 'core', + id: '22', + is_fixed: '0', + label: 'Website', + normalizedValue: 'https://test.com', + object: 'lead', + properties: 'a:0:{}', + type: 'url', + value: 'https://test.com', + }, + zipcode: { + alias: 'zipcode', + default_value: null, + group: 'core', + id: '15', + is_fixed: '1', + label: 'Zip Code', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + }, + personal: [], + professional: [], + social: { + facebook: { + alias: 'facebook', + default_value: null, + group: 'social', + id: '23', + is_fixed: '0', + label: 'Facebook', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + foursquare: { + alias: 'foursquare', + default_value: null, + group: 'social', + id: '24', + is_fixed: '0', + label: 'Foursquare', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + instagram: { + alias: 'instagram', + default_value: null, + group: 'social', + id: '26', + is_fixed: '0', + label: 'Instagram', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + linkedin: { + alias: 'linkedin', + default_value: null, + group: 'social', + id: '27', + is_fixed: '0', + label: 'LinkedIn', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + skype: { + alias: 'skype', + default_value: null, + group: 'social', + id: '28', + is_fixed: '0', + label: 'Skype', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + twitter: { + alias: 'twitter', + default_value: null, + group: 'social', + id: '29', + is_fixed: '0', + label: 'Twitter', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + }, + }, + frequencyRules: [], + id: 247, + ipAddresses: [ + { + id: 1, + ipAddress: '127.0.0.1', + ipDetails: { + city: '', + country: '', + extra: '', + isp: '', + latitude: '', + longitude: '', + organization: '', + region: '', + timezone: '', + zipcode: '', + }, + }, + ], + isPublished: true, + lastActive: null, + modifiedBy: 1, + modifiedByUser: 'shruti rudderlabs', + owner: null, + points: 123, + preferredProfileImage: null, + stage: null, + tags: [], + utmtags: [], + }, + }, + total: 1, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://ruddertest2.mautic.net/api/contacts?where%5B0%5D%5Bcol%5D=email&where%5B0%5D%5Bexpr%5D=eq&where%5B0%5D%5Bval%5D=hijibi@gmail.com', + }, + httpRes: { + data: { + contacts: { + '247': { + color: null, + createdBy: 1, + createdByUser: 'shruti rudderlabs', + dateAdded: '2022-08-21T16:30:21+00:00', + dateIdentified: '2022-08-21T16:30:21+00:00', + dateModified: '2022-08-21T18:08:06+00:00', + doNotContact: [], + fields: { + all: { + address1: null, + address2: null, + attribution: null, + attribution_date: null, + b2b_or_b2c: null, + car_or_truck: null, + cart_status: 'Full', + city: 'kolkata', + company: null, + company_size: null, + country: 'India', + crm_id: null, + datetime: null, + email: 'hijibi@gmail.com', + facebook: null, + fax: null, + firstname: 'hijibiji', + foursquare: null, + haspurchased: '0', + id: '247', + instagram: null, + last_active: null, + lastname: 'Test', + linkedin: null, + mobile: null, + nps__recommend: 9, + phone: '123456789', + points: 123, + position: 'lead', + preferred_locale: null, + products: null, + prospect_or_customer: 'Customer', + role: 'Individual Contributor', + sandbox: '0', + skype: null, + state: null, + subscription_status: 'New', + timezone: null, + title: 'abcd', + twitter: null, + website: 'https://test.com', + zipcode: null, + }, + core: { + address1: { + alias: 'address1', + default_value: null, + group: 'core', + id: '11', + is_fixed: '1', + label: 'Address Line 1', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + address2: { + alias: 'address2', + default_value: null, + group: 'core', + id: '12', + is_fixed: '1', + label: 'Address Line 2', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + attribution: { + alias: 'attribution', + default_value: null, + group: 'core', + id: '21', + is_fixed: '1', + label: 'Attribution', + normalizedValue: null, + object: 'lead', + properties: 'a:2:{s:9:"roundmode";i:4;s:9:"precision";i:2;}', + type: 'number', + value: null, + }, + attribution_date: { + alias: 'attribution_date', + default_value: null, + group: 'core', + id: '20', + is_fixed: '1', + label: 'Attribution Date', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: null, + }, + b2b_or_b2c: { + alias: 'b2b_or_b2c', + default_value: null, + group: 'core', + id: '47', + is_fixed: '0', + label: 'B2B or B2C', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:3:"B2B";s:5:"value";s:3:"B2B";}i:1;a:2:{s:5:"label";s:3:"B2C";s:5:"value";s:3:"B2C";}}}', + type: 'select', + value: null, + }, + car_or_truck: { + alias: 'car_or_truck', + default_value: null, + group: 'core', + id: '52', + is_fixed: '0', + label: 'Car or Truck', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:3:"Car";s:5:"value";s:3:"Car";}i:1;a:2:{s:5:"label";s:5:"Truck";s:5:"value";s:5:"Truck";}i:2;a:2:{s:5:"label";s:4:"Both";s:5:"value";s:4:"Both";}}}', + type: 'select', + value: null, + }, + cart_status: { + alias: 'cart_status', + default_value: null, + group: 'core', + id: '55', + is_fixed: '0', + label: 'Cart Status', + normalizedValue: 'Full', + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:5:"Empty";s:5:"value";s:5:"Empty";}i:1;a:2:{s:5:"label";s:4:"Full";s:5:"value";s:4:"Full";}}}', + type: 'select', + value: 'Full', + }, + city: { + alias: 'city', + default_value: null, + group: 'core', + id: '13', + is_fixed: '1', + label: 'City', + normalizedValue: 'kolkata', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'kolkata', + }, + company: { + alias: 'company', + default_value: null, + group: 'core', + id: '4', + is_fixed: '1', + label: 'Primary company', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + company_size: { + alias: 'company_size', + default_value: null, + group: 'core', + id: '53', + is_fixed: '0', + label: 'Company size Custom', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:7:{i:0;a:2:{s:5:"label";s:15:"Less than 1,000";s:5:"value";s:15:"Less than 1,000";}i:1;a:2:{s:5:"label";s:14:"1,000 - 10,000";s:5:"value";s:14:"1,000 - 10,000";}i:2;a:2:{s:5:"label";s:16:"10,000 - 100,000";s:5:"value";s:16:"10,000 - 100,000";}i:3;a:2:{s:5:"label";s:17:"100,000 - 500,000";s:5:"value";s:17:"100,000 - 500,000";}i:4;a:2:{s:5:"label";s:12:"500,000 - 1M";s:5:"value";s:12:"500,000 - 1M";}i:5;a:2:{s:5:"label";s:7:"1M - 5M";s:5:"value";s:7:"1M - 5M";}i:6;a:2:{s:5:"label";s:3:"5M+";s:5:"value";s:3:"5M+";}}}', + type: 'select', + value: null, + }, + country: { + alias: 'country', + default_value: null, + group: 'core', + id: '16', + is_fixed: '1', + label: 'Country', + normalizedValue: 'India', + object: 'lead', + properties: 'a:0:{}', + type: 'country', + value: 'India', + }, + crm_id: { + alias: 'crm_id', + default_value: null, + group: 'core', + id: '45', + is_fixed: '0', + label: 'CRM ID', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + datetime: { + alias: 'datetime', + default_value: null, + group: 'core', + id: '50', + is_fixed: '0', + label: 'Webinar date/time signup', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: null, + }, + email: { + alias: 'email', + default_value: null, + group: 'core', + id: '6', + is_fixed: '1', + label: 'Email', + normalizedValue: 'hijibi@gmail.com', + object: 'lead', + properties: 'a:0:{}', + type: 'email', + value: 'hijibi@gmail.com', + }, + fax: { + alias: 'fax', + default_value: null, + group: 'core', + id: '10', + is_fixed: '0', + label: 'Fax', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + firstname: { + alias: 'firstname', + default_value: null, + group: 'core', + id: '2', + is_fixed: '1', + label: 'First Name', + normalizedValue: 'hijibiji', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'hijibiji', + }, + haspurchased: { + alias: 'haspurchased', + default_value: null, + group: 'core', + id: '46', + is_fixed: '0', + label: 'hasPurchased', + normalizedValue: 'No', + object: 'lead', + properties: 'a:2:{s:2:"no";s:2:"No";s:3:"yes";s:3:"Yes";}', + type: 'boolean', + value: '0', + }, + last_active: { + alias: 'last_active', + default_value: null, + group: 'core', + id: '58', + is_fixed: '1', + label: 'Date Last Active', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: null, + }, + lastname: { + alias: 'lastname', + default_value: null, + group: 'core', + id: '3', + is_fixed: '1', + label: 'Last Name', + normalizedValue: 'Test', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'Test', + }, + mobile: { + alias: 'mobile', + default_value: null, + group: 'core', + id: '7', + is_fixed: '1', + label: 'Mobile', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + nps__recommend: { + alias: 'nps__recommend', + default_value: null, + group: 'core', + id: '56', + is_fixed: '0', + label: 'NPS - Recommend', + normalizedValue: 9, + object: 'lead', + properties: 'a:2:{s:9:"roundmode";s:1:"3";s:9:"precision";s:0:"";}', + type: 'number', + value: 9, + }, + phone: { + alias: 'phone', + default_value: null, + group: 'core', + id: '8', + is_fixed: '1', + label: 'Phone', + normalizedValue: '123456789', + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: '123456789', + }, + points: { + alias: 'points', + default_value: '0', + group: 'core', + id: '9', + is_fixed: '1', + label: 'Points', + normalizedValue: 123, + object: 'lead', + properties: 'a:0:{}', + type: 'number', + value: 123, + }, + position: { + alias: 'position', + default_value: null, + group: 'core', + id: '5', + is_fixed: '1', + label: 'Position', + normalizedValue: 'lead', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'lead', + }, + preferred_locale: { + alias: 'preferred_locale', + default_value: null, + group: 'core', + id: '17', + is_fixed: '1', + label: 'Preferred Locale', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'locale', + value: null, + }, + products: { + alias: 'products', + default_value: null, + group: 'core', + id: '48', + is_fixed: '0', + label: 'Products', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:27:"Mautic Marketing Automation";s:5:"value";s:27:"Mautic Marketing Automation";}i:1;a:2:{s:5:"label";s:28:"Maven Marketing Intelligence";s:5:"value";s:28:"Maven Marketing Intelligence";}i:2;a:2:{s:5:"label";s:28:"Maestro Marketing Management";s:5:"value";s:28:"Maestro Marketing Management";}}}', + type: 'select', + value: null, + }, + prospect_or_customer: { + alias: 'prospect_or_customer', + default_value: null, + group: 'core', + id: '51', + is_fixed: '0', + label: 'Prospect or Customer', + normalizedValue: 'Customer', + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:8:"Prospect";s:5:"value";s:8:"Prospect";}i:1;a:2:{s:5:"label";s:8:"Customer";s:5:"value";s:8:"Customer";}}}', + type: 'select', + value: 'Customer', + }, + role: { + alias: 'role', + default_value: null, + group: 'core', + id: '57', + is_fixed: '0', + label: 'Role', + normalizedValue: 'Individual Contributor', + object: 'lead', + properties: + 'a:1:{s:4:"list";a:5:{i:0;a:2:{s:5:"label";s:22:"Individual Contributor";s:5:"value";s:22:"Individual Contributor";}i:1;a:2:{s:5:"label";s:7:"Manager";s:5:"value";s:7:"Manager";}i:2;a:2:{s:5:"label";s:8:"Director";s:5:"value";s:8:"Director";}i:3;a:2:{s:5:"label";s:9:"Executive";s:5:"value";s:9:"Executive";}i:4;a:2:{s:5:"label";s:10:"Consultant";s:5:"value";s:10:"Consultant";}}}', + type: 'select', + value: 'Individual Contributor', + }, + sandbox: { + alias: 'sandbox', + default_value: null, + group: 'core', + id: '54', + is_fixed: '0', + label: 'Sandbox', + normalizedValue: 'No', + object: 'lead', + properties: 'a:2:{s:2:"no";s:2:"No";s:3:"yes";s:3:"Yes";}', + type: 'boolean', + value: '0', + }, + state: { + alias: 'state', + default_value: null, + group: 'core', + id: '14', + is_fixed: '1', + label: 'State', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'region', + value: null, + }, + subscription_status: { + alias: 'subscription_status', + default_value: null, + group: 'core', + id: '49', + is_fixed: '0', + label: 'Subscription Status', + normalizedValue: 'New', + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:3:"New";s:5:"value";s:3:"New";}i:1;a:2:{s:5:"label";s:8:"Existing";s:5:"value";s:8:"Existing";}i:2;a:2:{s:5:"label";s:6:"Former";s:5:"value";s:6:"Former";}}}', + type: 'select', + value: 'New', + }, + timezone: { + alias: 'timezone', + default_value: null, + group: 'core', + id: '18', + is_fixed: '1', + label: 'Preferred Timezone', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'timezone', + value: null, + }, + title: { + alias: 'title', + default_value: null, + group: 'core', + id: '1', + is_fixed: '1', + label: 'Title', + normalizedValue: 'abcd', + object: 'lead', + properties: 'a:1:{s:4:"list";a:3:{i:0;s:2:"Mr";i:1;s:3:"Mrs";i:2;s:4:"Miss";}}', + type: 'lookup', + value: 'abcd', + }, + website: { + alias: 'website', + default_value: null, + group: 'core', + id: '22', + is_fixed: '0', + label: 'Website', + normalizedValue: 'https://test.com', + object: 'lead', + properties: 'a:0:{}', + type: 'url', + value: 'https://test.com', + }, + zipcode: { + alias: 'zipcode', + default_value: null, + group: 'core', + id: '15', + is_fixed: '1', + label: 'Zip Code', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + }, + personal: [], + professional: [], + social: { + facebook: { + alias: 'facebook', + default_value: null, + group: 'social', + id: '23', + is_fixed: '0', + label: 'Facebook', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + foursquare: { + alias: 'foursquare', + default_value: null, + group: 'social', + id: '24', + is_fixed: '0', + label: 'Foursquare', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + instagram: { + alias: 'instagram', + default_value: null, + group: 'social', + id: '26', + is_fixed: '0', + label: 'Instagram', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + linkedin: { + alias: 'linkedin', + default_value: null, + group: 'social', + id: '27', + is_fixed: '0', + label: 'LinkedIn', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + skype: { + alias: 'skype', + default_value: null, + group: 'social', + id: '28', + is_fixed: '0', + label: 'Skype', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + twitter: { + alias: 'twitter', + default_value: null, + group: 'social', + id: '29', + is_fixed: '0', + label: 'Twitter', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + }, + }, + frequencyRules: [], + id: 247, + ipAddresses: [ + { + id: 1, + ipAddress: '127.0.0.1', + ipDetails: { + city: '', + country: '', + extra: '', + isp: '', + latitude: '', + longitude: '', + organization: '', + region: '', + timezone: '', + zipcode: '', + }, + }, + ], + isPublished: true, + lastActive: null, + modifiedBy: 1, + modifiedByUser: 'shruti rudderlabs', + owner: null, + points: 123, + preferredProfileImage: null, + stage: null, + tags: [], + utmtags: [], + }, + }, + total: 1, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://ruddertest2.mautic.net/api/contacts?where%5B0%5D%5Bcol%5D=lastname&where%5B0%5D%5Bexpr%5D=eq&where%5B0%5D%5Bval%5D=kumar', + }, + httpRes: { + data: { + contacts: { + '248': { + color: null, + createdBy: 1, + createdByUser: 'test rudderlabs', + dateAdded: '2022-08-18T12:19:27+00:00', + dateIdentified: '2022-08-18T12:19:27+00:00', + dateModified: '2022-08-23T11:46:30+00:00', + doNotContact: [], + fields: { + all: { + address1: null, + address2: null, + attribution: null, + attribution_date: null, + b2b_or_b2c: null, + car_or_truck: null, + cart_status: null, + city: null, + company: null, + company_size: null, + country: null, + crm_id: null, + datetime: null, + email: 'xyz@abc.com', + facebook: null, + fax: null, + firstname: 'rudderstack', + foursquare: null, + haspurchased: '1', + id: '248', + instagram: null, + last_active: '2022-08-23 11:46:27', + lastname: 'kumar', + linkedin: null, + mobile: null, + nps__recommend: null, + phone: null, + points: 0, + position: null, + preferred_locale: null, + products: null, + prospect_or_customer: null, + role: null, + sandbox: null, + skype: null, + state: 'Uttar Pradesh', + subscription_status: null, + timezone: null, + title: null, + twitter: null, + website: null, + zipcode: null, + }, + core: { + address1: { + alias: 'address1', + default_value: null, + group: 'core', + id: '11', + is_fixed: '1', + label: 'Address Line 1', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + address2: { + alias: 'address2', + default_value: null, + group: 'core', + id: '12', + is_fixed: '1', + label: 'Address Line 2', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + attribution: { + alias: 'attribution', + default_value: null, + group: 'core', + id: '21', + is_fixed: '1', + label: 'Attribution', + normalizedValue: null, + object: 'lead', + properties: 'a:2:{s:9:"roundmode";i:4;s:9:"precision";i:2;}', + type: 'number', + value: null, + }, + attribution_date: { + alias: 'attribution_date', + default_value: null, + group: 'core', + id: '20', + is_fixed: '1', + label: 'Attribution Date', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: null, + }, + b2b_or_b2c: { + alias: 'b2b_or_b2c', + default_value: null, + group: 'core', + id: '47', + is_fixed: '0', + label: 'B2B or B2C', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:3:"B2B";s:5:"value";s:3:"B2B";}i:1;a:2:{s:5:"label";s:3:"B2C";s:5:"value";s:3:"B2C";}}}', + type: 'select', + value: null, + }, + car_or_truck: { + alias: 'car_or_truck', + default_value: null, + group: 'core', + id: '52', + is_fixed: '0', + label: 'Car or Truck', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:3:"Car";s:5:"value";s:3:"Car";}i:1;a:2:{s:5:"label";s:5:"Truck";s:5:"value";s:5:"Truck";}i:2;a:2:{s:5:"label";s:4:"Both";s:5:"value";s:4:"Both";}}}', + type: 'select', + value: null, + }, + cart_status: { + alias: 'cart_status', + default_value: null, + group: 'core', + id: '55', + is_fixed: '0', + label: 'Cart Status', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:5:"Empty";s:5:"value";s:5:"Empty";}i:1;a:2:{s:5:"label";s:4:"Full";s:5:"value";s:4:"Full";}}}', + type: 'select', + value: null, + }, + city: { + alias: 'city', + default_value: null, + group: 'core', + id: '13', + is_fixed: '1', + label: 'City', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + company: { + alias: 'company', + default_value: null, + group: 'core', + id: '4', + is_fixed: '1', + label: 'Primary company', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + company_size: { + alias: 'company_size', + default_value: null, + group: 'core', + id: '53', + is_fixed: '0', + label: 'Company size Custom', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:7:{i:0;a:2:{s:5:"label";s:15:"Less than 1,000";s:5:"value";s:15:"Less than 1,000";}i:1;a:2:{s:5:"label";s:14:"1,000 - 10,000";s:5:"value";s:14:"1,000 - 10,000";}i:2;a:2:{s:5:"label";s:16:"10,000 - 100,000";s:5:"value";s:16:"10,000 - 100,000";}i:3;a:2:{s:5:"label";s:17:"100,000 - 500,000";s:5:"value";s:17:"100,000 - 500,000";}i:4;a:2:{s:5:"label";s:12:"500,000 - 1M";s:5:"value";s:12:"500,000 - 1M";}i:5;a:2:{s:5:"label";s:7:"1M - 5M";s:5:"value";s:7:"1M - 5M";}i:6;a:2:{s:5:"label";s:3:"5M+";s:5:"value";s:3:"5M+";}}}', + type: 'select', + value: null, + }, + country: { + alias: 'country', + default_value: null, + group: 'core', + id: '16', + is_fixed: '1', + label: 'Country', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'country', + value: null, + }, + crm_id: { + alias: 'crm_id', + default_value: null, + group: 'core', + id: '45', + is_fixed: '0', + label: 'CRM ID', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + datetime: { + alias: 'datetime', + default_value: null, + group: 'core', + id: '50', + is_fixed: '0', + label: 'Webinar date/time signup', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: null, + }, + email: { + alias: 'email', + default_value: null, + group: 'core', + id: '6', + is_fixed: '1', + label: 'Email', + normalizedValue: 'xyz@abc.com', + object: 'lead', + properties: 'a:0:{}', + type: 'email', + value: 'xyz@abc.com', + }, + fax: { + alias: 'fax', + default_value: null, + group: 'core', + id: '10', + is_fixed: '0', + label: 'Fax', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + firstname: { + alias: 'firstname', + default_value: null, + group: 'core', + id: '2', + is_fixed: '1', + label: 'First Name', + normalizedValue: 'rudderstack', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'rudderstack', + }, + haspurchased: { + alias: 'haspurchased', + default_value: null, + group: 'core', + id: '46', + is_fixed: '0', + label: 'hasPurchased', + normalizedValue: 'Yes', + object: 'lead', + properties: 'a:2:{s:2:"no";s:2:"No";s:3:"yes";s:3:"Yes";}', + type: 'boolean', + value: '1', + }, + last_active: { + alias: 'last_active', + default_value: null, + group: 'core', + id: '58', + is_fixed: '1', + label: 'Date Last Active', + normalizedValue: '2022-08-23 11:46:27', + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: '2022-08-23 11:46:27', + }, + lastname: { + alias: 'lastname', + default_value: null, + group: 'core', + id: '3', + is_fixed: '1', + label: 'Last Name', + normalizedValue: 'kumar', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'kumar', + }, + mobile: { + alias: 'mobile', + default_value: null, + group: 'core', + id: '7', + is_fixed: '1', + label: 'Mobile', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + nps__recommend: { + alias: 'nps__recommend', + default_value: null, + group: 'core', + id: '56', + is_fixed: '0', + label: 'NPS - Recommend', + normalizedValue: null, + object: 'lead', + properties: 'a:2:{s:9:"roundmode";s:1:"3";s:9:"precision";s:0:"";}', + type: 'number', + value: null, + }, + phone: { + alias: 'phone', + default_value: null, + group: 'core', + id: '8', + is_fixed: '1', + label: 'Phone', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + points: { + alias: 'points', + default_value: '0', + group: 'core', + id: '9', + is_fixed: '1', + label: 'Points', + normalizedValue: 0, + object: 'lead', + properties: 'a:0:{}', + type: 'number', + value: 0, + }, + position: { + alias: 'position', + default_value: null, + group: 'core', + id: '5', + is_fixed: '1', + label: 'Position', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + preferred_locale: { + alias: 'preferred_locale', + default_value: null, + group: 'core', + id: '17', + is_fixed: '1', + label: 'Preferred Locale', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'locale', + value: null, + }, + products: { + alias: 'products', + default_value: null, + group: 'core', + id: '48', + is_fixed: '0', + label: 'Products', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:27:"Mautic Marketing Automation";s:5:"value";s:27:"Mautic Marketing Automation";}i:1;a:2:{s:5:"label";s:28:"Maven Marketing Intelligence";s:5:"value";s:28:"Maven Marketing Intelligence";}i:2;a:2:{s:5:"label";s:28:"Maestro Marketing Management";s:5:"value";s:28:"Maestro Marketing Management";}}}', + type: 'select', + value: null, + }, + prospect_or_customer: { + alias: 'prospect_or_customer', + default_value: null, + group: 'core', + id: '51', + is_fixed: '0', + label: 'Prospect or Customer', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:8:"Prospect";s:5:"value";s:8:"Prospect";}i:1;a:2:{s:5:"label";s:8:"Customer";s:5:"value";s:8:"Customer";}}}', + type: 'select', + value: null, + }, + role: { + alias: 'role', + default_value: null, + group: 'core', + id: '57', + is_fixed: '0', + label: 'Role', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:5:{i:0;a:2:{s:5:"label";s:22:"Individual Contributor";s:5:"value";s:22:"Individual Contributor";}i:1;a:2:{s:5:"label";s:7:"Manager";s:5:"value";s:7:"Manager";}i:2;a:2:{s:5:"label";s:8:"Director";s:5:"value";s:8:"Director";}i:3;a:2:{s:5:"label";s:9:"Executive";s:5:"value";s:9:"Executive";}i:4;a:2:{s:5:"label";s:10:"Consultant";s:5:"value";s:10:"Consultant";}}}', + type: 'select', + value: null, + }, + sandbox: { + alias: 'sandbox', + default_value: null, + group: 'core', + id: '54', + is_fixed: '0', + label: 'Sandbox', + normalizedValue: null, + object: 'lead', + properties: 'a:2:{s:2:"no";s:2:"No";s:3:"yes";s:3:"Yes";}', + type: 'boolean', + value: null, + }, + state: { + alias: 'state', + default_value: null, + group: 'core', + id: '14', + is_fixed: '1', + label: 'State', + normalizedValue: 'Uttar Pradesh', + object: 'lead', + properties: 'a:0:{}', + type: 'region', + value: 'Uttar Pradesh', + }, + subscription_status: { + alias: 'subscription_status', + default_value: null, + group: 'core', + id: '49', + is_fixed: '0', + label: 'Subscription Status', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:3:"New";s:5:"value";s:3:"New";}i:1;a:2:{s:5:"label";s:8:"Existing";s:5:"value";s:8:"Existing";}i:2;a:2:{s:5:"label";s:6:"Former";s:5:"value";s:6:"Former";}}}', + type: 'select', + value: null, + }, + timezone: { + alias: 'timezone', + default_value: null, + group: 'core', + id: '18', + is_fixed: '1', + label: 'Preferred Timezone', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'timezone', + value: null, + }, + title: { + alias: 'title', + default_value: null, + group: 'core', + id: '1', + is_fixed: '1', + label: 'Title', + normalizedValue: null, + object: 'lead', + properties: 'a:1:{s:4:"list";a:3:{i:0;s:2:"Mr";i:1;s:3:"Mrs";i:2;s:4:"Miss";}}', + type: 'lookup', + value: null, + }, + website: { + alias: 'website', + default_value: null, + group: 'core', + id: '22', + is_fixed: '0', + label: 'Website', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'url', + value: null, + }, + zipcode: { + alias: 'zipcode', + default_value: null, + group: 'core', + id: '15', + is_fixed: '1', + label: 'Zip Code', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + }, + personal: [], + professional: [], + social: { + facebook: { + alias: 'facebook', + default_value: null, + group: 'social', + id: '23', + is_fixed: '0', + label: 'Facebook', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + foursquare: { + alias: 'foursquare', + default_value: null, + group: 'social', + id: '24', + is_fixed: '0', + label: 'Foursquare', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + instagram: { + alias: 'instagram', + default_value: null, + group: 'social', + id: '26', + is_fixed: '0', + label: 'Instagram', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + linkedin: { + alias: 'linkedin', + default_value: null, + group: 'social', + id: '27', + is_fixed: '0', + label: 'LinkedIn', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + skype: { + alias: 'skype', + default_value: null, + group: 'social', + id: '28', + is_fixed: '0', + label: 'Skype', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + twitter: { + alias: 'twitter', + default_value: null, + group: 'social', + id: '29', + is_fixed: '0', + label: 'Twitter', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + }, + }, + frequencyRules: [], + id: 248, + ipAddresses: [ + { + id: 1, + ipAddress: '130.0.1.21', + ipDetails: { + city: null, + country: 'United Kingdom', + extra: '', + isp: '', + latitude: 51.4964, + longitude: -0.1224, + organization: '', + region: '', + timezone: 'Europe/London', + zipcode: null, + }, + }, + ], + isPublished: true, + lastActive: '2022-08-23T11:46:27+00:00', + modifiedBy: 1, + modifiedByUser: 'test rudderlabs', + owner: null, + points: 0, + preferredProfileImage: null, + stage: null, + tags: [], + utmtags: [], + }, + '249': { + color: null, + createdBy: 1, + createdByUser: 'test rudderlabs', + dateAdded: '2022-08-18T12:20:05+00:00', + dateIdentified: '2022-08-18T12:20:05+00:00', + dateModified: '2022-08-24T09:19:10+00:00', + doNotContact: [], + fields: { + all: { + address1: null, + address2: null, + attribution: null, + attribution_date: null, + b2b_or_b2c: null, + car_or_truck: null, + cart_status: null, + city: null, + company: 'test', + company_size: null, + country: null, + crm_id: null, + datetime: null, + email: 'x1yz@abc.com', + facebook: null, + fax: null, + firstname: 'Kamlesh', + foursquare: null, + haspurchased: null, + id: '249', + instagram: null, + last_active: '2022-08-18 12:20:05', + lastname: 'kumar', + linkedin: null, + mobile: null, + nps__recommend: null, + phone: null, + points: 0, + position: null, + preferred_locale: null, + products: null, + prospect_or_customer: null, + role: null, + sandbox: null, + skype: null, + state: 'Uttar Pradesh', + subscription_status: null, + timezone: null, + title: null, + twitter: null, + website: null, + zipcode: null, + }, + core: { + address1: { + alias: 'address1', + default_value: null, + group: 'core', + id: '11', + is_fixed: '1', + label: 'Address Line 1', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + address2: { + alias: 'address2', + default_value: null, + group: 'core', + id: '12', + is_fixed: '1', + label: 'Address Line 2', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + attribution: { + alias: 'attribution', + default_value: null, + group: 'core', + id: '21', + is_fixed: '1', + label: 'Attribution', + normalizedValue: null, + object: 'lead', + properties: 'a:2:{s:9:"roundmode";i:4;s:9:"precision";i:2;}', + type: 'number', + value: null, + }, + attribution_date: { + alias: 'attribution_date', + default_value: null, + group: 'core', + id: '20', + is_fixed: '1', + label: 'Attribution Date', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: null, + }, + b2b_or_b2c: { + alias: 'b2b_or_b2c', + default_value: null, + group: 'core', + id: '47', + is_fixed: '0', + label: 'B2B or B2C', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:3:"B2B";s:5:"value";s:3:"B2B";}i:1;a:2:{s:5:"label";s:3:"B2C";s:5:"value";s:3:"B2C";}}}', + type: 'select', + value: null, + }, + car_or_truck: { + alias: 'car_or_truck', + default_value: null, + group: 'core', + id: '52', + is_fixed: '0', + label: 'Car or Truck', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:3:"Car";s:5:"value";s:3:"Car";}i:1;a:2:{s:5:"label";s:5:"Truck";s:5:"value";s:5:"Truck";}i:2;a:2:{s:5:"label";s:4:"Both";s:5:"value";s:4:"Both";}}}', + type: 'select', + value: null, + }, + cart_status: { + alias: 'cart_status', + default_value: null, + group: 'core', + id: '55', + is_fixed: '0', + label: 'Cart Status', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:5:"Empty";s:5:"value";s:5:"Empty";}i:1;a:2:{s:5:"label";s:4:"Full";s:5:"value";s:4:"Full";}}}', + type: 'select', + value: null, + }, + city: { + alias: 'city', + default_value: null, + group: 'core', + id: '13', + is_fixed: '1', + label: 'City', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + company: { + alias: 'company', + default_value: null, + group: 'core', + id: '4', + is_fixed: '1', + label: 'Primary company', + normalizedValue: 'test', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'test', + }, + company_size: { + alias: 'company_size', + default_value: null, + group: 'core', + id: '53', + is_fixed: '0', + label: 'Company size Custom', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:7:{i:0;a:2:{s:5:"label";s:15:"Less than 1,000";s:5:"value";s:15:"Less than 1,000";}i:1;a:2:{s:5:"label";s:14:"1,000 - 10,000";s:5:"value";s:14:"1,000 - 10,000";}i:2;a:2:{s:5:"label";s:16:"10,000 - 100,000";s:5:"value";s:16:"10,000 - 100,000";}i:3;a:2:{s:5:"label";s:17:"100,000 - 500,000";s:5:"value";s:17:"100,000 - 500,000";}i:4;a:2:{s:5:"label";s:12:"500,000 - 1M";s:5:"value";s:12:"500,000 - 1M";}i:5;a:2:{s:5:"label";s:7:"1M - 5M";s:5:"value";s:7:"1M - 5M";}i:6;a:2:{s:5:"label";s:3:"5M+";s:5:"value";s:3:"5M+";}}}', + type: 'select', + value: null, + }, + country: { + alias: 'country', + default_value: null, + group: 'core', + id: '16', + is_fixed: '1', + label: 'Country', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'country', + value: null, + }, + crm_id: { + alias: 'crm_id', + default_value: null, + group: 'core', + id: '45', + is_fixed: '0', + label: 'CRM ID', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + datetime: { + alias: 'datetime', + default_value: null, + group: 'core', + id: '50', + is_fixed: '0', + label: 'Webinar date/time signup', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: null, + }, + email: { + alias: 'email', + default_value: null, + group: 'core', + id: '6', + is_fixed: '1', + label: 'Email', + normalizedValue: 'x1yz@abc.com', + object: 'lead', + properties: 'a:0:{}', + type: 'email', + value: 'x1yz@abc.com', + }, + fax: { + alias: 'fax', + default_value: null, + group: 'core', + id: '10', + is_fixed: '0', + label: 'Fax', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + firstname: { + alias: 'firstname', + default_value: null, + group: 'core', + id: '2', + is_fixed: '1', + label: 'First Name', + normalizedValue: 'Kamlesh', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'Kamlesh', + }, + haspurchased: { + alias: 'haspurchased', + default_value: null, + group: 'core', + id: '46', + is_fixed: '0', + label: 'hasPurchased', + normalizedValue: null, + object: 'lead', + properties: 'a:2:{s:2:"no";s:2:"No";s:3:"yes";s:3:"Yes";}', + type: 'boolean', + value: null, + }, + last_active: { + alias: 'last_active', + default_value: null, + group: 'core', + id: '58', + is_fixed: '1', + label: 'Date Last Active', + normalizedValue: '2022-08-18 12:20:05', + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: '2022-08-18 12:20:05', + }, + lastname: { + alias: 'lastname', + default_value: null, + group: 'core', + id: '3', + is_fixed: '1', + label: 'Last Name', + normalizedValue: 'kumar', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'kumar', + }, + mobile: { + alias: 'mobile', + default_value: null, + group: 'core', + id: '7', + is_fixed: '1', + label: 'Mobile', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + nps__recommend: { + alias: 'nps__recommend', + default_value: null, + group: 'core', + id: '56', + is_fixed: '0', + label: 'NPS - Recommend', + normalizedValue: null, + object: 'lead', + properties: 'a:2:{s:9:"roundmode";s:1:"3";s:9:"precision";s:0:"";}', + type: 'number', + value: null, + }, + phone: { + alias: 'phone', + default_value: null, + group: 'core', + id: '8', + is_fixed: '1', + label: 'Phone', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + points: { + alias: 'points', + default_value: '0', + group: 'core', + id: '9', + is_fixed: '1', + label: 'Points', + normalizedValue: 0, + object: 'lead', + properties: 'a:0:{}', + type: 'number', + value: 0, + }, + position: { + alias: 'position', + default_value: null, + group: 'core', + id: '5', + is_fixed: '1', + label: 'Position', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + preferred_locale: { + alias: 'preferred_locale', + default_value: null, + group: 'core', + id: '17', + is_fixed: '1', + label: 'Preferred Locale', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'locale', + value: null, + }, + products: { + alias: 'products', + default_value: null, + group: 'core', + id: '48', + is_fixed: '0', + label: 'Products', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:27:"Mautic Marketing Automation";s:5:"value";s:27:"Mautic Marketing Automation";}i:1;a:2:{s:5:"label";s:28:"Maven Marketing Intelligence";s:5:"value";s:28:"Maven Marketing Intelligence";}i:2;a:2:{s:5:"label";s:28:"Maestro Marketing Management";s:5:"value";s:28:"Maestro Marketing Management";}}}', + type: 'select', + value: null, + }, + prospect_or_customer: { + alias: 'prospect_or_customer', + default_value: null, + group: 'core', + id: '51', + is_fixed: '0', + label: 'Prospect or Customer', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:8:"Prospect";s:5:"value";s:8:"Prospect";}i:1;a:2:{s:5:"label";s:8:"Customer";s:5:"value";s:8:"Customer";}}}', + type: 'select', + value: null, + }, + role: { + alias: 'role', + default_value: null, + group: 'core', + id: '57', + is_fixed: '0', + label: 'Role', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:5:{i:0;a:2:{s:5:"label";s:22:"Individual Contributor";s:5:"value";s:22:"Individual Contributor";}i:1;a:2:{s:5:"label";s:7:"Manager";s:5:"value";s:7:"Manager";}i:2;a:2:{s:5:"label";s:8:"Director";s:5:"value";s:8:"Director";}i:3;a:2:{s:5:"label";s:9:"Executive";s:5:"value";s:9:"Executive";}i:4;a:2:{s:5:"label";s:10:"Consultant";s:5:"value";s:10:"Consultant";}}}', + type: 'select', + value: null, + }, + sandbox: { + alias: 'sandbox', + default_value: null, + group: 'core', + id: '54', + is_fixed: '0', + label: 'Sandbox', + normalizedValue: null, + object: 'lead', + properties: 'a:2:{s:2:"no";s:2:"No";s:3:"yes";s:3:"Yes";}', + type: 'boolean', + value: null, + }, + state: { + alias: 'state', + default_value: null, + group: 'core', + id: '14', + is_fixed: '1', + label: 'State', + normalizedValue: 'Uttar Pradesh', + object: 'lead', + properties: 'a:0:{}', + type: 'region', + value: 'Uttar Pradesh', + }, + subscription_status: { + alias: 'subscription_status', + default_value: null, + group: 'core', + id: '49', + is_fixed: '0', + label: 'Subscription Status', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:3:"New";s:5:"value";s:3:"New";}i:1;a:2:{s:5:"label";s:8:"Existing";s:5:"value";s:8:"Existing";}i:2;a:2:{s:5:"label";s:6:"Former";s:5:"value";s:6:"Former";}}}', + type: 'select', + value: null, + }, + timezone: { + alias: 'timezone', + default_value: null, + group: 'core', + id: '18', + is_fixed: '1', + label: 'Preferred Timezone', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'timezone', + value: null, + }, + title: { + alias: 'title', + default_value: null, + group: 'core', + id: '1', + is_fixed: '1', + label: 'Title', + normalizedValue: null, + object: 'lead', + properties: 'a:1:{s:4:"list";a:3:{i:0;s:2:"Mr";i:1;s:3:"Mrs";i:2;s:4:"Miss";}}', + type: 'lookup', + value: null, + }, + website: { + alias: 'website', + default_value: null, + group: 'core', + id: '22', + is_fixed: '0', + label: 'Website', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'url', + value: null, + }, + zipcode: { + alias: 'zipcode', + default_value: null, + group: 'core', + id: '15', + is_fixed: '1', + label: 'Zip Code', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + }, + personal: [], + professional: [], + social: { + facebook: { + alias: 'facebook', + default_value: null, + group: 'social', + id: '23', + is_fixed: '0', + label: 'Facebook', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + foursquare: { + alias: 'foursquare', + default_value: null, + group: 'social', + id: '24', + is_fixed: '0', + label: 'Foursquare', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + instagram: { + alias: 'instagram', + default_value: null, + group: 'social', + id: '26', + is_fixed: '0', + label: 'Instagram', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + linkedin: { + alias: 'linkedin', + default_value: null, + group: 'social', + id: '27', + is_fixed: '0', + label: 'LinkedIn', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + skype: { + alias: 'skype', + default_value: null, + group: 'social', + id: '28', + is_fixed: '0', + label: 'Skype', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + twitter: { + alias: 'twitter', + default_value: null, + group: 'social', + id: '29', + is_fixed: '0', + label: 'Twitter', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + }, + }, + frequencyRules: [], + id: 249, + ipAddresses: [ + { + id: 1, + ipAddress: '130.0.1.21', + ipDetails: { + city: null, + country: 'United Kingdom', + extra: '', + isp: '', + latitude: 51.4964, + longitude: -0.1224, + organization: '', + region: '', + timezone: 'Europe/London', + zipcode: null, + }, + }, + ], + isPublished: true, + lastActive: '2022-08-18T12:20:05+00:00', + modifiedBy: 1, + modifiedByUser: 'test rudderlabs', + owner: null, + points: 0, + preferredProfileImage: null, + stage: null, + tags: [], + utmtags: [], + }, + '254': { + color: null, + createdBy: 1, + createdByUser: 'test rudderlabs', + dateAdded: '2022-08-18T13:20:27+00:00', + dateIdentified: '2022-08-18T13:20:27+00:00', + dateModified: '2022-08-18T13:20:27+00:00', + doNotContact: [], + fields: { + all: { + address1: null, + address2: null, + attribution: null, + attribution_date: null, + b2b_or_b2c: null, + car_or_truck: null, + cart_status: null, + city: null, + company: null, + company_size: null, + country: null, + crm_id: null, + datetime: null, + email: null, + facebook: null, + fax: null, + firstname: null, + foursquare: null, + haspurchased: '1', + id: '254', + instagram: null, + last_active: '2020-02-02 00:23:09', + lastname: 'Kumar', + linkedin: null, + mobile: null, + nps__recommend: null, + phone: null, + points: 0, + position: null, + preferred_locale: null, + products: null, + prospect_or_customer: null, + role: null, + sandbox: null, + skype: null, + state: null, + subscription_status: null, + timezone: null, + title: null, + twitter: null, + website: null, + zipcode: null, + }, + core: { + address1: { + alias: 'address1', + default_value: null, + group: 'core', + id: '11', + is_fixed: '1', + label: 'Address Line 1', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + address2: { + alias: 'address2', + default_value: null, + group: 'core', + id: '12', + is_fixed: '1', + label: 'Address Line 2', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + attribution: { + alias: 'attribution', + default_value: null, + group: 'core', + id: '21', + is_fixed: '1', + label: 'Attribution', + normalizedValue: null, + object: 'lead', + properties: 'a:2:{s:9:"roundmode";i:4;s:9:"precision";i:2;}', + type: 'number', + value: null, + }, + attribution_date: { + alias: 'attribution_date', + default_value: null, + group: 'core', + id: '20', + is_fixed: '1', + label: 'Attribution Date', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: null, + }, + b2b_or_b2c: { + alias: 'b2b_or_b2c', + default_value: null, + group: 'core', + id: '47', + is_fixed: '0', + label: 'B2B or B2C', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:3:"B2B";s:5:"value";s:3:"B2B";}i:1;a:2:{s:5:"label";s:3:"B2C";s:5:"value";s:3:"B2C";}}}', + type: 'select', + value: null, + }, + car_or_truck: { + alias: 'car_or_truck', + default_value: null, + group: 'core', + id: '52', + is_fixed: '0', + label: 'Car or Truck', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:3:"Car";s:5:"value";s:3:"Car";}i:1;a:2:{s:5:"label";s:5:"Truck";s:5:"value";s:5:"Truck";}i:2;a:2:{s:5:"label";s:4:"Both";s:5:"value";s:4:"Both";}}}', + type: 'select', + value: null, + }, + cart_status: { + alias: 'cart_status', + default_value: null, + group: 'core', + id: '55', + is_fixed: '0', + label: 'Cart Status', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:5:"Empty";s:5:"value";s:5:"Empty";}i:1;a:2:{s:5:"label";s:4:"Full";s:5:"value";s:4:"Full";}}}', + type: 'select', + value: null, + }, + city: { + alias: 'city', + default_value: null, + group: 'core', + id: '13', + is_fixed: '1', + label: 'City', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + company: { + alias: 'company', + default_value: null, + group: 'core', + id: '4', + is_fixed: '1', + label: 'Primary company', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + company_size: { + alias: 'company_size', + default_value: null, + group: 'core', + id: '53', + is_fixed: '0', + label: 'Company size Custom', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:7:{i:0;a:2:{s:5:"label";s:15:"Less than 1,000";s:5:"value";s:15:"Less than 1,000";}i:1;a:2:{s:5:"label";s:14:"1,000 - 10,000";s:5:"value";s:14:"1,000 - 10,000";}i:2;a:2:{s:5:"label";s:16:"10,000 - 100,000";s:5:"value";s:16:"10,000 - 100,000";}i:3;a:2:{s:5:"label";s:17:"100,000 - 500,000";s:5:"value";s:17:"100,000 - 500,000";}i:4;a:2:{s:5:"label";s:12:"500,000 - 1M";s:5:"value";s:12:"500,000 - 1M";}i:5;a:2:{s:5:"label";s:7:"1M - 5M";s:5:"value";s:7:"1M - 5M";}i:6;a:2:{s:5:"label";s:3:"5M+";s:5:"value";s:3:"5M+";}}}', + type: 'select', + value: null, + }, + country: { + alias: 'country', + default_value: null, + group: 'core', + id: '16', + is_fixed: '1', + label: 'Country', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'country', + value: null, + }, + crm_id: { + alias: 'crm_id', + default_value: null, + group: 'core', + id: '45', + is_fixed: '0', + label: 'CRM ID', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + datetime: { + alias: 'datetime', + default_value: null, + group: 'core', + id: '50', + is_fixed: '0', + label: 'Webinar date/time signup', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: null, + }, + email: { + alias: 'email', + default_value: null, + group: 'core', + id: '6', + is_fixed: '1', + label: 'Email', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'email', + value: null, + }, + fax: { + alias: 'fax', + default_value: null, + group: 'core', + id: '10', + is_fixed: '0', + label: 'Fax', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + firstname: { + alias: 'firstname', + default_value: null, + group: 'core', + id: '2', + is_fixed: '1', + label: 'First Name', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + haspurchased: { + alias: 'haspurchased', + default_value: null, + group: 'core', + id: '46', + is_fixed: '0', + label: 'hasPurchased', + normalizedValue: 'Yes', + object: 'lead', + properties: 'a:2:{s:2:"no";s:2:"No";s:3:"yes";s:3:"Yes";}', + type: 'boolean', + value: '1', + }, + last_active: { + alias: 'last_active', + default_value: null, + group: 'core', + id: '58', + is_fixed: '1', + label: 'Date Last Active', + normalizedValue: '2020-02-02 00:23:09', + object: 'lead', + properties: 'a:0:{}', + type: 'datetime', + value: '2020-02-02 00:23:09', + }, + lastname: { + alias: 'lastname', + default_value: null, + group: 'core', + id: '3', + is_fixed: '1', + label: 'Last Name', + normalizedValue: 'Kumar', + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: 'Kumar', + }, + mobile: { + alias: 'mobile', + default_value: null, + group: 'core', + id: '7', + is_fixed: '1', + label: 'Mobile', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + nps__recommend: { + alias: 'nps__recommend', + default_value: null, + group: 'core', + id: '56', + is_fixed: '0', + label: 'NPS - Recommend', + normalizedValue: null, + object: 'lead', + properties: 'a:2:{s:9:"roundmode";s:1:"3";s:9:"precision";s:0:"";}', + type: 'number', + value: null, + }, + phone: { + alias: 'phone', + default_value: null, + group: 'core', + id: '8', + is_fixed: '1', + label: 'Phone', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'tel', + value: null, + }, + points: { + alias: 'points', + default_value: '0', + group: 'core', + id: '9', + is_fixed: '1', + label: 'Points', + normalizedValue: 0, + object: 'lead', + properties: 'a:0:{}', + type: 'number', + value: 0, + }, + position: { + alias: 'position', + default_value: null, + group: 'core', + id: '5', + is_fixed: '1', + label: 'Position', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + preferred_locale: { + alias: 'preferred_locale', + default_value: null, + group: 'core', + id: '17', + is_fixed: '1', + label: 'Preferred Locale', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'locale', + value: null, + }, + products: { + alias: 'products', + default_value: null, + group: 'core', + id: '48', + is_fixed: '0', + label: 'Products', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:27:"Mautic Marketing Automation";s:5:"value";s:27:"Mautic Marketing Automation";}i:1;a:2:{s:5:"label";s:28:"Maven Marketing Intelligence";s:5:"value";s:28:"Maven Marketing Intelligence";}i:2;a:2:{s:5:"label";s:28:"Maestro Marketing Management";s:5:"value";s:28:"Maestro Marketing Management";}}}', + type: 'select', + value: null, + }, + prospect_or_customer: { + alias: 'prospect_or_customer', + default_value: null, + group: 'core', + id: '51', + is_fixed: '0', + label: 'Prospect or Customer', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:2:{i:0;a:2:{s:5:"label";s:8:"Prospect";s:5:"value";s:8:"Prospect";}i:1;a:2:{s:5:"label";s:8:"Customer";s:5:"value";s:8:"Customer";}}}', + type: 'select', + value: null, + }, + role: { + alias: 'role', + default_value: null, + group: 'core', + id: '57', + is_fixed: '0', + label: 'Role', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:5:{i:0;a:2:{s:5:"label";s:22:"Individual Contributor";s:5:"value";s:22:"Individual Contributor";}i:1;a:2:{s:5:"label";s:7:"Manager";s:5:"value";s:7:"Manager";}i:2;a:2:{s:5:"label";s:8:"Director";s:5:"value";s:8:"Director";}i:3;a:2:{s:5:"label";s:9:"Executive";s:5:"value";s:9:"Executive";}i:4;a:2:{s:5:"label";s:10:"Consultant";s:5:"value";s:10:"Consultant";}}}', + type: 'select', + value: null, + }, + sandbox: { + alias: 'sandbox', + default_value: null, + group: 'core', + id: '54', + is_fixed: '0', + label: 'Sandbox', + normalizedValue: null, + object: 'lead', + properties: 'a:2:{s:2:"no";s:2:"No";s:3:"yes";s:3:"Yes";}', + type: 'boolean', + value: null, + }, + state: { + alias: 'state', + default_value: null, + group: 'core', + id: '14', + is_fixed: '1', + label: 'State', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'region', + value: null, + }, + subscription_status: { + alias: 'subscription_status', + default_value: null, + group: 'core', + id: '49', + is_fixed: '0', + label: 'Subscription Status', + normalizedValue: null, + object: 'lead', + properties: + 'a:1:{s:4:"list";a:3:{i:0;a:2:{s:5:"label";s:3:"New";s:5:"value";s:3:"New";}i:1;a:2:{s:5:"label";s:8:"Existing";s:5:"value";s:8:"Existing";}i:2;a:2:{s:5:"label";s:6:"Former";s:5:"value";s:6:"Former";}}}', + type: 'select', + value: null, + }, + timezone: { + alias: 'timezone', + default_value: null, + group: 'core', + id: '18', + is_fixed: '1', + label: 'Preferred Timezone', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'timezone', + value: null, + }, + title: { + alias: 'title', + default_value: null, + group: 'core', + id: '1', + is_fixed: '1', + label: 'Title', + normalizedValue: null, + object: 'lead', + properties: 'a:1:{s:4:"list";a:3:{i:0;s:2:"Mr";i:1;s:3:"Mrs";i:2;s:4:"Miss";}}', + type: 'lookup', + value: null, + }, + website: { + alias: 'website', + default_value: null, + group: 'core', + id: '22', + is_fixed: '0', + label: 'Website', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'url', + value: null, + }, + zipcode: { + alias: 'zipcode', + default_value: null, + group: 'core', + id: '15', + is_fixed: '1', + label: 'Zip Code', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + }, + personal: [], + professional: [], + social: { + facebook: { + alias: 'facebook', + default_value: null, + group: 'social', + id: '23', + is_fixed: '0', + label: 'Facebook', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + foursquare: { + alias: 'foursquare', + default_value: null, + group: 'social', + id: '24', + is_fixed: '0', + label: 'Foursquare', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + instagram: { + alias: 'instagram', + default_value: null, + group: 'social', + id: '26', + is_fixed: '0', + label: 'Instagram', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + linkedin: { + alias: 'linkedin', + default_value: null, + group: 'social', + id: '27', + is_fixed: '0', + label: 'LinkedIn', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + skype: { + alias: 'skype', + default_value: null, + group: 'social', + id: '28', + is_fixed: '0', + label: 'Skype', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + twitter: { + alias: 'twitter', + default_value: null, + group: 'social', + id: '29', + is_fixed: '0', + label: 'Twitter', + normalizedValue: null, + object: 'lead', + properties: 'a:0:{}', + type: 'text', + value: null, + }, + }, + }, + frequencyRules: [], + id: 254, + ipAddresses: [], + isPublished: true, + lastActive: '2020-02-02T00:23:09+00:00', + modifiedBy: 1, + modifiedByUser: 'test rudderlabs', + owner: null, + points: 0, + preferredProfileImage: null, + stage: null, + tags: [], + utmtags: [], + }, + }, + total: '3', + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://ruddertest2.mautic.net/api/contacts?where%5B0%5D%5Bcol%5D=lastname&where%5B0%5D%5Bexpr%5D=eq&where%5B0%5D%5Bval%5D=Singh', + }, + httpRes: { data: { Conatcts: {}, Total: 0 }, status: 200 }, + }, +]; diff --git a/test/integrations/destinations/mp/deleteUsers/data.ts b/test/integrations/destinations/mp/deleteUsers/data.ts new file mode 100644 index 0000000000..0f469b508f --- /dev/null +++ b/test/integrations/destinations/mp/deleteUsers/data.ts @@ -0,0 +1,3281 @@ +export const data = [ + { + name: 'mp', + description: 'Test 0', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'MP', + userAttributes: [ + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + ], + config: { + token: 'testToken', + prefixProperties: true, + useNativeSDK: false, + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'User deletion request failed for `delete profile` api', + }, + ], + }, + }, + }, + { + name: 'mp', + description: 'Test 1', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'MP', + userAttributes: [ + { + userId: 'rudder1', + }, + { + userId: 'rudder1', + }, + ], + config: { + token: 'testToken', + prefixProperties: true, + useNativeSDK: false, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, + { + name: 'mp', + description: 'Test 2', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'MP', + userAttributes: [ + { + userId: 'test_user_id', + }, + { + userId: 'user_sdk2', + }, + ], + config: { + apiKey: 'dummyApiKey', + prefixProperties: true, + useNativeSDK: false, + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'API Token is a required field for user deletion', + }, + ], + }, + }, + }, + { + name: 'mp', + description: 'Test 3', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'MP', + userAttributes: [ + { + name: 'test1', + }, + ], + config: { + token: 'testToken', + prefixProperties: true, + useNativeSDK: false, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, + { + name: 'mp', + description: 'Test 4', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'MP', + userAttributes: [ + { + userId: 'rudder1', + }, + { + userId: 'rudder2', + }, + { + userId: 'rudder3', + }, + ], + config: { + token: 'test_token', + prefixProperties: true, + useNativeSDK: false, + userDeletionApi: 'task', + gdprApiToken: 'test_gdpr_token', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, + { + name: 'mp', + description: 'Test 5', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'MP', + userAttributes: [ + { + userId: 'rudder1', + }, + ], + config: { + token: 'test_token', + prefixProperties: true, + useNativeSDK: false, + userDeletionApi: 'task', + dataResidency: 'eu', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'GDPR API Token is a required field for creating deletion task in mixpanel', + }, + ], + }, + }, + }, + { + name: 'mp', + description: 'Test 6', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'MP', + userAttributes: [ + { + userId: 'rudder1', + }, + ], + config: { + token: 'test_token', + prefixProperties: true, + useNativeSDK: false, + dataResidency: 'eu', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/mp/network.ts b/test/integrations/destinations/mp/network.ts new file mode 100644 index 0000000000..a386451a21 --- /dev/null +++ b/test/integrations/destinations/mp/network.ts @@ -0,0 +1,1150 @@ +const deleteNwData = [ + { + httpReq: { + method: 'post', + + url: 'https://api.mixpanel.com/engage', + data: [ + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + ], + headers: { + 'Content-Type': 'application/json', + Accept: 'text/plain', + }, + }, + httpRes: { + data: { + code: 400, + message: 'Bad Req', + status: 'Fail Case', + }, + status: 400, + }, + }, + { + httpReq: { + method: 'post', + + url: 'https://api.mixpanel.com/engage', + data: [ + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + { $distinct_id: 'rudder1', $token: 'testToken', $delete: null, $ignore_alias: true }, + ], + headers: { + 'Content-Type': 'application/json', + Accept: 'text/plain', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': '1', + }, + }, + }, + { + httpReq: { + method: 'post', + + url: 'https://api.mixpanel.com/engage', + data: [ + { + $distinct_id: 'rudder1', + $token: 'dummyAccessToken', + $delete: null, + $ignore_alias: true, + }, + { + $distinct_id: 'rudder1', + $token: 'dummyAccessToken', + $delete: null, + $ignore_alias: true, + }, + ], + headers: { + 'Content-Type': 'application/json', + Accept: 'text/plain', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': '1', + }, + }, + }, + { + httpReq: { + method: 'post', + + url: 'https://mixpanel.com/api/app/data-deletions/v3.0/?token=test_token', + data: { + distinct_ids: ['rudder1', 'rudder2', 'rudder3'], + compliance_type: 'CCPA', + }, + headers: { + 'Content-Type': 'application/json', + + Authorization: 'Bearer test_gdpr_token', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': '1', + }, + }, + }, + { + httpReq: { + method: 'post', + + url: 'https://mixpanel.com/api/app/data-deletions/v3.0/?token=test_token', + data: { + distinct_ids: ['rudder2'], + compliance_type: 'GDPR', + }, + headers: { + 'Content-Type': 'application/json', + Accept: 'text/plain', + Authorization: 'Bearer test_gdpr_token', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': '1', + }, + }, + }, + { + httpReq: { + method: 'post', + + url: 'https://api-eu.mixpanel.com/engage', + data: [ + { + $distinct_id: 'rudder1', + $token: 'dummyAccessToken', + $delete: null, + $ignore_alias: true, + }, + ], + headers: { + 'Content-Type': 'application/json', + Accept: 'text/plain', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': '1', + }, + }, + }, +]; +export const networkCallsData = [...deleteNwData]; diff --git a/test/integrations/destinations/optimizely_fullstack/network.ts b/test/integrations/destinations/optimizely_fullstack/network.ts new file mode 100644 index 0000000000..e6a1101ab9 --- /dev/null +++ b/test/integrations/destinations/optimizely_fullstack/network.ts @@ -0,0 +1,206 @@ +const deleteNwData = [ + { + httpReq: { + method: 'get', + url: 'https://cdn.optimizely.com/datafiles/abc.json', + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + accountId: 'test_account_id', + projectId: 'test_project_id', + revision: '45', + attributes: [ + { + id: 'test_attribute_id_1', + key: 'gender', + }, + { + id: 'test_attribute_id_2', + key: 'name', + }, + { + id: 'test_attribute_id_3', + key: 'userId', + }, + { + id: 'test_attribute_id_4', + key: 'anonymousId', + }, + { + id: 'test_attribute_id_5', + key: 'company', + }, + ], + audiences: [ + { + 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"}]', + }, + ], + version: '4', + events: [ + { + id: 'test_event_id_1', + experimentIds: ['test_experiment_id'], + key: 'Product Added', + }, + { + id: 'test_event_id_2', + experimentIds: ['test_experiment_id'], + key: 'Product Removed', + }, + { + id: 'test_event_id_3', + experimentIds: ['test_experiment_id'], + key: 'Order Placed', + }, + { + id: 'test_event_id_4', + experimentIds: ['test_experiment_id'], + key: 'Viewed Meal page', + }, + { + id: 'test_event_id_5', + experimentIds: ['test_experiment_id'], + key: 'Viewed food page', + }, + { + id: 'test_event_id_6', + experimentIds: ['test_experiment_id'], + key: 'Viewed Main screen', + }, + { + id: 'test_event_id_7', + experimentIds: ['test_experiment_id'], + key: 'Home', + }, + { + id: 'test_event_id_8', + experimentIds: ['test_experiment_id'], + key: 'Index', + }, + ], + anonymizeIP: true, + botFiltering: false, + typedAudiences: [], + variables: [], + environmentKey: 'production', + sdkKey: 'test_sdk_key', + featureFlags: [ + { + id: 'test_feature_flag_id', + key: 'testfeature', + experimentIds: ['test_experiment_id'], + rolloutId: 'test_rollout_id', + variables: [ + { + id: 'test_variable_id', + key: 'sort_method', + type: 'string', + defaultValue: 'alphabetical', + }, + ], + }, + ], + rollouts: [ + { + id: 'test_rollout_id', + experiments: [ + { + forcedVariations: {}, + id: 'test_experiment_id', + key: 'test_experiment_key', + status: 'Running', + trafficAllocation: [ + { + entityId: 'test_variation_id', + endOfRange: 10000, + }, + ], + variations: [ + { + id: 'test_variation_id', + key: 'test_variation_key', + variables: [ + { + id: 'test_variable_id', + value: 'alphabetical', + }, + ], + featureEnabled: true, + }, + ], + layerId: 'test_layer_id', + audienceIds: [], + }, + ], + }, + ], + experiments: [ + { + forcedVariations: {}, + id: 'test_experiment_id', + key: 'test_experiment_key', + status: 'Running', + trafficAllocation: [ + { + entityId: 'test_variation_id_1', + endOfRange: 5000, + }, + { + entityId: 'test_variation_id_2', + endOfRange: 10000, + }, + ], + variations: [ + { + id: 'test_variation_id_1', + key: 'variation_1', + variables: [ + { + id: 'test_variable_id', + value: 'popular_first', + }, + ], + featureEnabled: true, + }, + { + id: 'test_variation_id_2', + key: 'variation_2', + variables: [ + { + id: 'test_variable_id', + value: 'popular_first', + }, + ], + featureEnabled: true, + }, + ], + layerId: 'test_layer_id', + audienceIds: [], + }, + ], + groups: [], + }, + }, + }, + { + httpReq: { + method: 'get', + url: 'https://cdn.optimizely.com/datafiles/wrong_cdn.json', + }, + httpRes: { + status: 404, + statusText: 'Not Found', + data: { + code: 'document_not_found', + message: 'document_not_found', + }, + }, + }, +]; +export const networkCallsData = [...deleteNwData]; diff --git a/test/integrations/destinations/optimizely_fullstack/processor/data.ts b/test/integrations/destinations/optimizely_fullstack/processor/data.ts new file mode 100644 index 0000000000..47ce3314fd --- /dev/null +++ b/test/integrations/destinations/optimizely_fullstack/processor/data.ts @@ -0,0 +1,2170 @@ +import utils from '../../../../../src/v0/util'; +export const mockFns = (_) => { + // @ts-ignore + jest.spyOn(utils, 'generateUUID').mockImplementation(() => 'generated_uuid'); +}; +export const data = [ + { + name: 'optimizely_fullstack', + description: 'Missing Data File URL', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + channel: 'web', + properties: {}, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + }, + }, + metadata: { + jobId: 1, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Data File Url is not present. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Data File Url is not present. Aborting', + statTags: { + destType: 'OPTIMIZELY_FULLSTACK', + errorCategory: 'platform', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + metadata: { + jobId: 1, + }, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Identify call: Missing Variation ID in integration object', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + channel: 'web', + properties: {}, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campagin_id', + experimentId: 'test_experiment_id', + }, + }, + metadata: { + jobId: 2, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Variation ID is not present in the integrations object: Workflow: procWorkflow, Step: validateInputForIdentify, ChildStep: undefined, OriginalError: Variation ID is not present in the integrations object', + statTags: { + destType: 'OPTIMIZELY_FULLSTACK', + errorCategory: 'platform', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + metadata: { + jobId: 2, + }, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Missing Account ID', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + channel: 'web', + properties: {}, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + campaignId: 'test_campagin_id', + experimentId: 'test_experiment_id', + }, + }, + metadata: { + jobId: 3, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Account ID is not present. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Account ID is not present. Aborting', + statTags: { + destType: 'OPTIMIZELY_FULLSTACK', + errorCategory: 'platform', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + metadata: { + jobId: 3, + }, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Missing Campaign ID', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + channel: 'web', + properties: {}, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + experimentId: 'test_experiment_id', + }, + }, + metadata: { + jobId: 4, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Campaign ID is not present. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Campaign ID is not present. Aborting', + statTags: { + destType: 'OPTIMIZELY_FULLSTACK', + errorCategory: 'platform', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + metadata: { + jobId: 4, + }, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Missing Experiment ID', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + channel: 'web', + properties: {}, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campagin_id', + }, + }, + metadata: { + jobId: 5, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Experiment ID is not present. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Experiment ID is not present. Aborting', + statTags: { + destType: 'OPTIMIZELY_FULLSTACK', + errorCategory: 'platform', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + metadata: { + jobId: 5, + }, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Page: Track Categorized Page and Track Named Pages toggle are disabled', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + channel: 'web', + name: 'Home', + properties: {}, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + optimizely_fullstack: { + variationId: '123', + }, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campagin_id', + experimentId: 'test_experiment_id', + trackCategorizedPages: false, + trackNamedPages: false, + }, + }, + metadata: { + jobId: 6, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + "Both 'Track Categorized Pages' and 'Track Named Pages' toggles are disabled in webapp. Please enable at one of them to send page/screen events to Optimizely.: Workflow: procWorkflow, Step: validateInputForPageAndScreen, ChildStep: undefined, OriginalError: Both 'Track Categorized Pages' and 'Track Named Pages' toggles are disabled in webapp. Please enable at one of them to send page/screen events to Optimizely.", + statTags: { + destType: 'OPTIMIZELY_FULLSTACK', + errorCategory: 'platform', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + metadata: { + jobId: 6, + }, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: + 'Invalid Configuration (Track known users toggle is on and userId is missing in request)', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + channel: 'web', + event: 'Product Added', + properties: { + price: 999, + quantity: 1, + }, + context: { + traits: { + firstName: 'John', + age: 27, + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + optimizely_fullstack: { + variationId: '123', + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campagin_id', + experimentId: 'test_experiment_id', + trackCategorizedPages: false, + trackNamedPages: false, + trackKnownUsers: true, + }, + }, + metadata: { + jobId: 7, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + "UserId is required for event tracking when the 'Track Known Users' setting is enabled. Please include a 'userId' in your event payload: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: UserId is required for event tracking when the 'Track Known Users' setting is enabled. Please include a 'userId' in your event payload", + statTags: { + destType: 'OPTIMIZELY_FULLSTACK', + errorCategory: 'platform', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + metadata: { + jobId: 7, + }, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Track call without event', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + channel: 'web', + properties: {}, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campagin_id', + experimentId: 'test_experiment_id', + }, + }, + metadata: { + jobId: 9, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Event is not present. Aborting.: Workflow: procWorkflow, Step: validateInputForTrack, ChildStep: undefined, OriginalError: Event is not present. Aborting.', + statTags: { + destType: 'OPTIMIZELY_FULLSTACK', + errorCategory: 'platform', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + metadata: { + jobId: 9, + }, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Invalid data file url', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Product Added', + channel: 'web', + properties: {}, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/wrong_cdn.json', + accountId: 'test_account_id', + campaignId: 'test_campagin_id', + experimentId: 'test_experiment_id', + }, + }, + metadata: { + jobId: 10, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + '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"}', + statTags: { + destType: 'OPTIMIZELY_FULLSTACK', + errorCategory: 'platform', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + metadata: { + jobId: 10, + }, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Event not present in data-file', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Product Added', + channel: 'web', + properties: {}, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + optimizely_fullstack: { + variationId: '123', + }, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campagin_id', + experimentId: 'test_experiment_id', + eventMapping: [ + { + from: 'Product Added', + to: 'product_added', + }, + ], + }, + }, + metadata: { + jobId: 11, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + "Event 'product_added' is not present in data file. Make sure event exists in Optimizely.: Workflow: procWorkflow, Step: prepareTrackPayload, ChildStep: optimizelyEvent, OriginalError: Event 'product_added' is not present in data file. Make sure event exists in Optimizely.", + statTags: { + destType: 'OPTIMIZELY_FULLSTACK', + errorCategory: 'platform', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + metadata: { + jobId: 11, + }, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Identify call (Decision Event) with userId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + channel: 'web', + properties: {}, + context: { + traits: { + organization: 'RudderStack', + fullName: 'John Doe', + country: 'US', + }, + sessionId: 1685626914716, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + timestamp: '2023-02-10T12:16:07.251Z', + userId: 'userId123', + integrations: { + All: true, + optimizely_fullstack: { + variationId: 'test_variation_id_1', + }, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + attributeMapping: [ + { + from: 'organization', + to: 'company', + }, + { + from: 'fullName', + to: 'name', + }, + ], + }, + }, + metadata: { + jobId: 12, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 12 }, + output: { + body: { + FORM: {}, + JSON: { + account_id: 'test_account_id', + anonymize_ip: false, + client_name: 'RudderStack', + client_version: '1.0.0', + enrich_decisions: true, + visitors: [ + { + attributes: [ + { + entity_id: 'test_attribute_id_5', + key: 'company', + type: 'custom', + value: 'RudderStack', + }, + { + entity_id: 'test_attribute_id_2', + key: 'name', + type: 'custom', + value: 'John Doe', + }, + ], + session_id: '1685626914716', + snapshots: [ + { + decisions: [ + { + campaign_id: 'test_campaign_id', + experiment_id: 'test_experiment_id', + variation_id: 'test_variation_id_1', + }, + ], + events: [ + { + entity_id: 'test_campaign_id', + timestamp: 1676031367251, + type: 'campaign_activated', + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + }, + ], + }, + ], + visitor_id: 'userId123', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://logx.optimizely.com/v1/events', + files: {}, + headers: { 'Content-Type': 'application/json' }, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + ], + }, + }, + }, + + { + name: 'optimizely_fullstack', + description: 'Identify call (Decision Event) with anonymousId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + channel: 'web', + properties: {}, + context: { + traits: { + organization: 'RudderStack', + fullName: 'John Doe', + country: 'US', + }, + sessionId: 1685626914716, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + timestamp: '2023-02-10T12:16:07.251Z', + userId: 'userId123', + integrations: { + All: true, + optimizely_fullstack: { + variationId: 'test_variation_id_1', + }, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: false, + }, + }, + metadata: { + jobId: 13, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 13 }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: false, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: '97c46c81-3140-456d-b2a9-690d70aaca35', + snapshots: [ + { + decisions: [ + { + campaign_id: 'test_campaign_id', + experiment_id: 'test_experiment_id', + variation_id: 'test_variation_id_1', + }, + ], + events: [ + { + entity_id: 'test_campaign_id', + type: 'campaign_activated', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + userId: '', + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Identify call (Decision Event) with projectId is empty"', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + channel: 'web', + properties: {}, + context: { + traits: { + organization: 'RudderStack', + fullName: 'John Doe', + country: 'US', + }, + sessionId: 1685626914716, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + timestamp: '2023-02-10T12:16:07.251Z', + userId: 'userId123', + integrations: { + All: true, + optimizely_fullstack: { + variationId: 'test_variation_id_1', + }, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + projectId: '', + attributeMapping: [ + { + from: 'organization', + to: 'company', + }, + { + from: 'fullName', + to: 'name', + }, + ], + }, + }, + metadata: { + jobId: 14, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 14 }, + output: { + version: '1', + type: 'REST', + method: 'POST', + userId: '', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: false, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: 'userId123', + attributes: [ + { + entity_id: 'test_attribute_id_5', + key: 'company', + type: 'custom', + value: 'RudderStack', + }, + { + entity_id: 'test_attribute_id_2', + key: 'name', + type: 'custom', + value: 'John Doe', + }, + ], + snapshots: [ + { + decisions: [ + { + campaign_id: 'test_campaign_id', + experiment_id: 'test_experiment_id', + variation_id: 'test_variation_id_1', + }, + ], + events: [ + { + entity_id: 'test_campaign_id', + type: 'campaign_activated', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Track Named Page: mapping is not provided for page name in webapp', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + userId: 'userId123', + name: 'Meal', + channel: 'web', + context: { + traits: { + organization: 'RudderStack', + fullName: 'John Doe', + }, + sessionId: 1685626914716, + }, + rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + timestamp: '2023-02-10T12:16:07.251Z', + properties: { + foo: 'bar', + }, + anonymousId: '856365b8-da4b-4c13-9098-84df18559446', + integrations: { + All: true, + optimizely_fullstack: { + variationId: 'test_variation_id_1', + }, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + trackCategorizedPages: false, + trackNamedPages: true, + pageMapping: [ + { + from: 'Home', + to: 'Viewed Home Page', + }, + { + from: 'food', + to: 'Product Added', + }, + ], + }, + }, + metadata: { + jobId: 15, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 15 }, + statTags: { + destType: 'OPTIMIZELY_FULLSTACK', + errorCategory: 'platform', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + error: + 'Events [meal] are not present in the data file. Make sure events exist in Optimizely.: Workflow: procWorkflow, Step: preparePageOrScreenPayload, ChildStep: optimizelyEvents, OriginalError: Events [meal] are not present in the data file. Make sure events exist in Optimizely.', + }, + ], + }, + }, + }, + + { + name: 'optimizely_fullstack', + description: 'Track call (Conversion event) with userId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'product_added', + userId: 'userId123', + channel: 'web', + context: { + traits: { organization: 'RudderStack', fullName: 'John Doe' }, + sessionId: 1685626914716, + }, + rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + timestamp: '2023-02-10T12:16:07.251Z', + properties: { foo: 'bar', revenue: 123, quantity: 2 }, + anonymousId: '856365b8-da4b-4c13-9098-84df18559446', + integrations: { + All: true, + optimizely_fullstack: { variationId: 'test_variation_id_2' }, + }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + eventMapping: [ + { from: 'Product Searched', to: 'Searched' }, + { from: 'product_added', to: 'Product Added' }, + ], + attributeMapping: [ + { from: 'organization', to: 'company' }, + { from: 'fullName', to: 'name' }, + ], + }, + }, + metadata: { jobId: 20 }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 20 }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: true, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: 'userId123', + attributes: [ + { + entity_id: 'test_attribute_id_5', + key: 'company', + type: 'custom', + value: 'RudderStack', + }, + { + entity_id: 'test_attribute_id_2', + key: 'name', + type: 'custom', + value: 'John Doe', + }, + ], + snapshots: [ + { + decisions: [], + events: [ + { + entity_id: 'test_event_id_1', + key: 'Product Added', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + quantity: 2, + revenue: 12300, + tags: { foo: 'bar' }, + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Track call (Conversion event) without event mapping configured in webapp', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Product Added', + channel: 'web', + properties: {}, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + timestamp: '2023-02-10T12:16:07.251Z', + integrations: { All: true, optimizely_fullstack: { variationId: '123' } }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campagin_id', + experimentId: 'test_experiment_id', + }, + }, + metadata: { jobId: 21 }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 21 }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: false, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: '97c46c81-3140-456d-b2a9-690d70aaca35', + snapshots: [ + { + decisions: [], + events: [ + { + entity_id: 'test_event_id_1', + key: 'Product Added', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + tags: {}, + }, + ], + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Track call: Missing Variation ID in integration object ', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'product_added', + userId: 'userId123', + channel: 'web', + context: { + traits: { organization: 'RudderStack', fullName: 'John Doe' }, + sessionId: 1685626914716, + }, + rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + timestamp: '2023-02-10T12:16:07.251Z', + properties: { foo: 'bar', revenue: 123, quantity: 2 }, + anonymousId: '856365b8-da4b-4c13-9098-84df18559446', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + eventMapping: [ + { from: 'Product Searched', to: 'Searched' }, + { from: 'product_added', to: 'Product Added' }, + ], + attributeMapping: [ + { from: 'organization', to: 'company' }, + { from: 'fullName', to: 'name' }, + ], + }, + }, + metadata: { jobId: 22 }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 22 }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: true, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: 'userId123', + attributes: [ + { + entity_id: 'test_attribute_id_5', + key: 'company', + type: 'custom', + value: 'RudderStack', + }, + { + entity_id: 'test_attribute_id_2', + key: 'name', + type: 'custom', + value: 'John Doe', + }, + ], + snapshots: [ + { + decisions: [], + events: [ + { + entity_id: 'test_event_id_1', + key: 'Product Added', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + quantity: 2, + revenue: 12300, + tags: { foo: 'bar' }, + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Track Categorized and Named Page', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + name: 'Meal', + userId: 'userId123', + channel: 'web', + context: { + traits: { organization: 'RudderStack', fullName: 'John Doe' }, + sessionId: 1685626914716, + }, + rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + timestamp: '2023-02-10T12:16:07.251Z', + properties: { foo: 'bar', category: 'food' }, + anonymousId: '856365b8-da4b-4c13-9098-84df18559446', + integrations: { + All: true, + optimizely_fullstack: { variationId: 'test_variation_id_1' }, + }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + trackCategorizedPages: true, + trackNamedPages: true, + pageMapping: [ + { from: 'meal', to: 'Viewed Meal Page' }, + { from: 'food', to: 'Product Added' }, + ], + }, + }, + metadata: { jobId: 23 }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 23 }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: true, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: 'userId123', + snapshots: [ + { + decisions: [], + events: [ + { + entity_id: 'test_event_id_1', + key: 'Product Added', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + tags: { foo: 'bar', category: 'food' }, + }, + { + entity_id: 'test_event_id_4', + key: 'Viewed Meal page', + timestamp: 1676031367251, + uuid: 'generated_uuid', + tags: { foo: 'bar', category: 'food' }, + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Track Categorized and Named Page without event mapping configured in webapp', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + name: 'home', + userId: 'userId123', + channel: 'web', + context: { + traits: { organization: 'RudderStack', fullName: 'John Doe' }, + sessionId: 1685626914716, + }, + rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + timestamp: '2023-02-10T12:16:07.251Z', + properties: { foo: 'bar', category: 'index' }, + anonymousId: '856365b8-da4b-4c13-9098-84df18559446', + integrations: { + All: true, + optimizely_fullstack: { variationId: 'test_variation_id_1' }, + }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + trackCategorizedPages: true, + trackNamedPages: true, + pageMapping: [{ from: '', to: '' }], + }, + }, + metadata: { jobId: 24 }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 24 }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: true, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: 'userId123', + snapshots: [ + { + decisions: [], + events: [ + { + entity_id: 'test_event_id_8', + key: 'Index', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + tags: { foo: 'bar', category: 'index' }, + }, + { + entity_id: 'test_event_id_7', + key: 'Home', + timestamp: 1676031367251, + uuid: 'generated_uuid', + tags: { foo: 'bar', category: 'index' }, + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: + 'Track Categorized Page: trackCategorizedPages,trackNamedPages toggle are enabled and name is not provided', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + userId: 'userId123', + channel: 'web', + context: { + traits: { organization: 'RudderStack', fullName: 'John Doe' }, + sessionId: 1685626914716, + }, + rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + timestamp: '2023-02-10T12:16:07.251Z', + properties: { foo: 'bar', category: 'food' }, + anonymousId: '856365b8-da4b-4c13-9098-84df18559446', + integrations: { + All: true, + optimizely_fullstack: { variationId: 'test_variation_id_1' }, + }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + trackCategorizedPages: true, + trackNamedPages: true, + pageMapping: [ + { from: 'meal', to: 'Viewed Meal Page' }, + { from: 'food', to: 'Product Added' }, + ], + }, + }, + metadata: { jobId: 25 }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 25 }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: true, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: 'userId123', + snapshots: [ + { + decisions: [], + events: [ + { + entity_id: 'test_event_id_1', + key: 'Product Added', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + tags: { foo: 'bar', category: 'food' }, + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: + 'Track Named Page: trackCategorizedPages,trackNamedPages toggle are enabled and category is not provided', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + userId: 'userId123', + name: 'Meal', + channel: 'web', + context: { + traits: { organization: 'RudderStack', fullName: 'John Doe' }, + sessionId: 1685626914716, + }, + rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + timestamp: '2023-02-10T12:16:07.251Z', + properties: { foo: 'bar' }, + anonymousId: '856365b8-da4b-4c13-9098-84df18559446', + integrations: { + All: true, + optimizely_fullstack: { variationId: 'test_variation_id_1' }, + }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + trackCategorizedPages: true, + trackNamedPages: true, + pageMapping: [ + { from: 'meal', to: 'Viewed Meal Page' }, + { from: 'food', to: 'Product Added' }, + ], + }, + }, + metadata: { jobId: 26 }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 26 }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: true, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: 'userId123', + snapshots: [ + { + decisions: [], + events: [ + { + entity_id: 'test_event_id_4', + key: 'Viewed Meal page', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + tags: { foo: 'bar' }, + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: + 'Track Named Page: trackCategorizedPages,trackNamedPages toggle are enabled and category mapping is wrong', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + userId: 'userId123', + name: 'Meal', + channel: 'web', + context: { + traits: { organization: 'RudderStack', fullName: 'John Doe' }, + sessionId: 1685626914716, + }, + rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + timestamp: '2023-02-10T12:16:07.251Z', + properties: { foo: 'bar' }, + anonymousId: '856365b8-da4b-4c13-9098-84df18559446', + integrations: { + All: true, + optimizely_fullstack: { variationId: 'test_variation_id_1' }, + }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + trackCategorizedPages: true, + trackNamedPages: true, + pageMapping: [ + { from: 'meal', to: 'Viewed Meal Page' }, + { from: 'food', to: 'ABC' }, + ], + }, + }, + metadata: { jobId: 27 }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 27 }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: true, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: 'userId123', + snapshots: [ + { + decisions: [], + events: [ + { + entity_id: 'test_event_id_4', + key: 'Viewed Meal page', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + tags: { foo: 'bar' }, + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'optimizely_fullstack', + description: 'Track Categorized and Named Screen', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'screen', + name: 'Home', + userId: 'userId123', + channel: 'web', + context: { + traits: { organization: 'RudderStack', fullName: 'John Doe' }, + sessionId: 1685626914716, + }, + rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + timestamp: '2023-02-10T12:16:07.251Z', + properties: { foo: 'bar', category: 'food' }, + anonymousId: '856365b8-da4b-4c13-9098-84df18559446', + integrations: { + All: true, + optimizely_fullstack: { variationId: 'test_variation_id_1' }, + }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + trackCategorizedPages: true, + trackNamedPages: true, + pageMapping: [ + { from: 'home', to: 'Viewed Main Screen' }, + { from: 'food', to: 'Product Added' }, + ], + }, + }, + metadata: { jobId: 28 }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { jobId: 28 }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: true, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: 'userId123', + snapshots: [ + { + decisions: [], + events: [ + { + entity_id: 'test_event_id_1', + key: 'Product Added', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + tags: { foo: 'bar', category: 'food' }, + }, + { + entity_id: 'test_event_id_6', + key: 'Viewed Main screen', + timestamp: 1676031367251, + uuid: 'generated_uuid', + tags: { foo: 'bar', category: 'food' }, + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, +].map((d) => ({ ...d, mockFns })); diff --git a/test/integrations/destinations/optimizely_fullstack/router/data.ts b/test/integrations/destinations/optimizely_fullstack/router/data.ts new file mode 100644 index 0000000000..1803881f30 --- /dev/null +++ b/test/integrations/destinations/optimizely_fullstack/router/data.ts @@ -0,0 +1,563 @@ +import { FEATURES } from '../../../../../src/v0/util/tags'; +import { mockFns } from '../processor/data'; + +export const data = [ + { + name: 'optimizely_fullstack', + description: 'Test 0', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + type: 'identify', + channel: 'web', + properties: {}, + context: { + traits: { + organization: 'RudderStack', + fullName: 'John Doe', + country: 'US', + }, + sessionId: 1685626914716, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + timestamp: '2023-02-10T12:16:07.251Z', + userId: 'userId123', + integrations: { + All: true, + optimizely_fullstack: { + variationId: 'test_variation_id_1', + }, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + attributeMapping: [ + { + from: 'organization', + to: 'company', + }, + { + from: 'fullName', + to: 'name', + }, + ], + }, + }, + metadata: { + jobId: 1, + }, + }, + { + message: { + type: 'track', + event: 'product_added', + userId: 'userId123', + channel: 'web', + context: { + traits: { + organization: 'RudderStack', + fullName: 'John Doe', + }, + sessionId: 1685626914716, + }, + rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + timestamp: '2023-02-10T12:16:07.251Z', + properties: { + foo: 'bar', + revenue: 123, + quantity: 2, + }, + anonymousId: '856365b8-da4b-4c13-9098-84df18559446', + integrations: { + All: true, + optimizely_fullstack: { + variationId: 'test_variation_id_2', + }, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + eventMapping: [ + { + from: 'Product Searched', + to: 'Searched', + }, + { + from: 'product_added', + to: 'Product Added', + }, + ], + attributeMapping: [ + { + from: 'organization', + to: 'company', + }, + { + from: 'fullName', + to: 'name', + }, + ], + }, + }, + metadata: { + jobId: 2, + }, + }, + { + message: { + type: 'page', + userId: 'userId123', + channel: 'web', + context: { + traits: { + organization: 'RudderStack', + fullName: 'John Doe', + }, + sessionId: 1685626914716, + }, + rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + timestamp: '2023-02-10T12:16:07.251Z', + properties: { + foo: 'bar', + category: 'food', + }, + anonymousId: '856365b8-da4b-4c13-9098-84df18559446', + integrations: { + All: true, + optimizely_fullstack: { + variationId: 'test_variation_id_1', + }, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + trackCategorizedPages: true, + trackNamedPages: false, + pageMapping: [ + { + from: 'meal', + to: 'Viewed Meal Page', + }, + { + from: 'food', + to: 'Product Added', + }, + ], + }, + }, + metadata: { + jobId: 3, + }, + }, + { + message: { + type: 'page', + channel: 'web', + name: 'Home', + properties: {}, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + optimizely_fullstack: { + variationId: '123', + }, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campagin_id', + experimentId: 'test_experiment_id', + trackCategorizedPages: false, + trackNamedPages: false, + }, + }, + metadata: { + jobId: 4, + }, + }, + ], + destType: 'optimizely_fullstack', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: false, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: 'userId123', + attributes: [ + { + entity_id: 'test_attribute_id_5', + key: 'company', + type: 'custom', + value: 'RudderStack', + }, + { + entity_id: 'test_attribute_id_2', + key: 'name', + type: 'custom', + value: 'John Doe', + }, + ], + snapshots: [ + { + decisions: [ + { + campaign_id: 'test_campaign_id', + experiment_id: 'test_experiment_id', + variation_id: 'test_variation_id_1', + }, + ], + events: [ + { + entity_id: 'test_campaign_id', + type: 'campaign_activated', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + attributeMapping: [ + { + from: 'organization', + to: 'company', + }, + { + from: 'fullName', + to: 'name', + }, + ], + }, + }, + metadata: [ + { + jobId: 1, + }, + ], + statusCode: 200, + }, + { + batched: false, + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: true, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: 'userId123', + attributes: [ + { + entity_id: 'test_attribute_id_5', + key: 'company', + type: 'custom', + value: 'RudderStack', + }, + { + entity_id: 'test_attribute_id_2', + key: 'name', + type: 'custom', + value: 'John Doe', + }, + ], + snapshots: [ + { + decisions: [], + events: [ + { + entity_id: 'test_event_id_1', + key: 'Product Added', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + quantity: 2, + revenue: 12300, + tags: { + foo: 'bar', + }, + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + eventMapping: [ + { + from: 'Product Searched', + to: 'Searched', + }, + { + from: 'product_added', + to: 'Product Added', + }, + ], + attributeMapping: [ + { + from: 'organization', + to: 'company', + }, + { + from: 'fullName', + to: 'name', + }, + ], + }, + }, + metadata: [ + { + jobId: 2, + }, + ], + statusCode: 200, + }, + { + batched: false, + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://logx.optimizely.com/v1/events', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + account_id: 'test_account_id', + anonymize_ip: true, + enrich_decisions: true, + client_name: 'RudderStack', + client_version: '1.0.0', + visitors: [ + { + visitor_id: 'userId123', + snapshots: [ + { + decisions: [], + events: [ + { + entity_id: 'test_event_id_1', + key: 'Product Added', + timestamp: 1676031367251, + uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + tags: { + foo: 'bar', + category: 'food', + }, + }, + ], + }, + ], + session_id: '1685626914716', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + accountId: 'test_account_id', + campaignId: 'test_campaign_id', + experimentId: 'test_experiment_id', + trackKnownUsers: true, + anonymizeIp: true, + trackCategorizedPages: true, + trackNamedPages: false, + pageMapping: [ + { + from: 'meal', + to: 'Viewed Meal Page', + }, + { + from: 'food', + to: 'Product Added', + }, + ], + }, + }, + metadata: [ + { + jobId: 3, + }, + ], + statusCode: 200, + }, + { + batched: false, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + accountId: 'test_account_id', + campaignId: 'test_campagin_id', + dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json', + experimentId: 'test_experiment_id', + trackCategorizedPages: false, + trackNamedPages: false, + }, + }, + error: + "Both 'Track Categorized Pages' and 'Track Named Pages' toggles are disabled in webapp. Please enable at one of them to send page/screen events to Optimizely.", + metadata: [ + { + jobId: 4, + }, + ], + statTags: { + destType: 'OPTIMIZELY_FULLSTACK', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'router', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + mockFns, + }, +]; diff --git a/test/integrations/destinations/pardot/network.ts b/test/integrations/destinations/pardot/network.ts new file mode 100644 index 0000000000..bbbe0d70f9 --- /dev/null +++ b/test/integrations/destinations/pardot/network.ts @@ -0,0 +1,440 @@ +import { enhanceRequestOptions, getFormData } from '../../../../src/adapters/network'; + +export const networkCallsData = [ + // 2nd proxy test-case + { + httpReq: { + url: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/email/Roger_12@waltair.io', + data: getFormData({ + first_name: 'Roger_12', + last_name: 'Federer_12', + website: 'https://rudderstack.com', + score: 14, + campaign_id: 42213, + format: 'json', + }).toString(), + params: { destination: 'pardot' }, + headers: { + Authorization: 'Bearer myToken', + 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8', + 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + '@attributes': { + stat: 'ok', + version: 1, + }, + prospect: { + id: 123435, + campaign_id: 42213, + salutation: null, + first_name: 'Roger_12', + last_name: 'Federer_12', + email: 'Roger_12@waltair.io', + password: null, + company: null, + website: 'https://rudderstack.com', + job_title: null, + department: null, + country: 'AU', + address_one: null, + address_two: null, + city: null, + state: null, + territory: null, + zip: null, + phone: null, + fax: null, + source: null, + annual_revenue: null, + employees: null, + industry: null, + years_in_business: null, + comments: null, + notes: null, + score: 14, + grade: null, + last_activity_at: null, + recent_interaction: 'Never active.', + crm_lead_fid: null, + crm_contact_fid: null, + crm_owner_fid: '00G2v000004WYXaEAO', + crm_account_fid: null, + salesforce_fid: null, + crm_last_sync: null, + crm_url: null, + is_do_not_email: null, + is_do_not_call: null, + opted_out: null, + is_reviewed: 1, + is_starred: null, + created_at: '2022-01-21 18:21:46', + updated_at: '2022-01-21 18:48:41', + campaign: { + id: 42113, + name: 'Test', + crm_fid: '7012y000000MNOCLL4', + }, + assigned_to: { + user: { + id: 38443703, + email: 'test_rudderstack@testcompany.com', + first_name: 'Rudderstack', + last_name: 'User', + job_title: null, + role: 'Administrator', + account: 489853, + created_at: '2021-02-26 06:25:17', + updated_at: '2021-02-26 06:25:17', + }, + }, + Are_you_shipping_large_fragile_or_bulky_items: false, + Calendly: false, + Country_Code: 'AU', + Currency: 'AUD', + Inventory_or_Warehouse_Management_System: false, + Lead_Status: 'New', + Marketing_Stage: 'SAL', + Record_Type_ID: 'TestCompany Lead', + profile: { + id: 304, + name: 'Default', + profile_criteria: [ + { + id: 1500, + name: 'Shipping Volume', + matches: 'Unknown', + }, + { + id: 1502, + name: 'Industry', + matches: 'Unknown', + }, + { + id: 1506, + name: 'Job Title', + matches: 'Unknown', + }, + { + id: 1508, + name: 'Department', + matches: 'Unknown', + }, + ], + }, + visitors: null, + visitor_activities: null, + lists: null, + }, + }, + status: 201, + statusText: 'Created', + }, + }, + // 4th proxy test-case + { + httpReq: { + url: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/email/rolex_waltair@mywebsite.io', + data: getFormData({ + first_name: 'Rolex', + last_name: 'Waltair', + website: 'https://rudderstack.com', + score: 15, + campaign_id: 42213, + format: 'json', + }).toString(), + params: { destination: 'pardot' }, + headers: { + Authorization: 'Bearer myExpiredToken', + 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8', + 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + '@attributes': { + stat: 'fail', + version: 1, + err_code: 184, + }, + err: 'access_token is invalid, unknown, or malformed: Inactive token', + }, + status: 401, + statusText: 'Unauthorized', + }, + }, + // 1st proxy test-case + { + httpReq: { + url: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/id/123435', + data: getFormData({ + first_name: 'Roger12', + last_name: 'Federer12', + website: 'https://rudderstack.com', + score: 14, + campaign_id: 42213, + format: 'json', + }).toString(), + params: { destination: 'pardot' }, + headers: { + Authorization: 'Bearer myToken', + 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8', + 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + '@attributes': { + stat: 'ok', + version: 1, + }, + prospect: { + id: 123435, + campaign_id: 42213, + salutation: null, + first_name: 'Roger12', + last_name: 'Federer12', + email: 'Roger12@waltair.io', + password: null, + company: null, + website: 'https://rudderstack.com', + job_title: null, + department: null, + country: 'AU', + address_one: null, + address_two: null, + city: null, + state: null, + territory: null, + zip: null, + phone: null, + fax: null, + source: null, + annual_revenue: null, + employees: null, + industry: null, + years_in_business: null, + comments: null, + notes: null, + score: 14, + grade: null, + last_activity_at: null, + recent_interaction: 'Never active.', + crm_lead_fid: null, + crm_contact_fid: null, + crm_owner_fid: '00G2v000004WYXaEAO', + crm_account_fid: null, + salesforce_fid: null, + crm_last_sync: null, + crm_url: null, + is_do_not_email: null, + is_do_not_call: null, + opted_out: null, + is_reviewed: 1, + is_starred: null, + created_at: '2022-01-21 18:21:46', + updated_at: '2022-01-21 18:48:41', + campaign: { + id: 42113, + name: 'Test', + crm_fid: '7012y000000MNOCLL4', + }, + assigned_to: { + user: { + id: 38443703, + email: 'test_rudderstack@testcompany.com', + first_name: 'Rudderstack', + last_name: 'User', + job_title: null, + role: 'Administrator', + account: 489853, + created_at: '2021-02-26 06:25:17', + updated_at: '2021-02-26 06:25:17', + }, + }, + Are_you_shipping_large_fragile_or_bulky_items: false, + Calendly: false, + Country_Code: 'AU', + Currency: 'AUD', + Inventory_or_Warehouse_Management_System: false, + Lead_Status: 'New', + Marketing_Stage: 'SAL', + Record_Type_ID: 'TestCompany Lead', + profile: { + id: 304, + name: 'Default', + profile_criteria: [ + { + id: 1500, + name: 'Shipping Volume', + matches: 'Unknown', + }, + { + id: 1502, + name: 'Industry', + matches: 'Unknown', + }, + { + id: 1506, + name: 'Job Title', + matches: 'Unknown', + }, + { + id: 1508, + name: 'Department', + matches: 'Unknown', + }, + ], + }, + visitors: null, + visitor_activities: null, + lists: null, + }, + }, + status: 200, + statusText: 'OK', + }, + }, + // 3rd proxy test-case + { + httpReq: { + url: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/fid/00Q6r000002LKhTPVR', + data: getFormData({ + first_name: 'Nick', + last_name: 'Kyrgios', + website: 'https://rudderstack.com', + score: 12, + campaign_id: 42213, + format: 'json', + }).toString(), + params: { destination: 'pardot' }, + headers: { + Authorization: 'Bearer myToken', + 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8', + 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + '@attributes': { + stat: 'ok', + version: 1, + }, + prospect: { + id: 123435, + campaign_id: 42213, + salutation: null, + first_name: 'Roger_12', + last_name: 'Federer_12', + email: 'Roger_12@federer.io', + password: null, + company: null, + website: 'https://rudderstack.com', + job_title: null, + department: null, + country: 'AU', + address_one: null, + address_two: null, + city: null, + state: null, + territory: null, + zip: null, + phone: null, + fax: null, + source: null, + annual_revenue: null, + employees: null, + industry: null, + years_in_business: null, + comments: null, + notes: null, + score: 14, + grade: null, + last_activity_at: null, + recent_interaction: 'Never active.', + crm_lead_fid: '00Q6r000002LKhTPVR', + crm_contact_fid: null, + crm_owner_fid: '00G2v000004WYXaEAO', + crm_account_fid: null, + salesforce_fid: '00Q6r000002LKhTPVR', + crm_last_sync: '2022-01-21 18:47:37', + crm_url: 'https://testcompany.my.salesforce.com/00Q6r000002LKhTPVR', + is_do_not_email: null, + is_do_not_call: null, + opted_out: null, + is_reviewed: 1, + is_starred: null, + created_at: '2022-01-21 18:21:46', + updated_at: '2022-01-21 18:48:41', + campaign: { + id: 42113, + name: 'Test', + crm_fid: '7012y000000MNOCLL4', + }, + assigned_to: { + user: { + id: 38443703, + email: 'test_rudderstack@testcompany.com', + first_name: 'Rudderstack', + last_name: 'User', + job_title: null, + role: 'Administrator', + account: 489853, + created_at: '2021-02-26 06:25:17', + updated_at: '2021-02-26 06:25:17', + }, + }, + Are_you_shipping_large_fragile_or_bulky_items: false, + Calendly: false, + Country_Code: 'AU', + Currency: 'AUD', + Inventory_or_Warehouse_Management_System: false, + Lead_Status: 'New', + Marketing_Stage: 'SAL', + Record_Type_ID: 'TestCompany Lead', + profile: { + id: 304, + name: 'Default', + profile_criteria: [ + { + id: 1500, + name: 'Shipping Volume', + matches: 'Unknown', + }, + { + id: 1502, + name: 'Industry', + matches: 'Unknown', + }, + { + id: 1506, + name: 'Job Title', + matches: 'Unknown', + }, + { + id: 1508, + name: 'Department', + matches: 'Unknown', + }, + ], + }, + visitors: null, + visitor_activities: null, + lists: null, + }, + }, + status: 200, + statusText: 'OK', + }, + }, +]; diff --git a/test/integrations/destinations/pardot/router/data.ts b/test/integrations/destinations/pardot/router/data.ts index 28680deafc..7c2a2a11e3 100644 --- a/test/integrations/destinations/pardot/router/data.ts +++ b/test/integrations/destinations/pardot/router/data.ts @@ -1,3 +1,5 @@ +import { FEATURES, MODULES } from '../../../../../src/v0/util/tags'; + export const data = [ { name: 'pardot', @@ -1014,4 +1016,555 @@ export const data = [ }, }, }, + { + name: 'pardot', + description: 'Test proxy - 0', + feature: FEATURES.DATA_DELIVERY, + module: MODULES.DESTINATION, + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/id/123435', + headers: { + Authorization: 'Bearer myToken', + 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', + }, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: { + first_name: 'Roger12', + last_name: 'Federer12', + website: 'https://rudderstack.com', + score: 14, + campaign_id: 42213, + }, + }, + files: {}, + params: { + destination: 'pardot', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + message: 'Request Processed Successfully', + status: 200, + destinationResponse: { + response: { + '@attributes': { + stat: 'ok', + version: 1, + }, + prospect: { + id: 123435, + campaign_id: 42213, + salutation: null, + first_name: 'Roger12', + last_name: 'Federer12', + email: 'Roger12@waltair.io', + password: null, + company: null, + website: 'https://rudderstack.com', + job_title: null, + department: null, + country: 'AU', + address_one: null, + address_two: null, + city: null, + state: null, + territory: null, + zip: null, + phone: null, + fax: null, + source: null, + annual_revenue: null, + employees: null, + industry: null, + years_in_business: null, + comments: null, + notes: null, + score: 14, + grade: null, + last_activity_at: null, + recent_interaction: 'Never active.', + crm_lead_fid: null, + crm_contact_fid: null, + crm_owner_fid: '00G2v000004WYXaEAO', + crm_account_fid: null, + salesforce_fid: null, + crm_last_sync: null, + crm_url: null, + is_do_not_email: null, + is_do_not_call: null, + opted_out: null, + is_reviewed: 1, + is_starred: null, + created_at: '2022-01-21 18:21:46', + updated_at: '2022-01-21 18:48:41', + campaign: { + id: 42113, + name: 'Test', + crm_fid: '7012y000000MNOCLL4', + }, + assigned_to: { + user: { + id: 38443703, + email: 'test_rudderstack@testcompany.com', + first_name: 'Rudderstack', + last_name: 'User', + job_title: null, + role: 'Administrator', + account: 489853, + created_at: '2021-02-26 06:25:17', + updated_at: '2021-02-26 06:25:17', + }, + }, + Are_you_shipping_large_fragile_or_bulky_items: false, + Calendly: false, + Country_Code: 'AU', + Currency: 'AUD', + Inventory_or_Warehouse_Management_System: false, + Lead_Status: 'New', + Marketing_Stage: 'SAL', + Record_Type_ID: 'TestCompany Lead', + profile: { + id: 304, + name: 'Default', + profile_criteria: [ + { + id: 1500, + name: 'Shipping Volume', + matches: 'Unknown', + }, + { + id: 1502, + name: 'Industry', + matches: 'Unknown', + }, + { + id: 1506, + name: 'Job Title', + matches: 'Unknown', + }, + { + id: 1508, + name: 'Department', + matches: 'Unknown', + }, + ], + }, + visitors: null, + visitor_activities: null, + lists: null, + }, + }, + status: 200, + }, + }, + }, + }, + }, + }, + { + name: 'pardot', + description: 'Test proxy - 1', + feature: FEATURES.DATA_DELIVERY, + module: MODULES.DESTINATION, + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://pi.pardot.com/api/prospect/version/4/do/upsert/email/Roger_12@waltair.io', + headers: { + Authorization: 'Bearer myToken', + 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', + }, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: { + first_name: 'Roger_12', + last_name: 'Federer_12', + website: 'https://rudderstack.com', + score: 14, + campaign_id: 42213, + }, + }, + files: {}, + params: { + destination: 'pardot', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + message: 'Request Processed Successfully', + status: 201, + destinationResponse: { + response: { + '@attributes': { + stat: 'ok', + version: 1, + }, + prospect: { + id: 123435, + campaign_id: 42213, + salutation: null, + first_name: 'Roger_12', + last_name: 'Federer_12', + email: 'Roger_12@waltair.io', + password: null, + company: null, + website: 'https://rudderstack.com', + job_title: null, + department: null, + country: 'AU', + address_one: null, + address_two: null, + city: null, + state: null, + territory: null, + zip: null, + phone: null, + fax: null, + source: null, + annual_revenue: null, + employees: null, + industry: null, + years_in_business: null, + comments: null, + notes: null, + score: 14, + grade: null, + last_activity_at: null, + recent_interaction: 'Never active.', + crm_lead_fid: null, + crm_contact_fid: null, + crm_owner_fid: '00G2v000004WYXaEAO', + crm_account_fid: null, + salesforce_fid: null, + crm_last_sync: null, + crm_url: null, + is_do_not_email: null, + is_do_not_call: null, + opted_out: null, + is_reviewed: 1, + is_starred: null, + created_at: '2022-01-21 18:21:46', + updated_at: '2022-01-21 18:48:41', + campaign: { + id: 42113, + name: 'Test', + crm_fid: '7012y000000MNOCLL4', + }, + assigned_to: { + user: { + id: 38443703, + email: 'test_rudderstack@testcompany.com', + first_name: 'Rudderstack', + last_name: 'User', + job_title: null, + role: 'Administrator', + account: 489853, + created_at: '2021-02-26 06:25:17', + updated_at: '2021-02-26 06:25:17', + }, + }, + Are_you_shipping_large_fragile_or_bulky_items: false, + Calendly: false, + Country_Code: 'AU', + Currency: 'AUD', + Inventory_or_Warehouse_Management_System: false, + Lead_Status: 'New', + Marketing_Stage: 'SAL', + Record_Type_ID: 'TestCompany Lead', + profile: { + id: 304, + name: 'Default', + profile_criteria: [ + { + id: 1500, + name: 'Shipping Volume', + matches: 'Unknown', + }, + { + id: 1502, + name: 'Industry', + matches: 'Unknown', + }, + { + id: 1506, + name: 'Job Title', + matches: 'Unknown', + }, + { + id: 1508, + name: 'Department', + matches: 'Unknown', + }, + ], + }, + visitors: null, + visitor_activities: null, + lists: null, + }, + }, + status: 201, + }, + }, + }, + }, + }, + }, + { + name: 'pardot', + description: 'Test proxy - 2', + feature: FEATURES.DATA_DELIVERY, + module: MODULES.DESTINATION, + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/fid/00Q6r000002LKhTPVR', + headers: { + Authorization: 'Bearer myToken', + 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', + }, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: { + first_name: 'Nick', + last_name: 'Kyrgios', + website: 'https://rudderstack.com', + score: 12, + campaign_id: 42213, + }, + }, + files: {}, + params: { + destination: 'pardot', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + message: 'Request Processed Successfully', + status: 200, + destinationResponse: { + response: { + '@attributes': { + stat: 'ok', + version: 1, + }, + prospect: { + id: 123435, + campaign_id: 42213, + salutation: null, + first_name: 'Roger_12', + last_name: 'Federer_12', + email: 'Roger_12@federer.io', + password: null, + company: null, + website: 'https://rudderstack.com', + job_title: null, + department: null, + country: 'AU', + address_one: null, + address_two: null, + city: null, + state: null, + territory: null, + zip: null, + phone: null, + fax: null, + source: null, + annual_revenue: null, + employees: null, + industry: null, + years_in_business: null, + comments: null, + notes: null, + score: 14, + grade: null, + last_activity_at: null, + recent_interaction: 'Never active.', + crm_lead_fid: '00Q6r000002LKhTPVR', + crm_contact_fid: null, + crm_owner_fid: '00G2v000004WYXaEAO', + crm_account_fid: null, + salesforce_fid: '00Q6r000002LKhTPVR', + crm_last_sync: '2022-01-21 18:47:37', + crm_url: 'https://testcompany.my.salesforce.com/00Q6r000002LKhTPVR', + is_do_not_email: null, + is_do_not_call: null, + opted_out: null, + is_reviewed: 1, + is_starred: null, + created_at: '2022-01-21 18:21:46', + updated_at: '2022-01-21 18:48:41', + campaign: { + id: 42113, + name: 'Test', + crm_fid: '7012y000000MNOCLL4', + }, + assigned_to: { + user: { + id: 38443703, + email: 'test_rudderstack@testcompany.com', + first_name: 'Rudderstack', + last_name: 'User', + job_title: null, + role: 'Administrator', + account: 489853, + created_at: '2021-02-26 06:25:17', + updated_at: '2021-02-26 06:25:17', + }, + }, + Are_you_shipping_large_fragile_or_bulky_items: false, + Calendly: false, + Country_Code: 'AU', + Currency: 'AUD', + Inventory_or_Warehouse_Management_System: false, + Lead_Status: 'New', + Marketing_Stage: 'SAL', + Record_Type_ID: 'TestCompany Lead', + profile: { + id: 304, + name: 'Default', + profile_criteria: [ + { + id: 1500, + name: 'Shipping Volume', + matches: 'Unknown', + }, + { + id: 1502, + name: 'Industry', + matches: 'Unknown', + }, + { + id: 1506, + name: 'Job Title', + matches: 'Unknown', + }, + { + id: 1508, + name: 'Department', + matches: 'Unknown', + }, + ], + }, + visitors: null, + visitor_activities: null, + lists: null, + }, + }, + status: 200, + }, + }, + }, + }, + }, + }, + { + name: 'pardot', + description: 'Test proxy - 3', + feature: FEATURES.DATA_DELIVERY, + module: MODULES.DESTINATION, + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://pi.pardot.com/api/prospect/version/4/do/upsert/email/rolex_waltair@mywebsite.io', + headers: { + Authorization: 'Bearer myExpiredToken', + 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', + }, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: { + first_name: 'Rolex', + last_name: 'Waltair', + website: 'https://rudderstack.com', + score: 15, + campaign_id: 42213, + }, + }, + files: {}, + params: { + destination: 'pardot', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + message: + 'access_token is invalid, unknown, or malformed: Inactive token during Pardot response transformation', + status: 500, + authErrorCategory: 'REFRESH_TOKEN', + destinationResponse: { + '@attributes': { + stat: 'fail', + version: 1, + err_code: 184, + }, + err: 'access_token is invalid, unknown, or malformed: Inactive token', + }, + statTags: { + destType: 'PARDOT', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, ]; diff --git a/test/integrations/destinations/sendgrid/deleteUsers/data.ts b/test/integrations/destinations/sendgrid/deleteUsers/data.ts new file mode 100644 index 0000000000..85c6e1275f --- /dev/null +++ b/test/integrations/destinations/sendgrid/deleteUsers/data.ts @@ -0,0 +1,1275 @@ +export const data = [ + { + name: 'sendgrid', + description: 'Test 0', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'SENDGRID', + userAttributes: [ + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + ], + config: { + apiKey: '1234', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'User deletion request failed', + }, + ], + }, + }, + }, + { + name: 'sendgrid', + description: 'Test 1', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'SENDGRID', + userAttributes: [ + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + { + userId: + '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', + }, + { + userId: + 'user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', + }, + ], + config: { + apiKey: '1234', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, + { + name: 'sendgrid', + description: 'Test 2', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'SENDGRID', + userAttributes: [ + { + userId: 'eab57ccf-6322-498e-9338-7761c6dc0656', + }, + { + userId: '47983ca9-7cc6-4942-8ff0-ac443g95658d', + }, + ], + config: {}, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'apiKey is required for deleting user', + }, + ], + }, + }, + }, + { + name: 'sendgrid', + description: 'Test 3', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: 'SENDGRID', + userAttributes: { + userId: 'eab57ccf-6322-498e-9338-7761c6dc0656', + }, + config: { + apiKey: '1234', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'userAttributes is not an array', + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/sendgrid/network.ts b/test/integrations/destinations/sendgrid/network.ts new file mode 100644 index 0000000000..18a8a8d34d --- /dev/null +++ b/test/integrations/destinations/sendgrid/network.ts @@ -0,0 +1,110 @@ +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', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + message: { + job_id: 'bb33b1f9-e7d6-4a6c-bf1c-a2143275e257', + }, + }, + }, + }, + { + httpReq: { + 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', + }, + }, + httpRes: { + data: { + code: 400, + message: 'Bad Req', + status: 'Fail Case', + }, + status: 400, + }, + }, + { + httpReq: { + 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', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': { + job_id: 'bb33b1f9-e7d6-4a6c-bf1c-a2143275e257', + }, + }, + }, + }, + { + httpReq: { + 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', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + message: { + job_id: 'bb33b1f9-e7d6-4a6c-bf1c-a2143275e257', + }, + }, + }, + }, + { + 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', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': { + job_id: 'bb33b1f9-e7d6-4a6c-bf1c-a2143275e257', + }, + }, + }, + }, + { + httpReq: { + 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', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': { + job_id: 'bb33b1f9-e7d6-4a6c-bf1c-a2143275e257', + }, + }, + }, + }, +]; +export const networkCallsData = [...deleteNwData]; diff --git a/test/integrations/destinations/trengo/network.ts b/test/integrations/destinations/trengo/network.ts new file mode 100644 index 0000000000..e409489b8f --- /dev/null +++ b/test/integrations/destinations/trengo/network.ts @@ -0,0 +1,1326 @@ +export const networkCallsData = [ + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=9830311521', + }, + httpRes: { + data: { + data: [ + { + abbr: 'T', + avatar: 'https://app.trengo.com/img/defaultpic.png', + channels: [ + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'sms • SMS', + emailChannel: null, + id: 406005, + is_private: false, + name: 'Sms', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'sms • SMS', + title: 'sms', + type: 'SMS', + username: null, + users: [], + }, + ], + color: '#607d8b', + custom_field_data: null, + display_name: 'Haz matsumi phone 2 (+98 30311521)', + email: null, + formatted_custom_field_data: { 'Customer number': null, Policy: null }, + formatted_phone: '+98 30311521', + full_name: 'Thalmor Bretz', + id: 90002431001, + identifier: '+98 30311521', + is_phone: true, + is_private: false, + name: 'Thalmor Bretz', + phone: '+98 30311521', + pivot: null, + profile: [], + profile_image: null, + }, + ], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=j@d.com', + }, + httpRes: { + data: { + data: [], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=j@d.com', + }, + httpRes: { + data: { + data: [], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=null', + }, + httpRes: { data: { error: 'Request failed', status: 404 }, status: 200 }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=12345678910', + }, + httpRes: { + data: { + data: [], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=99999666661', + }, + httpRes: { data: { error: 'Request failed', status: 404 }, status: 200 }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=98765432100', + }, + httpRes: { + data: { + data: [ + { + abbr: 'T', + avatar: 'https://app.trengo.com/img/defaultpic.png', + channels: [ + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'sms • SMS', + emailChannel: null, + id: 406005, + is_private: false, + name: 'Sms', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'sms • SMS', + title: 'sms', + type: 'SMS', + username: null, + users: [], + }, + ], + color: '#607d8b', + custom_field_data: null, + display_name: 'Michael Scott (+98 30311521)', + email: null, + formatted_custom_field_data: { 'Customer number': null, Policy: null }, + formatted_phone: '+98 765432100', + full_name: 'Michael Scott', + id: 90002431001, + identifier: '+98 765432100', + is_phone: true, + is_private: false, + name: 'Michael Scott', + phone: '+98 765432100', + pivot: null, + profile: [], + profile_image: null, + }, + { + abbr: 'T', + avatar: 'https://app.trengo.com/img/defaultpic.png', + channels: [ + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'sms • SMS', + emailChannel: null, + id: 406005, + is_private: false, + name: 'Sms', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'sms • SMS', + title: 'sms', + type: 'SMS', + username: null, + users: [], + }, + ], + color: '#607d8b', + custom_field_data: null, + display_name: 'Michael G Scott (+98 30311521)', + email: null, + formatted_custom_field_data: { 'Customer number': null, Policy: null }, + formatted_phone: '+98 765432100', + full_name: 'Michael G Scott', + id: 90002431003, + identifier: '+98 765432100', + is_phone: true, + is_private: false, + name: 'Michael G Scott', + phone: '+98 765432100', + pivot: null, + profile: [], + profile_image: null, + }, + ], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=test@outlook.com', + }, + httpRes: { + data: { + data: [ + { + abbr: 'U', + avatar: 'https://app.trengo.com/img/defaultpic.png', + channels: [ + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'sms • SMS', + emailChannel: null, + id: 406005, + is_private: false, + name: 'Sms', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'sms • SMS', + title: 'sms', + type: 'SMS', + username: null, + users: [], + }, + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'email • 5xcyI53Nf7@trengomail.com', + emailChannel: { + add_conversation_to_reply: 1, + auto_reply_body: + '

Dear [name],

This is a confirmation that we received your email and registered it as ticket #[ticket_number]. You can always reply to this email if you want to add additional information.

Kinds regards,

Team Rudder

', + auto_reply_enabled: 1, + auto_reply_subject: null, + branding: 1, + branding_service_name: 'Rudder', + channel_id: 405980, + created_at: '2021-05-13 08:47:56', + email_theme_id: null, + embed_attachments: 1, + font_family: null, + meta: { + selectedFolders: [], + syncFolders: [], + syncStatus: null, + zapier_consent: null, + }, + prepend_ticket_number_to_subject: 0, + sender_email: null, + sender_email_id: null, + sender_name: 'Rudder', + sender_name_personal: '[agent.first_name] | Rudder', + signature: + '

Kind regards,

[agent.first_name] [agent.last_name]
Rudder

', + spam_setting: 1, + split_by_sender: 0, + split_by_subject: 1, + type: 'TRENGO', + updated_at: '2021-05-13 08:47:56', + }, + id: 405980, + is_private: false, + name: 'Email', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'email • 5xcyI53Nf7@trengomail.com', + title: 'email', + type: 'EMAIL', + username: '5xcyI53Nf7', + users: [], + }, + ], + color: '#00bcd4', + custom_field_data: null, + display_name: 'test Phone tct (test@outlook.com)', + email: 'test@outlook.com', + formatted_custom_field_data: { 'Customer number': null, Policy: null }, + formatted_phone: '+98 303115423', + full_name: 'test Email', + id: 97694755, + identifier: 'test@outlook.com', + is_phone: true, + is_private: false, + name: 'test Email', + phone: '98303115423', + pivot: null, + profile: [], + profile_image: null, + }, + ], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=test@outlook.com', + }, + httpRes: { + data: { + data: [ + { + abbr: 'U', + avatar: 'https://app.trengo.com/img/defaultpic.png', + channels: [ + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'sms • SMS', + emailChannel: null, + id: 406005, + is_private: false, + name: 'Sms', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'sms • SMS', + title: 'sms', + type: 'SMS', + username: null, + users: [], + }, + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'email • 5xcyI53Nf7@trengomail.com', + emailChannel: { + add_conversation_to_reply: 1, + auto_reply_body: + '

Dear [name],

This is a confirmation that we received your email and registered it as ticket #[ticket_number]. You can always reply to this email if you want to add additional information.

Kinds regards,

Team Rudder

', + auto_reply_enabled: 1, + auto_reply_subject: null, + branding: 1, + branding_service_name: 'Rudder', + channel_id: 405980, + created_at: '2021-05-13 08:47:56', + email_theme_id: null, + embed_attachments: 1, + font_family: null, + meta: { + selectedFolders: [], + syncFolders: [], + syncStatus: null, + zapier_consent: null, + }, + prepend_ticket_number_to_subject: 0, + sender_email: null, + sender_email_id: null, + sender_name: 'Rudder', + sender_name_personal: '[agent.first_name] | Rudder', + signature: + '

Kind regards,

[agent.first_name] [agent.last_name]
Rudder

', + spam_setting: 1, + split_by_sender: 0, + split_by_subject: 1, + type: 'TRENGO', + updated_at: '2021-05-13 08:47:56', + }, + id: 405980, + is_private: false, + name: 'Email', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'email • 5xcyI53Nf7@trengomail.com', + title: 'email', + type: 'EMAIL', + username: '5xcyI53Nf7', + users: [], + }, + ], + color: '#00bcd4', + custom_field_data: null, + display_name: 'test Phone tct (test@outlook.com)', + email: 'test@outlook.com', + formatted_custom_field_data: { 'Customer number': null, Policy: null }, + formatted_phone: '+98 303115423', + full_name: 'test Email', + id: 97694755, + identifier: 'test@outlook.com', + is_phone: true, + is_private: false, + name: 'test Email', + phone: '98303115423', + pivot: null, + profile: [], + profile_image: null, + }, + ], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=98765432100', + }, + httpRes: { + data: { + data: [ + { + abbr: 'T', + avatar: 'https://app.trengo.com/img/defaultpic.png', + channels: [ + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'sms • SMS', + emailChannel: null, + id: 406005, + is_private: false, + name: 'Sms', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'sms • SMS', + title: 'sms', + type: 'SMS', + username: null, + users: [], + }, + ], + color: '#607d8b', + custom_field_data: null, + display_name: 'Michael Scott (+98 30311521)', + email: null, + formatted_custom_field_data: { 'Customer number': null, Policy: null }, + formatted_phone: '+98 765432100', + full_name: 'Michael Scott', + id: 90002431001, + identifier: '+98 765432100', + is_phone: true, + is_private: false, + name: 'Michael Scott', + phone: '+98 765432100', + pivot: null, + profile: [], + profile_image: null, + }, + { + abbr: 'T', + avatar: 'https://app.trengo.com/img/defaultpic.png', + channels: [ + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'sms • SMS', + emailChannel: null, + id: 406005, + is_private: false, + name: 'Sms', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'sms • SMS', + title: 'sms', + type: 'SMS', + username: null, + users: [], + }, + ], + color: '#607d8b', + custom_field_data: null, + display_name: 'Michael G Scott (+98 30311521)', + email: null, + formatted_custom_field_data: { 'Customer number': null, Policy: null }, + formatted_phone: '+98 765432100', + full_name: 'Michael G Scott', + id: 90002431003, + identifier: '+98 765432100', + is_phone: true, + is_private: false, + name: 'Michael G Scott', + phone: '+98 765432100', + pivot: null, + profile: [], + profile_image: null, + }, + ], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=test@outlook.com', + }, + httpRes: { + data: { + data: [ + { + abbr: 'U', + avatar: 'https://app.trengo.com/img/defaultpic.png', + channels: [ + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'sms • SMS', + emailChannel: null, + id: 406005, + is_private: false, + name: 'Sms', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'sms • SMS', + title: 'sms', + type: 'SMS', + username: null, + users: [], + }, + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'email • 5xcyI53Nf7@trengomail.com', + emailChannel: { + add_conversation_to_reply: 1, + auto_reply_body: + '

Dear [name],

This is a confirmation that we received your email and registered it as ticket #[ticket_number]. You can always reply to this email if you want to add additional information.

Kinds regards,

Team Rudder

', + auto_reply_enabled: 1, + auto_reply_subject: null, + branding: 1, + branding_service_name: 'Rudder', + channel_id: 405980, + created_at: '2021-05-13 08:47:56', + email_theme_id: null, + embed_attachments: 1, + font_family: null, + meta: { + selectedFolders: [], + syncFolders: [], + syncStatus: null, + zapier_consent: null, + }, + prepend_ticket_number_to_subject: 0, + sender_email: null, + sender_email_id: null, + sender_name: 'Rudder', + sender_name_personal: '[agent.first_name] | Rudder', + signature: + '

Kind regards,

[agent.first_name] [agent.last_name]
Rudder

', + spam_setting: 1, + split_by_sender: 0, + split_by_subject: 1, + type: 'TRENGO', + updated_at: '2021-05-13 08:47:56', + }, + id: 405980, + is_private: false, + name: 'Email', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'email • 5xcyI53Nf7@trengomail.com', + title: 'email', + type: 'EMAIL', + username: '5xcyI53Nf7', + users: [], + }, + ], + color: '#00bcd4', + custom_field_data: null, + display_name: 'test Phone tct (test@outlook.com)', + email: 'test@outlook.com', + formatted_custom_field_data: { 'Customer number': null, Policy: null }, + formatted_phone: '+98 303115423', + full_name: 'test Email', + id: 97694755, + identifier: 'test@outlook.com', + is_phone: true, + is_private: false, + name: 'test Email', + phone: '98303115423', + pivot: null, + profile: [], + profile_image: null, + }, + ], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=test@outlook.com', + }, + httpRes: { + data: { + data: [ + { + abbr: 'U', + avatar: 'https://app.trengo.com/img/defaultpic.png', + channels: [ + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'sms • SMS', + emailChannel: null, + id: 406005, + is_private: false, + name: 'Sms', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'sms • SMS', + title: 'sms', + type: 'SMS', + username: null, + users: [], + }, + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'email • 5xcyI53Nf7@trengomail.com', + emailChannel: { + add_conversation_to_reply: 1, + auto_reply_body: + '

Dear [name],

This is a confirmation that we received your email and registered it as ticket #[ticket_number]. You can always reply to this email if you want to add additional information.

Kinds regards,

Team Rudder

', + auto_reply_enabled: 1, + auto_reply_subject: null, + branding: 1, + branding_service_name: 'Rudder', + channel_id: 405980, + created_at: '2021-05-13 08:47:56', + email_theme_id: null, + embed_attachments: 1, + font_family: null, + meta: { + selectedFolders: [], + syncFolders: [], + syncStatus: null, + zapier_consent: null, + }, + prepend_ticket_number_to_subject: 0, + sender_email: null, + sender_email_id: null, + sender_name: 'Rudder', + sender_name_personal: '[agent.first_name] | Rudder', + signature: + '

Kind regards,

[agent.first_name] [agent.last_name]
Rudder

', + spam_setting: 1, + split_by_sender: 0, + split_by_subject: 1, + type: 'TRENGO', + updated_at: '2021-05-13 08:47:56', + }, + id: 405980, + is_private: false, + name: 'Email', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'email • 5xcyI53Nf7@trengomail.com', + title: 'email', + type: 'EMAIL', + username: '5xcyI53Nf7', + users: [], + }, + ], + color: '#00bcd4', + custom_field_data: null, + display_name: 'test Phone tct (test@outlook.com)', + email: 'test@outlook.com', + formatted_custom_field_data: { 'Customer number': null, Policy: null }, + formatted_phone: '+98 303115423', + full_name: 'test Email', + id: 97694755, + identifier: 'test@outlook.com', + is_phone: true, + is_private: false, + name: 'test Email', + phone: '98303115423', + pivot: null, + profile: [], + profile_image: null, + }, + ], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=test@outlook.com', + }, + httpRes: { + data: { + data: [ + { + abbr: 'U', + avatar: 'https://app.trengo.com/img/defaultpic.png', + channels: [ + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'sms • SMS', + emailChannel: null, + id: 406005, + is_private: false, + name: 'Sms', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'sms • SMS', + title: 'sms', + type: 'SMS', + username: null, + users: [], + }, + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'email • 5xcyI53Nf7@trengomail.com', + emailChannel: { + add_conversation_to_reply: 1, + auto_reply_body: + '

Dear [name],

This is a confirmation that we received your email and registered it as ticket #[ticket_number]. You can always reply to this email if you want to add additional information.

Kinds regards,

Team Rudder

', + auto_reply_enabled: 1, + auto_reply_subject: null, + branding: 1, + branding_service_name: 'Rudder', + channel_id: 405980, + created_at: '2021-05-13 08:47:56', + email_theme_id: null, + embed_attachments: 1, + font_family: null, + meta: { + selectedFolders: [], + syncFolders: [], + syncStatus: null, + zapier_consent: null, + }, + prepend_ticket_number_to_subject: 0, + sender_email: null, + sender_email_id: null, + sender_name: 'Rudder', + sender_name_personal: '[agent.first_name] | Rudder', + signature: + '

Kind regards,

[agent.first_name] [agent.last_name]
Rudder

', + spam_setting: 1, + split_by_sender: 0, + split_by_subject: 1, + type: 'TRENGO', + updated_at: '2021-05-13 08:47:56', + }, + id: 405980, + is_private: false, + name: 'Email', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'email • 5xcyI53Nf7@trengomail.com', + title: 'email', + type: 'EMAIL', + username: '5xcyI53Nf7', + users: [], + }, + ], + color: '#00bcd4', + custom_field_data: null, + display_name: 'test Phone tct (test@outlook.com)', + email: 'test@outlook.com', + formatted_custom_field_data: { 'Customer number': null, Policy: null }, + formatted_phone: '+98 303115423', + full_name: 'test Email', + id: 97694755, + identifier: 'test@outlook.com', + is_phone: true, + is_private: false, + name: 'test Email', + phone: '98303115423', + pivot: null, + profile: [], + profile_image: null, + }, + ], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=test@outlook.com', + }, + httpRes: { + data: { + data: [ + { + abbr: 'U', + avatar: 'https://app.trengo.com/img/defaultpic.png', + channels: [ + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'sms • SMS', + emailChannel: null, + id: 406005, + is_private: false, + name: 'Sms', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'sms • SMS', + title: 'sms', + type: 'SMS', + username: null, + users: [], + }, + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'email • 5xcyI53Nf7@trengomail.com', + emailChannel: { + add_conversation_to_reply: 1, + auto_reply_body: + '

Dear [name],

This is a confirmation that we received your email and registered it as ticket #[ticket_number]. You can always reply to this email if you want to add additional information.

Kinds regards,

Team Rudder

', + auto_reply_enabled: 1, + auto_reply_subject: null, + branding: 1, + branding_service_name: 'Rudder', + channel_id: 405980, + created_at: '2021-05-13 08:47:56', + email_theme_id: null, + embed_attachments: 1, + font_family: null, + meta: { + selectedFolders: [], + syncFolders: [], + syncStatus: null, + zapier_consent: null, + }, + prepend_ticket_number_to_subject: 0, + sender_email: null, + sender_email_id: null, + sender_name: 'Rudder', + sender_name_personal: '[agent.first_name] | Rudder', + signature: + '

Kind regards,

[agent.first_name] [agent.last_name]
Rudder

', + spam_setting: 1, + split_by_sender: 0, + split_by_subject: 1, + type: 'TRENGO', + updated_at: '2021-05-13 08:47:56', + }, + id: 405980, + is_private: false, + name: 'Email', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'email • 5xcyI53Nf7@trengomail.com', + title: 'email', + type: 'EMAIL', + username: '5xcyI53Nf7', + users: [], + }, + ], + color: '#00bcd4', + custom_field_data: null, + display_name: 'test Phone tct (test@outlook.com)', + email: 'test@outlook.com', + formatted_custom_field_data: { 'Customer number': null, Policy: null }, + formatted_phone: '+98 303115423', + full_name: 'test Email', + id: 97694755, + identifier: 'test@outlook.com', + is_phone: true, + is_private: false, + name: 'test Email', + phone: '98303115423', + pivot: null, + profile: [], + profile_image: null, + }, + ], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Bearer trengo_integration_test_api_token', + }, + + method: 'GET', + + url: 'https://app.trengo.com/api/v2/contacts?page=1&term=9830311521', + }, + httpRes: { + data: { + data: [ + { + abbr: 'T', + avatar: 'https://app.trengo.com/img/defaultpic.png', + channels: [ + { + auto_reply: 'ENABLED', + business_hour_id: 125020, + color: null, + display_name: 'sms • SMS', + emailChannel: null, + id: 406005, + is_private: false, + name: 'Sms', + notification_email: null, + notification_sound: 'chat.mp3', + password_is_null: false, + phone: '', + reassign_reopened_ticket: false, + reopen_closed_ticket: 1, + reopen_closed_ticket_time_window_days: '30', + show_contact_fields: 1, + show_ticket_fields: 1, + status: 'ACTIVE', + text: 'sms • SMS', + title: 'sms', + type: 'SMS', + username: null, + users: [], + }, + ], + color: '#607d8b', + custom_field_data: null, + display_name: 'Haz matsumi phone 2 (+98 30311521)', + email: null, + formatted_custom_field_data: { 'Customer number': null, Policy: null }, + formatted_phone: '+98 30311521', + full_name: 'Thalmor Bretz', + id: 90002431001, + identifier: '+98 30311521', + is_phone: true, + is_private: false, + name: 'Thalmor Bretz', + phone: '+98 30311521', + pivot: null, + profile: [], + profile_image: null, + }, + ], + links: { + first: 'https://app.trengo.com/api/v2/contacts?page=1', + last: null, + next: null, + prev: null, + }, + meta: { + current_page: 1, + from: 1, + path: 'https://app.trengo.com/api/v2/contacts', + per_page: 25, + to: 1, + }, + }, + status: 200, + }, + }, +]; diff --git a/test/integrations/destinations/user/network.ts b/test/integrations/destinations/user/network.ts new file mode 100644 index 0000000000..dff2e0726d --- /dev/null +++ b/test/integrations/destinations/user/network.ts @@ -0,0 +1,441 @@ +export const networkCallsData = [ + { + httpReq: { + headers: { + Authorization: 'Token dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://commander.user.com/api/public/users-by-id/user@123/', + }, + httpRes: { + data: { + browser_language: null, + companies: [ + { id: 21, member_since: '2022-09-12T12:40:30.548068Z', name: 'parkings group' }, + { id: 19, member_since: '2022-09-12T12:37:58.522773Z', name: 'rudder constructors' }, + ], + created_at: '2022-09-06T11:52:48.828444Z', + custom_id: 'user@123', + email: null, + first_seen: '2022-09-06T11:52:48.812722Z', + gender: 'unknown', + gravatar_url: null, + id: 52, + last_seen: '2022-09-06T12:35:17.230000Z', + lists: [], + name: null, + notifications: true, + page_views: 2, + phone_number: '2345678901', + score: 0, + status: 'visitor', + tags: [], + unsubscribed: false, + updated_at: '2022-09-12T03:19:33.356280Z', + user_key: 'ngze13ffndcv', + web_push_subscription: false, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Token dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://commander.user.com/api/public/companies-by-id/group@795/', + }, + httpRes: { + data: { + address: '6th floor,california,usa', + category: null, + city: null, + companyowner: 'secret', + country: 'usa', + created_at: '2022-09-12T12:40:30.548068Z', + custom_id: 'group@795', + description: null, + email: 'business@rudderstack.com', + employees: [52], + founded: '15 aug, 1947', + id: 21, + isprivatefunded: 'no', + isprofitable: 'no', + name: 'rudder ventures', + phone_numbers: null, + postal_code: null, + region: null, + size: null, + tags: [], + updated_at: '2022-09-13T11:23:09.481891Z', + user_custom_id: 'user@123', + }, + status: 200, + }, + }, + { + httpReq: { + data: { + address: '6th StSan FranciscoCA94103USAtestuser', + city: 'San Francisco', + custom_id: 'group@795', + email: 'business@rudderstack.com', + name: 'rudder ventures', + postal_code: '94103', + user_custom_id: 'user@123', + }, + headers: { + Authorization: 'Token dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'PUT', + + url: 'https://commander.user.com/api/public/companies/21/', + }, + httpRes: { + data: { + address: 'San FranciscoUSA94103CA6th St', + city: 'San Francisco', + companyowner: 'secret', + country: 'usa', + created_at: '2022-09-12T12:40:30.548068Z', + custom_id: 'group@795', + description: null, + email: 'business@rudderstack.com', + employees: [52], + founded: '15 aug, 1947', + id: 21, + isprivatefunded: 'no', + isprofitable: 'no', + name: 'rudder ventures', + phone_numbers: null, + postal_code: null, + region: null, + size: null, + tags: [], + updated_at: '2022-09-13T11:47:31.748497Z', + user_custom_id: 'user@123', + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Token dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://commander.user.com/api/public/users/search/?email=test@rudderstack.com', + }, + httpRes: { + data: { + browser_language: null, + companies: [], + country: 'india', + created_at: '2022-09-13T06:16:25.576355Z', + custom_id: 'test@12', + email: 'test@rudderstack.com', + gender: 'male', + google_url: 'www.google.com', + id: 59, + lists: [], + name: 'test rudderstack', + notifications: true, + phone_number: '9225467887', + score: 0, + status: 'user', + tags: [{ id: 5, name: 'productuser' }], + unsubscribed: false, + updated_at: '2022-09-13T06:16:25.576376Z', + user_key: 'ctlfkj37dbag', + web_push_subscription: false, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Token dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://commander.user.com/api/public/users/search/?key=lel1c5u1wuk8', + }, + httpRes: { + data: { + browser_language: null, + companies: [], + created_at: '2022-09-05T07:21:39.171977Z', + email: 'rahulverma@test.com', + gender: 'unknown', + gravatar_url: null, + id: 27, + lists: [], + name: 'rahul verma', + notifications: true, + phone_number: '+919432239876', + score: 0, + status: 'visitor', + tags: [ + { id: 1, name: 'updated' }, + { id: 2, name: 'verified' }, + ], + unsubscribed: false, + updated_at: '2022-09-05T07:21:39.171990Z', + user_key: 'lel1c5u1wuk8', + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Token dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://commander.user.com/api/public/users/search/?email=test@rudderstack.com', + }, + httpRes: { + data: { + browser_language: null, + companies: [], + country: 'india', + created_at: '2022-09-13T06:16:25.576355Z', + custom_id: 'test@12', + email: 'test@rudderstack.com', + gender: 'male', + google_url: 'www.google.com', + id: 59, + lists: [], + name: 'test rudderstack', + notifications: true, + phone_number: '9225467887', + score: 0, + status: 'user', + tags: [{ id: 5, name: 'productuser' }], + unsubscribed: false, + updated_at: '2022-09-13T06:16:25.576376Z', + user_key: 'ctlfkj37dbag', + web_push_subscription: false, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Token dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://commander.user.com/api/public/users-by-id/43/', + }, + httpRes: { + data: { + browser_language: null, + companies: [], + created_at: '2022-09-05T11:04:45.547861Z', + custom_id: '43', + email: null, + first_seen: '2022-09-05T11:04:45.535122Z', + gender: 'unknown', + gravatar_url: null, + id: 44, + last_seen: null, + lists: [], + name: null, + page_views: 0, + score: 0, + status: 'visitor', + tags: [], + unsubscribed: false, + updated_at: '2022-09-05T11:04:45.547876Z', + user_key: 'rpl0vjwysmc0', + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Token dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://commander.user.com/api/public/users-by-id/43/', + }, + httpRes: { + data: { + browser_language: null, + companies: [], + created_at: '2022-09-05T11:04:45.547861Z', + custom_id: '43', + email: null, + first_seen: '2022-09-05T11:04:45.535122Z', + gender: 'unknown', + gravatar_url: null, + id: 44, + last_seen: null, + lists: [], + name: null, + page_views: 0, + score: 0, + status: 'visitor', + tags: [], + unsubscribed: false, + updated_at: '2022-09-05T11:04:45.547876Z', + user_key: 'rpl0vjwysmc0', + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Token dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://commander.user.com/api/public/users-by-id/user@123/', + }, + httpRes: { + data: { + browser_language: null, + companies: [ + { id: 21, member_since: '2022-09-12T12:40:30.548068Z', name: 'parkings group' }, + { id: 19, member_since: '2022-09-12T12:37:58.522773Z', name: 'rudder constructors' }, + ], + created_at: '2022-09-06T11:52:48.828444Z', + custom_id: 'user@123', + email: null, + first_seen: '2022-09-06T11:52:48.812722Z', + gender: 'unknown', + gravatar_url: null, + id: 52, + last_seen: '2022-09-06T12:35:17.230000Z', + lists: [], + name: null, + notifications: true, + page_views: 2, + phone_number: '2345678901', + score: 0, + status: 'visitor', + tags: [], + unsubscribed: false, + updated_at: '2022-09-12T03:19:33.356280Z', + user_key: 'ngze13ffndcv', + web_push_subscription: false, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Token dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'GET', + + url: 'https://commander.user.com/api/public/companies-by-id/group@795/', + }, + httpRes: { + data: { + address: '6th floor,california,usa', + category: null, + city: null, + companyowner: 'secret', + country: 'usa', + created_at: '2022-09-12T12:40:30.548068Z', + custom_id: 'group@795', + description: null, + email: 'business@rudderstack.com', + employees: [52], + founded: '15 aug, 1947', + id: 21, + isprivatefunded: 'no', + isprofitable: 'no', + name: 'rudder ventures', + phone_numbers: null, + postal_code: null, + region: null, + size: null, + tags: [], + updated_at: '2022-09-13T11:23:09.481891Z', + user_custom_id: 'user@123', + }, + status: 200, + }, + }, + { + httpReq: { + data: { + address: '6th StSan FranciscoCA94103USAtestuser', + city: 'San Francisco', + custom_id: 'group@795', + email: 'business@rudderstack.com', + name: 'rudder ventures', + postal_code: '94103', + user_custom_id: 'user@123', + }, + headers: { + Authorization: 'Token dummyApiKey', + 'Content-Type': 'application/json', + }, + + method: 'PUT', + + url: 'https://commander.user.com/api/public/companies/21/', + }, + httpRes: { + data: { + address: 'San FranciscoUSA94103CA6th St', + city: 'San Francisco', + companyowner: 'secret', + country: 'usa', + created_at: '2022-09-12T12:40:30.548068Z', + custom_id: 'group@795', + description: null, + email: 'business@rudderstack.com', + employees: [52], + founded: '15 aug, 1947', + id: 21, + isprivatefunded: 'no', + isprofitable: 'no', + name: 'rudder ventures', + phone_numbers: null, + postal_code: null, + region: null, + size: null, + tags: [], + updated_at: '2022-09-13T11:47:31.748497Z', + user_custom_id: 'user@123', + }, + status: 200, + }, + }, +]; diff --git a/test/integrations/destinations/yahoo_dsp/network.ts b/test/integrations/destinations/yahoo_dsp/network.ts new file mode 100644 index 0000000000..2dcd0d2a9f --- /dev/null +++ b/test/integrations/destinations/yahoo_dsp/network.ts @@ -0,0 +1,22 @@ +export const networkCallsData = [ + { + httpReq: { + headers: { + Accept: 'application/json', + 'Content-Type': 'application/x-www-form-urlencoded', + }, + data: 'grant_type=client_credentials&scope=dsp-api-access&realm=dsp&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer&client_assertion=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJodHRwczovL2lkLmIyYi55YWhvb2luYy5jb20vaWRlbnRpdHkvb2F1dGgyL2FjY2Vzc190b2tlbj9yZWFsbT1kc3AiLCJzdWIiOiJhYmNkZWY4LWY0OS00Y2Q2LWI0YzUtOTU4YjNkNjZkNDMxIiwiaXNzIjoiYWJjZGVmOC1mNDktNGNkNi1iNGM1LTk1OGIzZDY2ZDQzMSIsImV4cCI6MTY5NTMwODk5MCwiaWF0IjoxNjk1MzA1MzkwfQ.HdBZJ0PoI8L0LRRdfbYtbJbmtrOAQmfu2APbuIQguIA', + method: 'POST', + url: 'https://id.b2b.yahooinc.com/identity/oauth2/access_token', + }, + httpRes: { + data: { + access_token: 'testAuthToken', + expires_in: 3599, + scope: 'dsp-api-access', + token_type: 'Bearer', + }, + status: 200, + }, + }, +]; diff --git a/test/integrations/destinations/yahoo_dsp/processor/data.ts b/test/integrations/destinations/yahoo_dsp/processor/data.ts index cb5145ed3a..eb607d60fb 100644 --- a/test/integrations/destinations/yahoo_dsp/processor/data.ts +++ b/test/integrations/destinations/yahoo_dsp/processor/data.ts @@ -1,3 +1,11 @@ +import { addMock } from '../../../testUtils'; +import { networkCallsData } from '../network'; + +export const mockFns = (mockAdapter) => { + addMock(mockAdapter, networkCallsData[0]); + // 21 September 2023 19:39:50 GMT+05:30 + Date.now = jest.fn(() => 1695305390000); +}; export const data = [ { name: 'yahoo_dsp', @@ -1107,4 +1115,6 @@ export const data = [ }, }, }, -]; +].map((d) => { + return { ...d, mockFns }; +}); diff --git a/test/integrations/destinations/yahoo_dsp/router/data.ts b/test/integrations/destinations/yahoo_dsp/router/data.ts index ea340fb6be..59c71b300c 100644 --- a/test/integrations/destinations/yahoo_dsp/router/data.ts +++ b/test/integrations/destinations/yahoo_dsp/router/data.ts @@ -1,3 +1,5 @@ +import { mockFns } from '../processor/data'; + export const data = [ { name: 'yahoo_dsp', @@ -144,5 +146,6 @@ export const data = [ }, }, }, + mockFns, }, ]; diff --git a/test/integrations/destinations/zendesk/network.ts b/test/integrations/destinations/zendesk/network.ts new file mode 100644 index 0000000000..bc80f0cd0a --- /dev/null +++ b/test/integrations/destinations/zendesk/network.ts @@ -0,0 +1,1825 @@ +export const networkCallsData = [ + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/organization_fields.json', + }, + httpRes: { + data: { + count: 1, + next_page: null, + organization_fields: [ + { + active: true, + created_at: '2020-03-23T18:14:35Z', + description: 'email', + id: 900000015126, + key: 'email', + position: 0, + raw_description: 'email', + raw_title: 'email', + regexp_for_validation: null, + system: false, + title: 'email', + type: 'text', + updated_at: '2020-03-23T18:14:35Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/organization_fields/900000015126.json', + }, + ], + previous_page: null, + }, + status: 200, + }, + }, + { + httpReq: { + data: { + organization: { + domain_names: 'cw124.com', + external_id: 'group-124', + name: 'test-org124', + organization_fields: { email: 'group_email_124@xyz.com', id: 'group-124' }, + }, + }, + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'POST', + url: 'https://rudderlabshelp.zendesk.com/api/v2/organizations/create_or_update.json', + }, + httpRes: { + data: { + organization: { + created_at: '2020-03-17T10:21:14Z', + details: null, + domain_names: ['cw124.com'], + external_id: 'group-124', + group_id: null, + id: 900001329943, + name: 'test-org124', + notes: null, + organization_fields: { email: 'group_email_124@xyz.com' }, + shared_comments: false, + shared_tickets: false, + tags: [], + updated_at: '2020-03-23T19:33:08Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/organizations/900001329943.json', + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=example124@email.com', + }, + httpRes: { + data: { + count: 1, + next_page: null, + previous_page: null, + users: [ + { + active: true, + alias: null, + chat_only: false, + created_at: '2020-03-17T10:21:15Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'example124@email.com', + external_id: 'abcd-124', + iana_time_zone: 'America/New_York', + id: 900113780483, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'abcd124', + notes: null, + only_private_comments: false, + organization_id: null, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + 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: 'Eastern Time (US & Canada)', + two_factor_auth_enabled: false, + updated_at: '2020-03-17T12:16:59Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483.json', + user_fields: { birthday: null }, + verified: true, + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2//users/900113780483/organization_memberships.json', + }, + httpRes: { error: 'Request failed' }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic cnVkZGVybGFidGVzdDJAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabtest2.zendesk.com/api/v2/users/search.json?query=testemail2@email', + }, + httpRes: { data: { count: 0, next_page: null, previous_page: null, users: [] }, status: 200 }, + }, + { + httpReq: { + data: { + user: { + email: 'testemail2@email', + external_id: '0000000000', + name: 'John Wick', + verified: true, + }, + }, + headers: { + Authorization: 'Basic cnVkZGVybGFidGVzdDJAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + 'Content-Type': 'application/json', + }, + method: 'POST', + url: 'https://rudderlabtest2.zendesk.com/api/v2/users/create_or_update.json', + }, + httpRes: { data: { user: {} }, status: 200 }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/organization_fields.json', + }, + httpRes: { + data: { + count: 1, + next_page: null, + organization_fields: [ + { + active: true, + created_at: '2020-03-23T18:14:35Z', + description: 'email', + id: 900000015126, + key: 'email', + position: 0, + raw_description: 'email', + raw_title: 'email', + regexp_for_validation: null, + system: false, + title: 'email', + type: 'text', + updated_at: '2020-03-23T18:14:35Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/organization_fields/900000015126.json', + }, + ], + previous_page: null, + }, + status: 200, + }, + }, + { + httpReq: { + data: { + organization: { + domain_names: 'cw124.com', + external_id: 'group-124', + name: 'test-org124', + organization_fields: { email: 'group_email_124@xyz.com', id: 'group-124' }, + }, + }, + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'POST', + url: 'https://rudderlabshelp.zendesk.com/api/v2/organizations/create_or_update.json', + }, + httpRes: { + data: { + organization: { + created_at: '2020-03-17T10:21:14Z', + details: null, + domain_names: ['cw124.com'], + external_id: 'group-124', + group_id: null, + id: 900001329943, + name: 'test-org124', + notes: null, + organization_fields: { email: 'group_email_124@xyz.com' }, + shared_comments: false, + shared_tickets: false, + tags: [], + updated_at: '2020-03-23T19:33:08Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/organizations/900001329943.json', + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=example124@email.com', + }, + httpRes: { + data: { + count: 1, + next_page: null, + previous_page: null, + users: [ + { + active: true, + alias: null, + chat_only: false, + created_at: '2020-03-17T10:21:15Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'example124@email.com', + external_id: 'abcd-124', + iana_time_zone: 'America/New_York', + id: 900113780483, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'abcd124', + notes: null, + only_private_comments: false, + organization_id: null, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + 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: 'Eastern Time (US & Canada)', + two_factor_auth_enabled: false, + updated_at: '2020-03-17T12:16:59Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483.json', + user_fields: { birthday: null }, + verified: true, + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2//users/900113780483/organization_memberships.json', + }, + httpRes: { error: 'Request failed' }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=example124@email.com', + }, + httpRes: { + data: { + count: 1, + next_page: null, + previous_page: null, + users: [ + { + active: true, + alias: null, + chat_only: false, + created_at: '2020-03-17T10:21:15Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'example124@email.com', + external_id: 'abcd-124', + iana_time_zone: 'America/New_York', + id: 900113780483, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'abcd124', + notes: null, + only_private_comments: false, + organization_id: null, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + 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: 'Eastern Time (US & Canada)', + two_factor_auth_enabled: false, + updated_at: '2020-03-17T12:16:59Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483.json', + user_fields: { birthday: null }, + verified: true, + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=example124@email.com', + }, + httpRes: { + data: { + count: 1, + next_page: null, + previous_page: null, + users: [ + { + active: true, + alias: null, + chat_only: false, + created_at: '2020-03-17T10:21:15Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'example124@email.com', + external_id: 'abcd-124', + iana_time_zone: 'America/New_York', + id: 900113780483, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'abcd124', + notes: null, + only_private_comments: false, + organization_id: null, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + 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: 'Eastern Time (US & Canada)', + two_factor_auth_enabled: false, + updated_at: '2020-03-17T12:16:59Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483.json', + user_fields: { birthday: null }, + verified: true, + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/organization_memberships.json', + }, + httpRes: { + data: { + count: 1, + next_page: null, + organization_memberships: [ + { + created_at: '2020-03-23T15:56:56Z', + default: true, + id: 900004877903, + organization_id: 900001329943, + updated_at: '2020-03-23T15:56:56Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/organization_memberships/900004877903.json', + user_id: 900113780483, + }, + ], + previous_page: null, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=example124@email.com', + }, + httpRes: { + data: { + count: 1, + next_page: null, + previous_page: null, + users: [ + { + active: true, + alias: null, + chat_only: false, + created_at: '2020-03-17T10:21:15Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'example124@email.com', + external_id: 'abcd-124', + iana_time_zone: 'America/New_York', + id: 900113780483, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'abcd124', + notes: null, + only_private_comments: false, + organization_id: null, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + 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: 'Eastern Time (US & Canada)', + two_factor_auth_enabled: false, + updated_at: '2020-03-17T12:16:59Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483.json', + user_fields: { birthday: null }, + verified: true, + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/organization_memberships.json', + }, + httpRes: { + data: { + count: 1, + next_page: null, + organization_memberships: [ + { + created_at: '2020-03-23T15:56:56Z', + default: true, + id: 900004877903, + organization_id: 900001329943, + updated_at: '2020-03-23T15:56:56Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/organization_memberships/900004877903.json', + user_id: 900113780483, + }, + ], + previous_page: null, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + data: { + user_field: { active: true, description: 'country', key: 'country', title: 'country' }, + }, + headers: { + Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + 'Content-Type': 'application/json', + }, + method: 'POST', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + data: { + user_field: { active: true, description: 'country', key: 'country', title: 'country' }, + }, + headers: { + Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + 'Content-Type': 'application/json', + }, + method: 'POST', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + data: { + user_field: { active: true, description: 'country', key: 'country', title: 'country' }, + }, + headers: { + Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + 'Content-Type': 'application/json', + }, + method: 'POST', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=johnwick@example.com', + }, + httpRes: { error: 'Request failed', status: 200 }, + }, + { + httpReq: { + data: { + user: { + email: 'johnwick@example.com', + external_id: '0000000000', + name: 'John Wick', + verified: true, + }, + }, + headers: { + Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + 'Content-Type': 'application/json', + }, + method: 'POST', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', + }, + httpRes: { + data: { + user: { + active: true, + alias: null, + chat_only: false, + created_at: '2020-03-17T10:21:15Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'example124@email.com', + external_id: 'abcd-124', + iana_time_zone: 'America/New_York', + id: 900113780483, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'abcd124', + notes: null, + only_private_comments: false, + organization_id: 900001329943, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + 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: 'Eastern Time (US & Canada)', + two_factor_auth_enabled: false, + updated_at: '2020-03-23T15:56:56Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483.json', + user_fields: { birthday: null }, + verified: true, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=johnwick@example.com', + }, + httpRes: { error: 'Request failed', status: 200 }, + }, + { + httpReq: { + data: { + user: { + email: 'johnwick@example.com', + external_id: '0000000000', + name: 'John Wick', + verified: true, + }, + }, + headers: { + Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + 'Content-Type': 'application/json', + }, + method: 'POST', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', + }, + httpRes: { + data: { + user: { + active: true, + alias: null, + chat_only: false, + created_at: '2020-03-17T10:21:15Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'example124@email.com', + external_id: 'abcd-124', + iana_time_zone: 'America/New_York', + id: 900113780483, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'abcd124', + notes: null, + only_private_comments: false, + organization_id: 900001329943, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + 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: 'Eastern Time (US & Canada)', + two_factor_auth_enabled: false, + updated_at: '2020-03-23T15:56:56Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483.json', + user_fields: { birthday: null }, + verified: true, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMi90b2tlbjpteUR1bW15QXBpVG9rZW4y', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://blendohelp.zendesk.com/api/v2/organization_fields.json', + }, + httpRes: { error: 'Request failed', status: 200 }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields.json', + }, + httpRes: { + data: { + count: 3, + next_page: null, + previous_page: null, + user_fields: [ + { + active: true, + created_at: '2020-03-18T08:19:58Z', + description: 'birthday', + id: 900000013606, + key: 'birthday', + position: 0, + raw_description: 'birthday', + raw_title: 'birthday', + regexp_for_validation: null, + system: false, + title: 'birthday', + type: 'text', + updated_at: '2020-03-18T08:19:58Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000013606.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'age', + id: 900000014483, + key: 'age', + position: 1, + raw_description: 'age', + raw_title: 'age', + regexp_for_validation: null, + system: false, + title: 'age', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000014483.json', + }, + { + active: true, + created_at: '2020-03-23T17:38:44Z', + description: 'firstname', + id: 900000015106, + key: 'firstname', + position: 2, + raw_description: 'firstname', + raw_title: 'firstname', + regexp_for_validation: null, + system: false, + title: 'firstname', + type: 'text', + updated_at: '2020-03-23T17:38:44Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/user_fields/900000015106.json', + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=abcd-144', + }, + 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: 'abcd-144', + iana_time_zone: 'Asia/Kolkata', + id: 900113780483, + 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, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/identities', + }, + httpRes: { + data: { + count: 2, + identities: [ + { + 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: 'example119@email.com', + verified: false, + }, + { + created_at: '2022-11-02T04:23:46Z', + deliverable_state: 'deliverable', + id: 7534173321117, + primary: false, + 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, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic cnVkZGVybGFidGVzdDFAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabtest1.zendesk.com/api/v2/users/search.json?query=testemail1@email', + }, + httpRes: { data: { count: 0, next_page: null, previous_page: null, users: [] }, status: 200 }, + }, + { + httpReq: { + data: { + user: { + email: 'testemail1@email', + external_id: '0000000000', + name: 'John Wick', + verified: true, + }, + }, + headers: { + Authorization: 'Basic cnVkZGVybGFidGVzdDFAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + 'Content-Type': 'application/json', + }, + method: 'POST', + url: 'https://rudderlabtest1.zendesk.com/api/v2/users/create_or_update.json', + }, + httpRes: { + data: { + user: { + active: true, + alias: null, + chat_only: false, + created_at: '2020-03-17T10:21:15Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'testemail1@email', + external_id: 'exId-123', + iana_time_zone: 'America/New_York', + id: 900113780483, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'John Wick', + notes: null, + only_private_comments: false, + organization_id: 900001329943, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + 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: 'Eastern Time (US & Canada)', + two_factor_auth_enabled: false, + updated_at: '2020-03-23T15:56:56Z', + url: 'https://rudderlabtest1.zendesk.com/api/v2/users/900113780483.json', + user_fields: { birthday: null }, + verified: true, + }, + }, + status: 200, + }, + }, + { + httpReq: { + headers: { + Authorization: 'Basic cnVkZGVybGFidGVzdDJAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabtest2.zendesk.com/api/v2/users/search.json?query=testemail2@email', + }, + httpRes: { data: { count: 0, next_page: null, previous_page: null, users: [] }, status: 200 }, + }, + { + httpReq: { + data: { + user: { + email: 'testemail2@email', + external_id: '0000000000', + name: 'John Wick', + verified: true, + }, + }, + headers: { + Authorization: 'Basic cnVkZGVybGFidGVzdDJAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + 'Content-Type': 'application/json', + }, + method: 'POST', + url: 'https://rudderlabtest2.zendesk.com/api/v2/users/create_or_update.json', + }, + httpRes: { data: { user: {} }, status: 200 }, + }, +]; diff --git a/test/integrations/testTypes.ts b/test/integrations/testTypes.ts index 57d9c812e9..51667e8044 100644 --- a/test/integrations/testTypes.ts +++ b/test/integrations/testTypes.ts @@ -1,3 +1,6 @@ +import { AxiosResponse } from 'axios'; +import MockAdapter from 'axios-mock-adapter'; + export interface requestType { method: string; body?: any; @@ -34,4 +37,10 @@ export interface TestCaseData { input: inputType; output: outputType; mock?: mockType[]; + mockFns?: (mockAdapter: MockAdapter) => {}; } + +export type MockHttpCallsData = { + httpReq: Record; + httpRes: Partial; +}; diff --git a/test/integrations/testUtils.ts b/test/integrations/testUtils.ts index 815b211d20..8511ac41f4 100644 --- a/test/integrations/testUtils.ts +++ b/test/integrations/testUtils.ts @@ -1,6 +1,8 @@ import { globSync } from 'glob'; import { join } from 'path'; -import { TestCaseData } from './testTypes'; +import { MockHttpCallsData, TestCaseData } from './testTypes'; +import MockAdapter from 'axios-mock-adapter'; +import isMatch from 'lodash/isMatch'; export const getTestDataFilePaths = (dirPath: string, destination: string = ''): string[] => { const globPattern = join(dirPath, '**', 'data.ts'); @@ -14,3 +16,52 @@ export const getTestDataFilePaths = (dirPath: string, destination: string = ''): export const getTestData = (filePath): TestCaseData[] => { return require(filePath).data as TestCaseData[]; }; + +export const getMockHttpCallsData = (filePath): MockHttpCallsData[] => { + return require(filePath).networkCallsData as MockHttpCallsData[]; +}; + +export const getAllTestMockDataFilePaths = (dirPath: string, destination: string): string[] => { + const globPattern = join(dirPath, '**', 'network.ts'); + let testFilePaths = globSync(globPattern); + if (destination) { + testFilePaths = testFilePaths.filter((testFile) => testFile.includes(destination)); + } + return testFilePaths; +}; + +export const addMock = (mock: MockAdapter, axiosMock: MockHttpCallsData) => { + const { url, method, data: reqData, ...opts } = axiosMock.httpReq; + const { data, headers, status } = axiosMock.httpRes; + + const headersAsymMatch = { + asymmetricMatch: function (actual) { + return isMatch(actual, opts.headers); + }, + }; + + switch (method.toLowerCase()) { + case 'get': + // @ts-ignore + mock.onGet(url, reqData, headersAsymMatch).reply(status, data, headers); + break; + case 'delete': + // @ts-ignore + mock.onDelete(url, reqData, headersAsymMatch).reply(status, data, headers); + break; + case 'post': + // @ts-ignore + mock.onPost(url, reqData, headersAsymMatch).reply(status, data, headers); + break; + case 'patch': + // @ts-ignore + mock.onPatch(url, reqData, headersAsymMatch).reply(status, data, headers); + break; + case 'put': + // @ts-ignore + mock.onPut(url, reqData, headersAsymMatch).reply(status, data, headers); + break; + default: + break; + } +}; diff --git a/test/testHelper.js b/test/testHelper.js index 649f8cab13..5fe97fed67 100644 --- a/test/testHelper.js +++ b/test/testHelper.js @@ -7,6 +7,19 @@ const getFuncTestData = (dirPath, filePath) => { return testData; }; +const responses = []; + +const setResponsesForMockAxiosAdapter = ({url, method, data, options}, {response}) => { + if (process.env.GEN_AXIOS_FOR_TESTS === 'true') { + const reqObj = {url, ...options, method} + if (data) { + reqObj.data = data + } + responses.push(`{httpReq: ${JSON.stringify(reqObj)},httpRes: ${JSON.stringify(response)}},`) + } +} module.exports = { getFuncTestData, + responses, + setResponsesForMockAxiosAdapter }; From 4d6c4b834de005484dc1099a52c69ab6212273e8 Mon Sep 17 00:00:00 2001 From: AASHISH MALIK Date: Fri, 29 Sep 2023 10:16:46 +0530 Subject: [PATCH 4/8] feat: tslint rules enable (#2604) * feat: remove eslint issues * fix: fixed es-lint tests * fix: merge conflicts --- .eslintrc.json | 40 +- src/adapters/network.js | 4 +- src/adapters/utils/networkUtils.js | 4 +- src/cdk/v1/dcm_floodlight/transform.js | 4 +- src/cdk/v1/new_relic/transform.js | 1 + .../v2/destinations/dcm_floodlight/utils.js | 4 +- src/cdk/v2/destinations/eloqua/utils.js | 9 +- .../launchdarkly_audience/utils.js | 4 +- src/cdk/v2/handler.ts | 15 +- src/cdk/v2/utils.ts | 11 +- src/controllers/bulkUpload.ts | 69 ++- src/controllers/delivery.ts | 3 +- src/controllers/destination.ts | 8 +- src/controllers/eventTest.ts | 6 +- src/controllers/profile.ts | 2 - src/controllers/regulation.ts | 7 +- src/controllers/source.ts | 2 +- src/controllers/userTransform.ts | 3 - src/controllers/util/index.ts | 4 +- src/helpers/serviceSelector.ts | 20 +- src/interfaces/DestinationService.ts | 8 +- src/interfaces/SourceService.ts | 4 +- src/legacy/router.js | 23 +- src/middlewares/routeActivation.ts | 1 + src/routes/bulkUpload.ts | 4 +- src/routes/delivery.ts | 3 +- src/routes/destination.ts | 3 +- src/routes/index.ts | 21 +- src/routes/misc.ts | 3 +- src/routes/source.ts | 3 +- src/routes/testEvents.ts | 3 +- src/routes/userTransform.ts | 3 +- src/services/comparator.ts | 15 +- src/services/delivertTest/deliveryTest.ts | 1 + src/services/destination/cdkV1Integration.ts | 12 +- src/services/destination/cdkV2Integration.ts | 17 +- src/services/destination/nativeIntegration.ts | 15 +- .../destination/postTransformation.ts | 11 +- src/services/destination/preTransformation.ts | 6 +- src/services/errorReporting.ts | 2 +- src/services/eventTest/eventTester.ts | 46 +- src/services/misc.ts | 6 +- src/services/profile.ts | 11 +- src/services/source/nativeIntegration.ts | 10 +- src/services/source/postTransformation.ts | 3 +- src/services/userTransform.ts | 31 +- src/testRouter.js | 4 +- src/types/index.ts | 57 +-- src/util/dynamicConfigParser.ts | 7 +- src/util/fetch.js | 5 +- src/util/types.ts | 25 ++ src/util/utils.js | 3 +- .../destinations/active_campaign/transform.js | 11 +- .../destinations/adobe_analytics/transform.js | 22 +- src/v0/destinations/bqstream/transform.js | 4 +- src/v0/destinations/bqstream/util.js | 1 + src/v0/destinations/bqstream/util.test.js | 146 ++++--- src/v0/destinations/branch/transform.js | 7 +- src/v0/destinations/braze/networkHandler.js | 1 + src/v0/destinations/braze/transform.js | 9 +- src/v0/destinations/braze/util.js | 2 +- .../destinations/clevertap/networkHandler.js | 1 + .../criteo_audience/networkHandler.js | 1 + src/v0/destinations/criteo_audience/util.js | 4 +- src/v0/destinations/customerio/util.js | 14 +- src/v0/destinations/fb/networkHandler.js | 1 + .../fb_custom_audience/transform.js | 4 +- .../destinations/fb_custom_audience/util.js | 4 +- src/v0/destinations/ga/transform.js | 4 +- src/v0/destinations/ga360/transform.js | 4 +- src/v0/destinations/ga4/utils.js | 6 +- .../networkHandler.js | 9 +- .../transform.js | 5 +- .../transform.js | 3 +- .../utils.js | 6 +- .../google_cloud_function/transform.js | 4 +- src/v0/destinations/hs/HSTransform-v1.js | 8 +- src/v0/destinations/hs/HSTransform-v2.js | 12 +- .../destinations/intercom/networkHandler.js | 1 + src/v0/destinations/intercom/transform.js | 17 +- src/v0/destinations/iterable/transform.js | 14 +- src/v0/destinations/iterable/util.js | 27 +- src/v0/destinations/klaviyo/transform.js | 7 +- src/v0/destinations/klaviyo/util.js | 14 +- src/v0/destinations/kustomer/util.js | 8 +- src/v0/destinations/mailchimp/transform.js | 6 +- src/v0/destinations/mailjet/transform.js | 6 +- src/v0/destinations/mailmodo/transform.js | 4 +- src/v0/destinations/marketo/networkHandler.js | 1 - .../destinations/marketo_bulk_upload/util.js | 5 +- .../marketo_static_list/networkHandler.js | 2 +- .../marketo_static_list/transform.js | 4 +- src/v0/destinations/mp/deleteUsers.js | 8 +- src/v0/destinations/mp/transform.js | 10 +- src/v0/destinations/mp/util.js | 6 +- src/v0/destinations/ometria/transform.js | 2 +- src/v0/destinations/pardot/transform.js | 5 +- .../personalize/scripts/create-trackingid.js | 9 +- src/v0/destinations/personalize/transform.js | 22 +- src/v0/destinations/redis/transform.js | 6 +- src/v0/destinations/sendgrid/transform.js | 6 +- src/v0/destinations/sendinblue/transform.js | 1 + src/v0/destinations/singular/util.js | 4 +- src/v0/destinations/slack/transform.js | 3 +- .../networkHandler.js | 4 +- .../destinations/tiktok_ads/networkHandler.js | 1 + src/v0/destinations/tiktok_ads/transform.js | 1 + src/v0/destinations/tiktok_ads/util.js | 1 + .../tiktok_ads_offline_events/transform.js | 4 +- src/v0/sources/auth0/transform.js | 1 + src/v0/sources/shopify/transform.js | 5 +- src/v0/sources/shopify/util.js | 43 +- src/v0/util/deleteUserUtils.js | 4 +- src/v0/util/index.js | 53 +-- .../marketo_static_list/proxy_response.json | 2 +- test/__tests__/data/customerio_input.json | 394 +++--------------- ...ords_enhanced_conversions_proxy_input.json | 2 +- .../google_adwords_offline_conversions.json | 2 +- ...adwords_remarketing_lists_proxy_input.json | 2 +- .../marketo_static_list_proxy_output.json | 2 +- test/__tests__/data/slack_input.json | 2 +- test/__tests__/data/slack_output.json | 2 +- .../destinations/bqstream/router/data.ts | 24 +- 123 files changed, 723 insertions(+), 903 deletions(-) create mode 100644 src/util/types.ts diff --git a/.eslintrc.json b/.eslintrc.json index 805e5e7efe..c2614ac5ef 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -28,7 +28,7 @@ ], "unicorn/no-instanceof-array": "error", "unicorn/no-static-only-class": "error", - "unicorn/consistent-destructuring": "off", + "unicorn/consistent-destructuring": "error", "unicorn/better-regex": "error", "unicorn/no-for-loop": "error", "unicorn/prefer-array-some": "error", @@ -40,29 +40,31 @@ "unicorn/no-useless-spread": "error", "unicorn/no-useless-length-check": "error", "unicorn/prefer-export-from": "error", - "import/no-dynamic-require": "warn", - "no-param-reassign": "warn", + "import/no-dynamic-require": "error", + "no-param-reassign": "error", "sonarjs/prefer-immediate-return": "off", "sonarjs/no-nested-template-literals": "off", - "sonarjs/max-switch-cases": "off", - "sonarjs/no-small-switch": "warn", + "sonarjs/max-switch-cases": "error", + "sonarjs/no-small-switch": "error", "sonarjs/cognitive-complexity": ["error", 60], "@typescript-eslint/no-var-requires": "off", - "global-require": "off", - "@typescript-eslint/naming-convention": "off", - "@typescript-eslint/ban-types": "off", + "global-require": "error", + "@typescript-eslint/naming-convention": "error", + "@typescript-eslint/ban-types": "error", + "@typescript-eslint/no-explicit-any": "off", "class-methods-use-this": "off", - "@typescript-eslint/return-await": "off", - "import/prefer-default-export": "off", - "sonarjs/no-ignored-return": "off", - "no-new": "off", - "@typescript-eslint/no-shadow": "off", - "@typescript-eslint/no-loop-func": "off", - "sonarjs/no-same-line-conditional": "off", - "no-restricted-syntax": "off", - "sonarjs/no-duplicate-string": "off", - "sonarjs/no-identical-functions": "off", + "@typescript-eslint/return-await": "error", + "import/prefer-default-export": "error", + "sonarjs/no-ignored-return": "error", + "no-new": "error", + "@typescript-eslint/no-shadow": "error", + "@typescript-eslint/no-loop-func": "error", + "sonarjs/no-same-line-conditional": "error", + "no-restricted-syntax": "error", + "sonarjs/no-duplicate-string": "error", + "sonarjs/no-identical-functions": "error", "no-prototype-builtins": "off", - "@typescript-eslint/dot-notation": "off" + "@typescript-eslint/dot-notation": "error", + "@typescript-eslint/no-unused-vars": "error" } } diff --git a/src/adapters/network.js b/src/adapters/network.js index 5ee62029a3..375d9dc908 100644 --- a/src/adapters/network.js +++ b/src/adapters/network.js @@ -1,7 +1,7 @@ /* eslint-disable no-restricted-syntax */ /* eslint-disable no-undef */ -const _ = require('lodash'); +const lodash = require('lodash'); const http = require('http'); const https = require('https'); const axios = require('axios'); @@ -237,7 +237,7 @@ const getPayloadData = (body) => { let payload; let payloadFormat; Object.entries(body).forEach(([key, value]) => { - if (!_.isEmpty(value)) { + if (!lodash.isEmpty(value)) { payload = value; payloadFormat = key; } diff --git a/src/adapters/utils/networkUtils.js b/src/adapters/utils/networkUtils.js index 39b0e0504a..a88d803fac 100644 --- a/src/adapters/utils/networkUtils.js +++ b/src/adapters/utils/networkUtils.js @@ -1,5 +1,5 @@ /* eslint-disable eqeqeq */ -const _ = require('lodash'); +const lodash = require('lodash'); const { isEmpty } = require('lodash'); const { isHttpStatusRetryable, @@ -100,7 +100,7 @@ const parseDestResponse = (destResponse, destination = '') => { if ( !isDefinedAndNotNull(responseBody) || !isDefinedAndNotNull(status) || - !_.isNumber(status) || + !lodash.isNumber(status) || status === 0 ) { throw new AbortedError( diff --git a/src/cdk/v1/dcm_floodlight/transform.js b/src/cdk/v1/dcm_floodlight/transform.js index 4025c3cc01..d5835d3e2b 100644 --- a/src/cdk/v1/dcm_floodlight/transform.js +++ b/src/cdk/v1/dcm_floodlight/transform.js @@ -1,6 +1,6 @@ /* eslint-disable no-param-reassign */ const get = require('get-value'); -const _ = require('lodash'); +const lodash = require('lodash'); const { removeUndefinedAndNullValues, isDefinedAndNotNull, @@ -44,7 +44,7 @@ const transformCustomVariable = (customFloodlightVariable, message) => { if ( // the value is not null - !_.isNil(itemValue) && + !lodash.isNil(itemValue) && // the value is string and doesn't have any blacklisted characters !( typeof itemValue === 'string' && BLACKLISTED_CHARACTERS.some((k) => itemValue.includes(k)) diff --git a/src/cdk/v1/new_relic/transform.js b/src/cdk/v1/new_relic/transform.js index 67858910ad..43cebd548f 100644 --- a/src/cdk/v1/new_relic/transform.js +++ b/src/cdk/v1/new_relic/transform.js @@ -1,3 +1,4 @@ +/* eslint-disable no-param-reassign */ const { isBoolean } = require('lodash'); const { Utils } = require('rudder-transformer-cdk'); diff --git a/src/cdk/v2/destinations/dcm_floodlight/utils.js b/src/cdk/v2/destinations/dcm_floodlight/utils.js index e50f4f3b40..bee45bdea3 100644 --- a/src/cdk/v2/destinations/dcm_floodlight/utils.js +++ b/src/cdk/v2/destinations/dcm_floodlight/utils.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const { getValueFromPropertiesOrTraits, getHashFromArray } = require('../../../../v0/util'); const { GENERIC_TRUE_VALUES, GENERIC_FALSE_VALUES } = require('../../../../constants'); const { InstrumentationError } = require('../../../../v0/util/errorTypes'); @@ -35,7 +35,7 @@ const transformCustomVariable = (customFloodlightVariable, message) => { if ( // the value is not null - !_.isNil(itemValue) && + !lodash.isNil(itemValue) && // the value is string and doesn't have any blacklisted characters !( typeof itemValue === 'string' && BLACKLISTED_CHARACTERS.some((k) => itemValue.includes(k)) diff --git a/src/cdk/v2/destinations/eloqua/utils.js b/src/cdk/v2/destinations/eloqua/utils.js index baecffc6dc..a8e2afb3f8 100644 --- a/src/cdk/v2/destinations/eloqua/utils.js +++ b/src/cdk/v2/destinations/eloqua/utils.js @@ -1,10 +1,11 @@ const stringifyValues = (data) => { - Object.keys(data).forEach((key) => { - if (typeof data[key] !== 'string') { - data[key] = JSON.stringify(data[key]); + const output = data; + Object.keys(output).forEach((key) => { + if (typeof output[key] !== 'string') { + output[key] = JSON.stringify(output[key]); } }); - return data; + return output; }; module.exports = { stringifyValues, diff --git a/src/cdk/v2/destinations/launchdarkly_audience/utils.js b/src/cdk/v2/destinations/launchdarkly_audience/utils.js index 5bbcdfb6a3..6128fdfbfc 100644 --- a/src/cdk/v2/destinations/launchdarkly_audience/utils.js +++ b/src/cdk/v2/destinations/launchdarkly_audience/utils.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const { ACTION_TYPES, IDENTIFIER_KEY, MAX_IDENTIFIERS } = require('./config'); /** @@ -61,7 +61,7 @@ const batchIdentifiersList = (listData) => { ...audienceList.remove.map((item) => ({ ...item, type: 'remove' })), ]; - const chunkedData = _.chunk(combinedList, MAX_IDENTIFIERS); + const chunkedData = lodash.chunk(combinedList, MAX_IDENTIFIERS); // Group the chunks by action type (add/remove) const groupedData = chunkedData.map((chunk) => { diff --git a/src/cdk/v2/handler.ts b/src/cdk/v2/handler.ts index 898e83f7b8..4b3868b85b 100644 --- a/src/cdk/v2/handler.ts +++ b/src/cdk/v2/handler.ts @@ -5,6 +5,7 @@ import { ExecutionBindings, StepOutput, } from '@rudderstack/workflow-engine'; +import { FixMe } from '../../util/types'; import tags from '../../v0/util/tags'; @@ -25,7 +26,7 @@ export function getEmptyExecutionBindings() { return { outputs: {}, context, - setContext: (key: string, value: any) => { + setContext: (key: string, value: FixMe) => { context[key] = value; }, }; @@ -34,7 +35,7 @@ export function getEmptyExecutionBindings() { export async function getWorkflowEngine( destName: string, feature: string, - bindings: Record = {}, + bindings: Record = {}, ) { const destRootDir = getRootPathForDestination(destName); const workflowPath = await getWorkflowPath(destRootDir, feature); @@ -52,7 +53,7 @@ const workflowEnginePromiseMap = new Map(); export function getCachedWorkflowEngine( destName: string, feature: string, - bindings: Record = {}, + bindings: Record = {}, ): WorkflowEngine { // Create a new instance of the engine for the destination if needed // TODO: Use cache to avoid long living engine objects @@ -63,7 +64,7 @@ export function getCachedWorkflowEngine( return workflowEnginePromiseMap[destName][feature]; } -export async function executeWorkflow(workflowEngine: WorkflowEngine, parsedEvent: any) { +export async function executeWorkflow(workflowEngine: WorkflowEngine, parsedEvent: FixMe) { try { const result = await workflowEngine.execute(parsedEvent); // TODO: Handle remaining output scenarios @@ -75,9 +76,9 @@ export async function executeWorkflow(workflowEngine: WorkflowEngine, parsedEven export async function processCdkV2Workflow( destType: string, - parsedEvent: any, + parsedEvent: FixMe, feature: string, - bindings: Record = {}, + bindings: Record = {}, ) { try { const workflowEngine = await getCachedWorkflowEngine(destType, feature, bindings); @@ -90,7 +91,7 @@ export async function processCdkV2Workflow( export function executeStep( workflowEngine: WorkflowEngine, stepName: string, - input: any, + input: FixMe, bindings?: ExecutionBindings, ): Promise { return workflowEngine diff --git a/src/cdk/v2/utils.ts b/src/cdk/v2/utils.ts index 9d46f3dace..3fb26c07e0 100644 --- a/src/cdk/v2/utils.ts +++ b/src/cdk/v2/utils.ts @@ -1,14 +1,11 @@ import path from 'path'; import fs from 'fs/promises'; -import { - WorkflowExecutionError, - WorkflowCreationError, - StatusError, -} from '@rudderstack/workflow-engine'; +import { WorkflowExecutionError, WorkflowCreationError } from '@rudderstack/workflow-engine'; import logger from '../../logger'; import { generateErrorObject } from '../../v0/util'; import { PlatformError } from '../../v0/util/errorTypes'; import tags from '../../v0/util/tags'; +import { CatchErr } from '../../util/types'; const CDK_V2_ROOT_DIR = __dirname; @@ -83,7 +80,7 @@ export function getWorkflowEngineErrorMessage(err) { * @param {*} defTags default stat tags * @returns Error type object */ -export function getErrorInfo(err: any, isProd: boolean, defTags) { +export function getErrorInfo(err: CatchErr, isProd: boolean, defTags) { // Handle various CDK error types const message = isProd ? getWorkflowEngineErrorMessage(err) : err.message; @@ -91,7 +88,7 @@ export function getErrorInfo(err: any, isProd: boolean, defTags) { logger.error(`Error occurred during workflow step execution: ${message}`, err); // Determine the error instance - let errInstance: any = err; + let errInstance: CatchErr = err; if (err.originalError) { errInstance = err.originalError; errInstance.message = message; diff --git a/src/controllers/bulkUpload.ts b/src/controllers/bulkUpload.ts index e4d60b2021..85c4fe6b4f 100644 --- a/src/controllers/bulkUpload.ts +++ b/src/controllers/bulkUpload.ts @@ -1,5 +1,7 @@ +/* eslint-disable global-require, import/no-dynamic-require, @typescript-eslint/no-unused-vars */ import { client as errNotificationClient } from '../util/errorNotifier'; import logger from '../logger'; +import { CatchErr } from '../util/types'; // TODO: To be refactored and redisgned const getDestFileUploadHandler = (version, dest) => @@ -7,6 +9,7 @@ const getDestFileUploadHandler = (version, dest) => const getPollStatusHandler = (version, dest) => require(`../${version}/destinations/${dest}/poll`); const getJobStatusHandler = (version, dest) => require(`../${version}/destinations/${dest}/fetchJobStatus`); +const ERROR_MESSAGE_PROCESSOR_STRING = 'Error occurred while processing payload.'; const getCommonMetadata = (ctx) => // TODO: Parse information such as @@ -16,12 +19,23 @@ const getCommonMetadata = (ctx) => 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', JSON.stringify(ctx.request.body), ); - const getReqMetadata = () => { + const getReqMetadataFileUpload = () => { try { const reqBody = ctx.request.body; return { destType: reqBody?.destType }; @@ -42,16 +56,16 @@ export const fileUpload = async (ctx) => { let response; try { response = await destFileUploadHandler.processFileData(ctx.request.body); - } catch (error: any) { + } catch (error: CatchErr) { response = { statusCode: error?.response?.status || error?.status || 400, - error: error.message || 'Error occurred while processing payload.', + error: error.message || ERROR_MESSAGE_PROCESSOR_STRING, metadata: error.response ? error.response.metadata : null, }; errNotificationClient.notify(error, 'File Upload', { ...response, ...getCommonMetadata(ctx), - ...getReqMetadata(), + ...getReqMetadata(ctx), }); } ctx.body = response; @@ -67,15 +81,6 @@ export const pollStatus = async (ctx) => { 'Native(Bulk-Upload): Request to transformer:: /pollStatus route', JSON.stringify(ctx.request.body), ); - const getReqMetadata = () => { - try { - const reqBody = ctx.request.body; - return { destType: reqBody?.destType, importId: reqBody?.importId }; - } catch (error) { - // Do nothing - } - return {}; - }; const { destType } = ctx.request.body; const destFileUploadHandler = getPollStatusHandler('v0', destType.toLowerCase()); @@ -87,15 +92,15 @@ export const pollStatus = async (ctx) => { } try { response = await destFileUploadHandler.processPolling(ctx.request.body); - } catch (error: any) { + } catch (error: CatchErr) { response = { - statusCode: error.response?.status || error?.status || 400, - error: error.message || 'Error occurred while processing payload.', + statusCode: error.response?.status || 400, + error: error.message || ERROR_MESSAGE_PROCESSOR_STRING, }; errNotificationClient.notify(error, 'Poll Status', { ...response, ...getCommonMetadata(ctx), - ...getReqMetadata(), + ...getReqMetadata(ctx), }); } ctx.body = response; @@ -111,15 +116,6 @@ export const getWarnJobStatus = async (ctx) => { 'Native(Bulk-Upload): Request to transformer:: /getWarningJobs route', JSON.stringify(ctx.request.body), ); - const getReqMetadata = () => { - try { - const reqBody = ctx.request.body; - return { destType: reqBody?.destType, importId: reqBody?.importId }; - } catch (error) { - // Do nothing - } - return {}; - }; const { destType } = ctx.request.body; const destFileUploadHandler = getJobStatusHandler('v0', destType.toLowerCase()); @@ -132,15 +128,15 @@ export const getWarnJobStatus = async (ctx) => { let response; try { response = await destFileUploadHandler.processJobStatus(ctx.request.body, 'warn'); - } catch (error: any) { + } catch (error: CatchErr) { response = { statusCode: error.response ? error.response.status : 400, - error: error.message || 'Error occurred while processing payload.', + error: error.message || ERROR_MESSAGE_PROCESSOR_STRING, }; errNotificationClient.notify(error, 'Job Status', { ...response, ...getCommonMetadata(ctx), - ...getReqMetadata(), + ...getReqMetadata(ctx), }); } ctx.body = response; @@ -156,15 +152,6 @@ export const getFailedJobStatus = async (ctx) => { 'Native(Bulk-Upload): Request to transformer:: /getFailedJobs route', JSON.stringify(ctx.request.body), ); - const getReqMetadata = () => { - try { - const reqBody = ctx.request.body; - return { destType: reqBody?.destType, importId: reqBody?.importId }; - } catch (error) { - // Do nothing - } - return {}; - }; const { destType } = ctx.request.body; const destFileUploadHandler = getJobStatusHandler('v0', destType.toLowerCase()); @@ -177,15 +164,15 @@ export const getFailedJobStatus = async (ctx) => { let response; try { response = await destFileUploadHandler.processJobStatus(ctx.request.body, 'fail'); - } catch (error: any) { + } catch (error: CatchErr) { response = { statusCode: error.response ? error.response.status : 400, - error: error.message || 'Error occurred while processing payload.', + error: error.message || ERROR_MESSAGE_PROCESSOR_STRING, }; errNotificationClient.notify(error, 'Job Status', { ...response, ...getCommonMetadata(ctx), - ...getReqMetadata(), + ...getReqMetadata(ctx), }); } ctx.body = response; diff --git a/src/controllers/delivery.ts b/src/controllers/delivery.ts index d9a514d961..5dee091c46 100644 --- a/src/controllers/delivery.ts +++ b/src/controllers/delivery.ts @@ -7,6 +7,7 @@ import ControllerUtility from './util'; import logger from '../logger'; import DestinationPostTransformationService from '../services/destination/postTransformation'; import tags from '../v0/util/tags'; +import { FixMe } from '../util/types'; export default class DeliveryController { public static async deliverToDestination(ctx: Context) { @@ -49,7 +50,7 @@ export default class DeliveryController { }: { deliveryPayload: ProcessorTransformationOutput; destinationRequestPayload: ProcessorTransformationOutput; - } = ctx.request.body as any; + } = ctx.request.body as FixMe; const response = await DeliveryTestService.doTestDelivery( destination, destinationRequestPayload, diff --git a/src/controllers/destination.ts b/src/controllers/destination.ts index a5137ba170..60eac8a56c 100644 --- a/src/controllers/destination.ts +++ b/src/controllers/destination.ts @@ -14,7 +14,7 @@ import stats from '../util/stats'; import logger from '../logger'; import { getIntegrationVersion } from '../util/utils'; import tags from '../v0/util/tags'; -import { DynamicConfigParser } from '../util/dynamicConfigParser'; +import DynamicConfigParser from '../util/dynamicConfigParser'; export default class DestinationController { public static async destinationTransformAtProcessor(ctx: Context) { @@ -41,7 +41,9 @@ export default class DestinationController { ctx, ) as ProcessorTransformationRequest[]; const timestampCorrectEvents = ControllerUtility.handleTimestampInEvents(events); - events = DynamicConfigParser.process(timestampCorrectEvents) as ProcessorTransformationRequest[]; + events = DynamicConfigParser.process( + timestampCorrectEvents, + ) as ProcessorTransformationRequest[]; resplist = await integrationService.doProcessorTransformation( events, destination, @@ -194,7 +196,7 @@ export default class DestinationController { stats.timing('dest_transform_request_latency', startTime, { destination, feature: tags.FEATURES.BATCH, - version:"v0", + version: 'v0', }); return ctx; } diff --git a/src/controllers/eventTest.ts b/src/controllers/eventTest.ts index 6faf047d70..db6fc8cb6f 100644 --- a/src/controllers/eventTest.ts +++ b/src/controllers/eventTest.ts @@ -1,16 +1,18 @@ import { Context } from 'koa'; import EventTesterService from '../services/eventTest/eventTester'; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import { CatchErr, FixMe } from '../util/types'; export default class EventTestController { private static API_VERSION = '1'; public static async testEvent(ctx: Context) { const { version, destination }: { version: string; destination: string } = ctx.params as any; - const { events }: { events: any } = ctx.request.body as any; + const { events }: { events: FixMe } = ctx.request.body as FixMe; try { const respList = await EventTesterService.testEvent(events, version, destination); ctx.body = respList; - } catch (err: any) { + } catch (err: CatchErr) { // fail-safety error response ctx.body = { error: err.message || JSON.stringify(err), diff --git a/src/controllers/profile.ts b/src/controllers/profile.ts index 5f2dce4fe6..984f4ac645 100644 --- a/src/controllers/profile.ts +++ b/src/controllers/profile.ts @@ -1,5 +1,4 @@ import { Context } from 'koa'; -import MiscService from '../services/misc'; import ProfileService from '../services/profile'; import ControllerUtility from './util'; @@ -30,7 +29,6 @@ export default class ProfileController { }' */ public static async profile(ctx: Context) { - const requestMetadata = MiscService.getRequestMetadata(ctx); const format = ctx.request.query.format as string; const { credBucketDetails } = ctx.request.body as any; const response = await ProfileService.profile(credBucketDetails, format); diff --git a/src/controllers/regulation.ts b/src/controllers/regulation.ts index a36f1826b7..cefe1f748a 100644 --- a/src/controllers/regulation.ts +++ b/src/controllers/regulation.ts @@ -5,6 +5,8 @@ import ServiceSelector from '../helpers/serviceSelector'; import tags from '../v0/util/tags'; import stats from '../util/stats'; import PostTransformationDestinationService from '../services/destination/postTransformation'; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import { CatchErr } from '../util/types'; // TODO: refactor this class to new format export default class RegulationController { @@ -34,13 +36,14 @@ export default class RegulationController { ); ctx.body = resplist; ctx.status = resplist[0].statusCode; - } catch (error: any) { + } catch (error: CatchErr) { const metaTO = integrationService.getTags( userDeletionRequests[0].destType, 'unknown', 'unknown', tags.FEATURES.USER_DELETION, ); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const errResp = PostTransformationDestinationService.handleUserDeletionFailureEvents( error, metaTO, @@ -50,7 +53,7 @@ export default class RegulationController { } stats.timing('dest_transform_request_latency', startTime, { feature: tags.FEATURES.USER_DELETION, - version:"v0", + version: 'v0', }); return ctx; } diff --git a/src/controllers/source.ts b/src/controllers/source.ts index a413426cc7..efb6dc746e 100644 --- a/src/controllers/source.ts +++ b/src/controllers/source.ts @@ -12,7 +12,7 @@ export default class SourceController { JSON.stringify(ctx.request.body), ); const requestMetadata = MiscService.getRequestMetadata(ctx); - const events = ctx.request.body as Object[]; + const events = ctx.request.body as object[]; const { version, source }: { version: string; source: string } = ctx.params; const integrationService = ServiceSelector.getNativeSourceService(); try { diff --git a/src/controllers/userTransform.ts b/src/controllers/userTransform.ts index cc64f5db1b..1592aa4755 100644 --- a/src/controllers/userTransform.ts +++ b/src/controllers/userTransform.ts @@ -1,7 +1,5 @@ import { Context } from 'koa'; -import MiscService from '../services/misc'; import { ProcessorTransformationRequest, UserTransformationServiceResponse } from '../types/index'; -import { compileUserLibrary } from '../util/ivmFactory'; import UserTransformService from '../services/userTransform'; import logger from '../logger'; import { @@ -17,7 +15,6 @@ export default class UserTransformController { '(User transform - router:/customTransform ):: Request to transformer', JSON.stringify(ctx.request.body), ); - const requestMetadata = MiscService.getRequestMetadata(ctx); const events = ctx.request.body as ProcessorTransformationRequest[]; const processedRespone: UserTransformationServiceResponse = await UserTransformService.transformRoutine(events); diff --git a/src/controllers/util/index.ts b/src/controllers/util/index.ts index 67a314bc75..e2071968d7 100644 --- a/src/controllers/util/index.ts +++ b/src/controllers/util/index.ts @@ -18,9 +18,9 @@ export default class ControllerUtility { `context.${RETL_TIMESTAMP}`, `context.traits.${RETL_TIMESTAMP}`, `traits.${RETL_TIMESTAMP}`, - ...genericFieldMap['timestamp'], + ...genericFieldMap.timestamp, ], - [EventType.TRACK]: [`properties.${RETL_TIMESTAMP}`, ...genericFieldMap['timestamp']], + [EventType.TRACK]: [`properties.${RETL_TIMESTAMP}`, ...genericFieldMap.timestamp], }; private static getCompatibleStatusCode(status: number): number { diff --git a/src/helpers/serviceSelector.ts b/src/helpers/serviceSelector.ts index 99f897cedc..bac1a17c16 100644 --- a/src/helpers/serviceSelector.ts +++ b/src/helpers/serviceSelector.ts @@ -8,6 +8,7 @@ import SourceService from '../interfaces/SourceService'; import NativeIntegrationSourceService from '../services/source/nativeIntegration'; import { PlatformError } from '../v0/util/errorTypes'; import ComparatorService from '../services/comparator'; +import { FixMe } from '../util/types'; export default class ServiceSelector { private static serviceMap: Map = new Map(); @@ -19,23 +20,23 @@ export default class ServiceSelector { [INTEGRATION_SERVICE.NATIVE_SOURCE]: NativeIntegrationSourceService, }; - private static isCdkDestination(destinationDefinitionConfig: Object) { - return !!destinationDefinitionConfig?.['cdkEnabled']; + private static isCdkDestination(destinationDefinitionConfig: FixMe) { + return !!destinationDefinitionConfig?.cdkEnabled; } - private static isCdkV2Destination(destinationDefinitionConfig: Object) { - return Boolean(destinationDefinitionConfig?.['cdkV2Enabled']); + private static isCdkV2Destination(destinationDefinitionConfig: FixMe) { + return Boolean(destinationDefinitionConfig?.cdkV2Enabled); } - private static isComparatorEnabled(destinationDefinitionConfig: Object): boolean { + private static isComparatorEnabled(destinationDefinitionConfig: FixMe): boolean { return ( process.env.COMPARATOR_ENABLED === 'true' && - !!destinationDefinitionConfig['comparisonTestEnabeld'] + !!destinationDefinitionConfig.comparisonTestEnabeld ); } - private static getSecondaryServiceName(destinationDefinitionConfig: Object): string { - return destinationDefinitionConfig['comparisonService']; + private static getSecondaryServiceName(destinationDefinitionConfig: FixMe): string { + return destinationDefinitionConfig.comparisonService; } private static fetchCachedService(serviceType: string) { @@ -65,7 +66,7 @@ export default class ServiceSelector { private static getPrimaryDestinationService( events: ProcessorTransformationRequest[] | RouterTransformationRequestData[], ): DestinationService { - const destinationDefinitionConfig: Object = + const destinationDefinitionConfig: FixMe = events[0]?.destination?.DestinationDefinition?.Config; if (this.isCdkDestination(destinationDefinitionConfig)) { return this.fetchCachedService(INTEGRATION_SERVICE.CDK_V1_DEST); @@ -76,6 +77,7 @@ export default class ServiceSelector { return this.fetchCachedService(INTEGRATION_SERVICE.NATIVE_DEST); } + // eslint-disable-next-line @typescript-eslint/no-unused-vars public static getSourceService(arg: unknown) { // Implement source event based descision logic for selecting service } diff --git a/src/interfaces/DestinationService.ts b/src/interfaces/DestinationService.ts index b1cae047f8..123da35292 100644 --- a/src/interfaces/DestinationService.ts +++ b/src/interfaces/DestinationService.ts @@ -26,27 +26,27 @@ export default interface DestinationService { events: ProcessorTransformationRequest[], destinationType: string, version: string, - requestMetadata: Object, + requestMetadata: NonNullable, ): Promise; doRouterTransformation( events: RouterTransformationRequestData[], destinationType: string, version: string, - requestMetadata: Object, + requestMetadata: NonNullable, ): Promise; doBatchTransformation( events: RouterTransformationRequestData[], destinationType: string, version: string, - requestMetadata: Object, + requestMetadata: NonNullable, ): RouterTransformationResponse[]; deliver( event: ProcessorTransformationOutput, destinationType: string, - requestMetadata: Object, + requestMetadata: NonNullable, ): Promise; processUserDeletion( diff --git a/src/interfaces/SourceService.ts b/src/interfaces/SourceService.ts index 28d72ee990..99b29f095b 100644 --- a/src/interfaces/SourceService.ts +++ b/src/interfaces/SourceService.ts @@ -4,9 +4,9 @@ export default interface SourceService { getTags(): MetaTransferObject; sourceTransformRoutine( - sourceEvents: Object[], + sourceEvents: NonNullable[], sourceType: string, version: string, - requestMetadata: Object, + requestMetadata: NonNullable, ): Promise; } diff --git a/src/legacy/router.js b/src/legacy/router.js index 361823a185..a8c2b49a1a 100644 --- a/src/legacy/router.js +++ b/src/legacy/router.js @@ -4,7 +4,7 @@ /* eslint-disable import/no-dynamic-require */ /* eslint-disable global-require */ const Router = require('@koa/router'); -const _ = require('lodash'); +const lodash = require('lodash'); const fs = require('fs'); const path = require('path'); const logger = require('../logger'); @@ -88,7 +88,7 @@ const functionsEnabled = () => { return areFunctionsEnabled === 1; }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars function getCommonMetadata(ctx) { // TODO: Parse information such as // cluster, namespace, etc information @@ -358,7 +358,7 @@ async function routerHandleDest(ctx) { ctx.body = `${destType} doesn't support router transform`; return null; } - const allDestEvents = _.groupBy(input, (event) => event.destination.ID); + const allDestEvents = lodash.groupBy(input, (event) => event.destination.ID); await Promise.all( Object.values(allDestEvents).map(async (destInputArray) => { const newDestInputArray = processDynamicConfig(destInputArray, 'router'); @@ -389,7 +389,10 @@ async function routerHandleDest(ctx) { // Add default stat tags respEvents - .filter((resp) => 'error' in resp && _.isObject(resp.statTags) && !_.isEmpty(resp.statTags)) + .filter( + (resp) => + 'error' in resp && lodash.isObject(resp.statTags) && !lodash.isEmpty(resp.statTags), + ) .forEach((resp) => { // eslint-disable-next-line no-param-reassign resp.statTags = { @@ -526,13 +529,13 @@ if (startDestTransformer) { }); let groupedEvents; if (processSessions) { - groupedEvents = _.groupBy(events, (event) => { + 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 = _.groupBy( + groupedEvents = lodash.groupBy( events, (event) => `${event.metadata.destinationId}_${event.metadata.sourceId}`, ); @@ -587,7 +590,7 @@ if (startDestTransformer) { return { statusCode: 400, error: ev.error, - metadata: _.isEmpty(ev.metadata) ? commonMetadata : ev.metadata, + metadata: lodash.isEmpty(ev.metadata) ? commonMetadata : ev.metadata, }; } if (!isNonFuncObject(ev.transformedEvent)) { @@ -596,12 +599,12 @@ if (startDestTransformer) { error: `returned event in events from user transformation is not an object. transformationVersionId:${transformationVersionId} and returned event: ${JSON.stringify( ev.transformedEvent, )}`, - metadata: _.isEmpty(ev.metadata) ? commonMetadata : ev.metadata, + metadata: lodash.isEmpty(ev.metadata) ? commonMetadata : ev.metadata, }; } return { output: ev.transformedEvent, - metadata: _.isEmpty(ev.metadata) ? commonMetadata : ev.metadata, + metadata: lodash.isEmpty(ev.metadata) ? commonMetadata : ev.metadata, statusCode: 200, }; }), @@ -995,7 +998,7 @@ const batchHandler = (ctx) => { ctx.body = `${destType} doesn't support batching`; return null; } - const allDestEvents = _.groupBy(input, (event) => event.destination.ID); + const allDestEvents = lodash.groupBy(input, (event) => event.destination.ID); const response = { batchedRequests: [], errors: [] }; Object.entries(allDestEvents).forEach(([, destEvents]) => { diff --git a/src/middlewares/routeActivation.ts b/src/middlewares/routeActivation.ts index bf457b2faa..dfdaef964e 100644 --- a/src/middlewares/routeActivation.ts +++ b/src/middlewares/routeActivation.ts @@ -78,6 +78,7 @@ export default class RouteActivationMiddleware { ); } + // eslint-disable-next-line sonarjs/no-identical-functions public static destinationBatchFilter(ctx: Context, next: Next) { const routerRequest = ctx.request.body as RouterTransformationRequest; const destination = routerRequest.destType; diff --git a/src/routes/bulkUpload.ts b/src/routes/bulkUpload.ts index 386cf78c36..e7aaf897c8 100644 --- a/src/routes/bulkUpload.ts +++ b/src/routes/bulkUpload.ts @@ -12,4 +12,6 @@ router.post('/fileUpload', fileUpload); router.post('/pollStatus', pollStatus); router.post('/getFailedJobs', getFailedJobStatus); router.post('/getWarningJobs', getWarnJobStatus); -export const bulkUploadRoutes = router.routes(); +const bulkUploadRoutes = router.routes(); + +export default bulkUploadRoutes; \ No newline at end of file diff --git a/src/routes/delivery.ts b/src/routes/delivery.ts index de4ec65934..141700fd9f 100644 --- a/src/routes/delivery.ts +++ b/src/routes/delivery.ts @@ -17,4 +17,5 @@ router.post( DeliveryController.testDestinationDelivery, ); -export const proxyRoutes = router.routes(); +const proxyRoutes = router.routes(); +export default proxyRoutes; diff --git a/src/routes/destination.ts b/src/routes/destination.ts index bed2a1af20..ee19fd1246 100644 --- a/src/routes/destination.ts +++ b/src/routes/destination.ts @@ -26,4 +26,5 @@ router.post( router.post('/deleteUsers', RegulationController.deleteUsers); -export const destinationRoutes = router.routes(); +const destinationRoutes = router.routes(); +export default destinationRoutes; \ No newline at end of file diff --git a/src/routes/index.ts b/src/routes/index.ts index cfeb4db9ea..d77584bea3 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -4,20 +4,23 @@ import { existsSync, readFileSync } from 'fs'; import dotenv from 'dotenv'; import { koaSwagger } from 'koa2-swagger-ui'; import path from 'path'; -import { bulkUploadRoutes } from './bulkUpload'; -import { proxyRoutes } from './delivery'; -import { destinationRoutes } from './destination'; -import { miscRoutes } from './misc'; -import { sourceRoutes } from './source'; -import { testEventRoutes } from './testEvents'; +import userTransformRoutes from './userTransform'; +import bulkUploadRoutes from './bulkUpload'; +import proxyRoutes from './delivery'; +import destinationRoutes from './destination'; +import miscRoutes from './misc'; +import sourceRoutes from './source'; +import testEventRoutes from './testEvents'; import { trackingPlanRoutes } from './trackingPlan'; -import { userTransformRoutes } from './userTransform'; import logger from '../logger'; import { isNotEmpty } from '../v0/util'; dotenv.config(); -export function applicationRoutes(app: Koa) { +// 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); @@ -28,7 +31,7 @@ export function applicationRoutes(app: Koa) { app.use(userTransformRoutes); } -export function addSwaggerRoutes(app: Koa) { +export function addSwaggerRoutes(app: Koa) { // Ading swagger routes, check swagger docs in http://localhost:9090/docs try { diff --git a/src/routes/misc.ts b/src/routes/misc.ts index 3e30b9dd39..750c1194dd 100644 --- a/src/routes/misc.ts +++ b/src/routes/misc.ts @@ -13,4 +13,5 @@ router.get('/features', MiscController.features); router.get('/debug/pprof/profile', MiscController.getCPUProfile); router.get('/debug/pprof/heap', MiscController.getHeapProfile); -export const miscRoutes = router.routes(); +const miscRoutes = router.routes(); +export default miscRoutes; diff --git a/src/routes/source.ts b/src/routes/source.ts index 675e2286ce..ade26c8700 100644 --- a/src/routes/source.ts +++ b/src/routes/source.ts @@ -11,4 +11,5 @@ router.post( SourceController.sourceTransform, ); -export const sourceRoutes = router.routes(); +const sourceRoutes = router.routes(); +export default sourceRoutes; diff --git a/src/routes/testEvents.ts b/src/routes/testEvents.ts index cbfd78f3ec..f842887b91 100644 --- a/src/routes/testEvents.ts +++ b/src/routes/testEvents.ts @@ -6,4 +6,5 @@ const router = new Router({ prefix: '/test-router' }); router.post('/:version/:destination', EventTestController.testEvent); router.get('/:version/health', EventTestController.status); -export const testEventRoutes = router.routes(); +const testEventRoutes = router.routes(); +export default testEventRoutes; \ No newline at end of file diff --git a/src/routes/userTransform.ts b/src/routes/userTransform.ts index 2f6dcd417c..2727d9ef05 100644 --- a/src/routes/userTransform.ts +++ b/src/routes/userTransform.ts @@ -30,4 +30,5 @@ router.post( UserTransformController.extractLibhandle, ); -export const userTransformRoutes = router.routes(); +const userTransformRoutes = router.routes(); +export default userTransformRoutes; \ No newline at end of file diff --git a/src/services/comparator.ts b/src/services/comparator.ts index ae6e1bcf57..3495b7bbfd 100644 --- a/src/services/comparator.ts +++ b/src/services/comparator.ts @@ -1,3 +1,4 @@ +/* eslint-disable class-methods-use-this */ import IntegrationDestinationService from '../interfaces/DestinationService'; import { DeliveryResponse, @@ -62,7 +63,7 @@ export default class ComparatorService implements IntegrationDestinationService } private getTestThreshold(destination: Destination) { - return destination.DestinationDefinition?.Config['camparisonTestThreshold'] || 0; + return destination.DestinationDefinition?.Config?.camparisonTestThreshold || 0; } private getComparisonLogs( @@ -81,6 +82,7 @@ export default class ComparatorService implements IntegrationDestinationService return; } + // eslint-disable-next-line no-restricted-syntax for (const [index, element] of primaryResplist.entries()) { const objectDiff = CommonUtils.objectDiff(element, secondaryResplist[index]); if (Object.keys(objectDiff).length > 0) { @@ -129,6 +131,7 @@ export default class ComparatorService implements IntegrationDestinationService } let hasComparisonFailed = false; + // eslint-disable-next-line no-restricted-syntax for (const [index, element] of primaryResplist.entries()) { const objectDiff = CommonUtils.objectDiff(element, secondaryResplist[index]); if (Object.keys(objectDiff).length > 0) { @@ -156,7 +159,7 @@ export default class ComparatorService implements IntegrationDestinationService secondaryServiceCallback: any, destinationType: string, version: string, - requestMetadata: Object, + requestMetadata: NonNullable, feature: string, destinationId: string, ): Promise { @@ -194,7 +197,7 @@ export default class ComparatorService implements IntegrationDestinationService events: ProcessorTransformationRequest[], destinationType: string, version: string, - requestMetadata: Object, + requestMetadata: NonNullable, ): Promise { const destinationId = events[0].destination.ID; const primaryStartTime = process.hrtime(); @@ -252,7 +255,7 @@ export default class ComparatorService implements IntegrationDestinationService events: RouterTransformationRequestData[], destinationType: string, version: string, - requestMetadata: Object, + requestMetadata: NonNullable, ): Promise { const destinationId = events[0].destination.ID; const primaryStartTime = process.hrtime(); @@ -310,7 +313,7 @@ export default class ComparatorService implements IntegrationDestinationService events: RouterTransformationRequestData[], destinationType: string, version: string, - requestMetadata: Object, + requestMetadata: NonNullable, ): RouterTransformationResponse[] { const destinationId = events[0].destination.ID; const primaryStartTime = process.hrtime(); @@ -367,7 +370,7 @@ export default class ComparatorService implements IntegrationDestinationService public async deliver( event: ProcessorTransformationOutput, destinationType: string, - requestMetadata: Object, + requestMetadata: NonNullable, ): Promise { const primaryResplist = await this.primaryService.deliver( event, diff --git a/src/services/delivertTest/deliveryTest.ts b/src/services/delivertTest/deliveryTest.ts index 051b67b568..e5713073c1 100644 --- a/src/services/delivertTest/deliveryTest.ts +++ b/src/services/delivertTest/deliveryTest.ts @@ -29,6 +29,7 @@ export default class DeliveryTestService { // 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); + // eslint-disable-next-line no-param-reassign routerDestReqPayload.data = routerDataVal; const proxyDataVal = new URLSearchParams(); diff --git a/src/services/destination/cdkV1Integration.ts b/src/services/destination/cdkV1Integration.ts index 44842fdddb..a016665afb 100644 --- a/src/services/destination/cdkV1Integration.ts +++ b/src/services/destination/cdkV1Integration.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ import { ConfigFactory, Executor, RudderBaseConfig } from 'rudder-transformer-cdk'; import path from 'path'; import IntegrationDestinationService from '../../interfaces/DestinationService'; @@ -17,6 +18,7 @@ import { TransformationError } from '../../v0/util/errorTypes'; import DestinationPostTransformationService from './postTransformation'; import tags from '../../v0/util/tags'; import { getErrorInfo } from '../../cdk/v1/handler'; +import { CatchErr } from '../../util/types'; export default class CDKV1DestinationService implements IntegrationDestinationService { public init() { @@ -63,7 +65,7 @@ export default class CDKV1DestinationService implements IntegrationDestinationSe events: ProcessorTransformationRequest[], destinationType: string, _version: string, - _requestMetadata: Object, + _requestMetadata: NonNullable, ): Promise { const tfConfig = await ConfigFactory.getConfig(destinationType); const respList: ProcessorTransformationResponse[][] = await Promise.all( @@ -76,7 +78,7 @@ export default class CDKV1DestinationService implements IntegrationDestinationSe transformedPayloads, undefined, ); - } catch (error: any) { + } catch (error: CatchErr) { const metaTO = this.getTags( destinationType, event.metadata.destinationId, @@ -100,7 +102,7 @@ export default class CDKV1DestinationService implements IntegrationDestinationSe _events: RouterTransformationRequestData[], _destinationType: string, _version: string, - _requestMetadata: Object, + _requestMetadata: NonNullable, ): Promise { throw new TransformationError('CDKV1 Does not Implement Router Transform Routine'); } @@ -109,7 +111,7 @@ export default class CDKV1DestinationService implements IntegrationDestinationSe _events: RouterTransformationRequestData[], _destinationType: string, _version: any, - _requestMetadata: Object, + _requestMetadata: NonNullable, ): RouterTransformationResponse[] { throw new TransformationError('CDKV1 Does not Implement Batch Transform Routine'); } @@ -117,7 +119,7 @@ export default class CDKV1DestinationService implements IntegrationDestinationSe public deliver( _event: ProcessorTransformationOutput, _destinationType: string, - _requestMetadata: Object, + _requestMetadata: NonNullable, ): Promise { throw new TransformationError('CDV1 Does not Implement Delivery Routine'); } diff --git a/src/services/destination/cdkV2Integration.ts b/src/services/destination/cdkV2Integration.ts index 04a2dcb799..b4c0a15e87 100644 --- a/src/services/destination/cdkV2Integration.ts +++ b/src/services/destination/cdkV2Integration.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +/* eslint-disable class-methods-use-this */ import groupBy from 'lodash/groupBy'; import { processCdkV2Workflow } from '../../cdk/v2/handler'; import IntegrationDestinationService from '../../interfaces/DestinationService'; @@ -17,6 +19,7 @@ import { TransformationError } from '../../v0/util/errorTypes'; import tags from '../../v0/util/tags'; import DestinationPostTransformationService from './postTransformation'; import stats from '../../util/stats'; +import { CatchErr } from '../../util/types'; export default class CDKV2DestinationService implements IntegrationDestinationService { public init() {} @@ -49,7 +52,7 @@ export default class CDKV2DestinationService implements IntegrationDestinationSe events: ProcessorTransformationRequest[], destinationType: string, _version: string, - _requestMetadata: Object, + _requestMetadata: NonNullable, ): Promise { // TODO: Change the promise type const respList: ProcessorTransformationResponse[][] = await Promise.all( @@ -78,7 +81,7 @@ export default class CDKV2DestinationService implements IntegrationDestinationSe transformedPayloads, undefined, ); - } catch (error: any) { + } catch (error: CatchErr) { const metaTo = this.getTags( destinationType, event.metadata.destinationId, @@ -105,9 +108,9 @@ export default class CDKV2DestinationService implements IntegrationDestinationSe events: RouterTransformationRequestData[], destinationType: string, _version: string, - _requestMetadata: Object, + _requestMetadata: NonNullable, ): Promise { - const allDestEvents: Object = groupBy( + const allDestEvents: object = groupBy( events, (ev: RouterTransformationRequestData) => ev.destination?.ID, ); @@ -131,7 +134,7 @@ export default class CDKV2DestinationService implements IntegrationDestinationSe tags.IMPLEMENTATIONS.CDK_V2, destinationType.toUpperCase(), ); - } catch (error: any) { + } catch (error: CatchErr) { metaTo.metadatas = destInputArray.map((input) => input.metadata); const erroredResp = DestinationPostTransformationService.handleRouterTransformFailureEvents( @@ -150,7 +153,7 @@ export default class CDKV2DestinationService implements IntegrationDestinationSe _events: RouterTransformationRequestData[], _destinationType: string, _version: string, - _requestMetadata: Object, + _requestMetadata: NonNullable, ): RouterTransformationResponse[] { throw new TransformationError('CDKV2 Does not Implement Batch Transform Routine'); } @@ -158,7 +161,7 @@ export default class CDKV2DestinationService implements IntegrationDestinationSe public deliver( _event: ProcessorTransformationOutput, _destinationType: string, - _requestMetadata: Object, + _requestMetadata: NonNullable, ): Promise { throw new TransformationError('CDKV2 Does not Implement Delivery Routine'); } diff --git a/src/services/destination/nativeIntegration.ts b/src/services/destination/nativeIntegration.ts index 8cec0f573f..49fb806094 100644 --- a/src/services/destination/nativeIntegration.ts +++ b/src/services/destination/nativeIntegration.ts @@ -1,5 +1,6 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ import groupBy from 'lodash/groupBy'; -import cloneDeep from 'lodash/cloneDeep' +import cloneDeep from 'lodash/cloneDeep'; import IntegrationDestinationService from '../../interfaces/DestinationService'; import { DeliveryResponse, @@ -49,7 +50,7 @@ export default class NativeIntegrationDestinationService implements IntegrationD events: ProcessorTransformationRequest[], destinationType: string, version: string, - _requestMetadata: Object, + _requestMetadata: NonNullable, ): Promise { const destHandler = FetchHandler.getDestHandler(destinationType, version); const respList: ProcessorTransformationResponse[][] = await Promise.all( @@ -87,10 +88,10 @@ export default class NativeIntegrationDestinationService implements IntegrationD events: RouterTransformationRequestData[], destinationType: string, version: string, - _requestMetadata: Object, + _requestMetadata: NonNullable, ): Promise { const destHandler = FetchHandler.getDestHandler(destinationType, version); - const allDestEvents: Object = groupBy( + const allDestEvents: NonNullable = groupBy( events, (ev: RouterTransformationRequestData) => ev.destination?.ID, ); @@ -131,13 +132,13 @@ export default class NativeIntegrationDestinationService implements IntegrationD events: RouterTransformationRequestData[], destinationType: string, version: any, - _requestMetadata: Object, + _requestMetadata: NonNullable, ): RouterTransformationResponse[] { const destHandler = FetchHandler.getDestHandler(destinationType, version); if (!destHandler.batch) { throw new Error(`${destinationType} does not implement batch`); } - const allDestEvents: Object = groupBy( + const allDestEvents: NonNullable = groupBy( events, (ev: RouterTransformationRequestData) => ev.destination?.ID, ); @@ -167,7 +168,7 @@ export default class NativeIntegrationDestinationService implements IntegrationD public async deliver( destinationRequest: ProcessorTransformationOutput, destinationType: string, - _requestMetadata: Object, + _requestMetadata: NonNullable, ): Promise { try { const networkHandler = networkHandlerFactory.getNetworkHandler(destinationType); diff --git a/src/services/destination/postTransformation.ts b/src/services/destination/postTransformation.ts index 9e04f97fac..090e39b059 100644 --- a/src/services/destination/postTransformation.ts +++ b/src/services/destination/postTransformation.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-param-reassign */ import cloneDeep from 'lodash/cloneDeep'; import isObject from 'lodash/isObject'; import isEmpty from 'lodash/isEmpty'; @@ -47,7 +48,7 @@ export default class DestinationPostTransformationService { } public static handleProcessorTransformFailureEvents( - error: Object, + error: NonNullable, metaTo: MetaTransferObject, ): ProcessorTransformationResponse { const errObj = generateErrorObject(error, metaTo.errorDetails); @@ -105,7 +106,7 @@ export default class DestinationPostTransformationService { } public static handleRouterTransformFailureEvents( - error: Object, + error: NonNullable, metaTo: MetaTransferObject, ): RouterTransformationResponse { const errObj = generateErrorObject(error, metaTo.errorDetails); @@ -122,7 +123,7 @@ export default class DestinationPostTransformationService { } public static handleBatchTransformFailureEvents( - error: Object, + error: NonNullable, metaTo: MetaTransferObject, ): RouterTransformationResponse { const errObj = generateErrorObject(error, metaTo.errorDetails); @@ -138,7 +139,7 @@ export default class DestinationPostTransformationService { } public static handleDeliveryFailureEvents( - error: Object, + error: NonNullable, metaTo: MetaTransferObject, ): DeliveryResponse { const errObj = generateErrorObject(error, metaTo.errorDetails, false); @@ -156,7 +157,7 @@ export default class DestinationPostTransformationService { } public static handleUserDeletionFailureEvents( - error: Object, + error: NonNullable, metaTo: MetaTransferObject, ): UserDeletionResponse { const errObj = generateErrorObject(error, metaTo.errorDetails, false); diff --git a/src/services/destination/preTransformation.ts b/src/services/destination/preTransformation.ts index 61ca20f7fe..dd5579b7b9 100644 --- a/src/services/destination/preTransformation.ts +++ b/src/services/destination/preTransformation.ts @@ -1,6 +1,5 @@ import { Context } from 'koa'; import { ProcessorTransformationRequest, RouterTransformationRequestData } from '../../types/index'; -import { DynamicConfigParser } from '../../util/dynamicConfigParser'; export default class PreTransformationDestinationService { public static preProcess( @@ -8,12 +7,13 @@ export default class PreTransformationDestinationService { ctx: Context, ) { const reqParams = ctx.request.query; - events = events.map( + const eventsProcessed = events.map( (event: ProcessorTransformationRequest | RouterTransformationRequestData) => { + // eslint-disable-next-line no-param-reassign event.request = { query: reqParams }; return event; }, ); - return events; + return eventsProcessed; } } diff --git a/src/services/errorReporting.ts b/src/services/errorReporting.ts index ba0bd9b21c..2d3c84ff30 100644 --- a/src/services/errorReporting.ts +++ b/src/services/errorReporting.ts @@ -1,7 +1,7 @@ import { client } from '../util/errorNotifier'; export default class ErrorReportingService { - public static reportError(error: Object, context: string, errorResp: Object) { + public static reportError(error: NonNullable, context: string, errorResp: object) { client.notify(error, context, { ...errorResp, }); diff --git a/src/services/eventTest/eventTester.ts b/src/services/eventTest/eventTester.ts index 3055b947af..d4f30fff78 100644 --- a/src/services/eventTest/eventTester.ts +++ b/src/services/eventTest/eventTester.ts @@ -1,7 +1,9 @@ import { sendToDestination, userTransformHandler } from '../../routerUtils'; +import { FixMe } from '../../util/types'; export default class EventTesterService { private static getDestHandler(version, destination) { + // eslint-disable-next-line global-require, import/no-dynamic-require return require(`../../${version}/destinations/${destination}/transform`); } @@ -9,7 +11,7 @@ export default class EventTesterService { function capitalize(s) { return s === 'id' ? s.toUpperCase() : s.charAt(0).toUpperCase() + s.slice(1); } - const transformedObj = {}; + let transformedObj: FixMe; const { destinationDefinition } = dest; Object.keys(dest).forEach((key) => { transformedObj[capitalize(key)] = dest[key]; @@ -19,7 +21,7 @@ export default class EventTesterService { Object.keys(destinationDefinition).forEach((key) => { destDef[capitalize(key)] = destinationDefinition[key]; }); - transformedObj['DestinationDefinition'] = destDef; + transformedObj.DestinationDefinition = destDef; return transformedObj; } @@ -52,19 +54,19 @@ export default class EventTesterService { libraries, }; - let response = {}; + let response: FixMe; let errorFound = false; if (stage.user_transform) { let librariesVersionIDs = []; - if (event.libraries) { + if (libraries) { librariesVersionIDs = events[0].libraries.map((library) => library.versionId); } const transformationVersionId = ev.destination && - ev.destination['Transformations'] && - ev.destination['Transformations'][0] && - ev.destination['Transformations'][0].versionId; + ev.destination.Transformations && + ev.destination.Transformations[0] && + ev.destination.Transformations[0].versionId; if (transformationVersionId) { try { @@ -78,16 +80,16 @@ export default class EventTesterService { throw new Error(userTransformedEvent.error); } - response['user_transformed_payload'] = userTransformedEvent.transformedEvent; + response.user_transformed_payload = userTransformedEvent.transformedEvent; ev.message = userTransformedEvent.transformedEvent; } catch (err: any) { errorFound = true; - response['user_transformed_payload'] = { + response.user_transformed_payload = { error: err.message || JSON.stringify(err), }; } } else { - response['user_transformed_payload'] = { + response.user_transformed_payload = { error: 'Transformation VersionID not found', }; } @@ -99,18 +101,18 @@ export default class EventTesterService { const desthandler = this.getDestHandler(version, dest); const transformedOutput = await desthandler.process(ev); if (Array.isArray(transformedOutput)) { - response['dest_transformed_payload'] = transformedOutput; + response.dest_transformed_payload = transformedOutput; } else { - response['dest_transformed_payload'] = [transformedOutput]; + response.dest_transformed_payload = [transformedOutput]; } } catch (err: any) { errorFound = true; - response['dest_transformed_payload'] = { + response.dest_transformed_payload = { error: err.message || JSON.stringify(err), }; } } else { - response['dest_transformed_payload'] = { + response.dest_transformed_payload = { error: 'error encountered in user_transformation stage. Aborting.', }; } @@ -119,27 +121,27 @@ export default class EventTesterService { if (stage.dest_transform && stage.send_to_destination) { // send event to destination only after transformation if (!errorFound) { - const destResponses: any[] = []; - const destResponseStatuses: any[] = []; + const destResponses: FixMe[] = []; + const destResponseStatuses: FixMe[] = []; - const transformedPayloads = response['dest_transformed_payload']; + const transformedPayloads = response.dest_transformed_payload; // eslint-disable-next-line no-restricted-syntax for (const payload of transformedPayloads) { // eslint-disable-next-line no-await-in-loop const parsedResponse = await sendToDestination(dest, payload); let contentType = ''; - let response = ''; + let responsePayload = ''; if (parsedResponse.headers) { contentType = parsedResponse.headers['content-type']; if (this.isSupportedContentType(contentType)) { - response = parsedResponse.response; + responsePayload = parsedResponse.response; } } else if (parsedResponse.networkFailure) { - response = parsedResponse.response; + responsePayload = parsedResponse.response; } - destResponses.push(response); + destResponses.push(responsePayload); destResponseStatuses.push(parsedResponse.status); // TODO: Use updated handleResponseTransform function @@ -162,7 +164,7 @@ export default class EventTesterService { destination_response_status: destResponseStatuses, }; } else { - response['destination_response'] = { + response.destination_response = { error: 'error encountered in dest_transformation stage. Aborting.', }; } diff --git a/src/services/misc.ts b/src/services/misc.ts index 2805f58584..fe38b5b2bd 100644 --- a/src/services/misc.ts +++ b/src/services/misc.ts @@ -1,9 +1,10 @@ +/* eslint-disable global-require, import/no-dynamic-require */ import fs from 'fs'; import path from 'path'; import { Context } from 'koa'; import { DestHandlerMap } from '../constants/destinationCanonicalNames'; import { Metadata } from '../types'; -import { getCPUProfile, getHeapProfile, } from '../middleware'; +import { getCPUProfile, getHeapProfile } from '../middleware'; export default class MiscService { public static getDestHandler(dest: string, version: string) { @@ -21,6 +22,7 @@ export default class MiscService { return require(`../${version}/destinations/${dest}/deleteUsers`); } + // eslint-disable-next-line @typescript-eslint/no-unused-vars public static getRequestMetadata(ctx: Context) { // TODO: Parse information such as // cluster, namespace, etc information @@ -69,6 +71,6 @@ export default class MiscService { } public static async getHeapProfile() { - return getHeapProfile() + return getHeapProfile(); } } diff --git a/src/services/profile.ts b/src/services/profile.ts index 5f02b5c2fa..4d7a7104e7 100644 --- a/src/services/profile.ts +++ b/src/services/profile.ts @@ -7,6 +7,8 @@ import v8 from 'v8'; import pprof, { heap } from '@datadog/pprof'; import { promisify } from 'util'; import logger from '../logger'; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import { CatchErr } from '../util/types'; // The average number of bytes between samples. // 512*1024 = 524288 @@ -22,6 +24,7 @@ heap.start(intervalBytes, stackDepth); export default class ProfileService { private static async promisifiedRead(readable: any) { + // eslint-disable-next-line no-new new Promise((resolve, reject) => { // Instructions for reading data const chunks: any[] = []; @@ -81,11 +84,13 @@ export default class ProfileService { const shouldGenerateLocally = !credBucketDetails.sendTo; logger.info('Before Heapsnapshot converted into a readable stream'); let fileName = ''; - let format = 'pb.gz'; + // eslint-disable-next-line no-param-reassign + format = 'pb.gz'; let profile; if (format && format === 'v8') { const readable = v8.getHeapSnapshot(); snapshotReadableStream = await this.promisifiedRead(readable); + // eslint-disable-next-line no-param-reassign format = 'heapsnapshot'; } else { profile = heap.profile(); @@ -99,7 +104,7 @@ export default class ProfileService { logger.info('Before pipeline'); try { await writeFileProm(fileName, snapshotReadableStream); - } catch (error: any) { + } catch (error: CatchErr) { logger.error('Error occurred:', error); throw new Error(error); } @@ -123,7 +128,7 @@ export default class ProfileService { credBucketDetails.sendTo ? credBucketDetails.sendTo : 'locally' } with filename: ${fileName}`, }; - } catch (error: any) { + } catch (error: CatchErr) { logger.error(error); return { success: false, diff --git a/src/services/source/nativeIntegration.ts b/src/services/source/nativeIntegration.ts index e654940fec..f29d68d054 100644 --- a/src/services/source/nativeIntegration.ts +++ b/src/services/source/nativeIntegration.ts @@ -5,6 +5,7 @@ import { RudderMessage, SourceTransformationResponse, } from '../../types/index'; +import { FixMe } from '../../util/types'; import PostTransformationServiceSource from './postTransformation'; import FetchHandler from '../../helpers/fetchHandlers'; import tags from '../../v0/util/tags'; @@ -25,19 +26,20 @@ export default class NativeIntegrationSourceService implements IntegrationSource } public async sourceTransformRoutine( - sourceEvents: Object[], + sourceEvents: NonNullable[], sourceType: string, version: string, - _requestMetadata: Object, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _requestMetadata: NonNullable, ): Promise { const sourceHandler = FetchHandler.getSourceHandler(sourceType, version); - const respList: SourceTransformationResponse[] = await Promise.all( + const respList: SourceTransformationResponse[] = await Promise.all( sourceEvents.map(async (sourceEvent) => { try { const respEvents: RudderMessage | RudderMessage[] | SourceTransformationResponse = await sourceHandler.process(sourceEvent); return PostTransformationServiceSource.handleSuccessEventsSource(respEvents); - } catch (error: any) { + } catch (error: FixMe) { const metaTO = this.getTags(); stats.increment('source_transform_errors', { sourceType, diff --git a/src/services/source/postTransformation.ts b/src/services/source/postTransformation.ts index 603f1b1c0a..f732cac3a7 100644 --- a/src/services/source/postTransformation.ts +++ b/src/services/source/postTransformation.ts @@ -1,10 +1,11 @@ import { MetaTransferObject, RudderMessage, SourceTransformationResponse } from '../../types/index'; +import { CatchErr } from '../../util/types'; import { generateErrorObject } from '../../v0/util'; import ErrorReportingService from '../errorReporting'; export default class PostTransformationSourceService { public static handleFailureEventsSource( - error: Object, + error: CatchErr, metaTO: MetaTransferObject, ): SourceTransformationResponse { const errObj = generateErrorObject(error, metaTO.errorDetails); diff --git a/src/services/userTransform.ts b/src/services/userTransform.ts index 74d9203188..14c6d9b9aa 100644 --- a/src/services/userTransform.ts +++ b/src/services/userTransform.ts @@ -8,20 +8,24 @@ import { UserTransformationResponse, UserTransformationServiceResponse, } from '../types/index'; -import { RespStatusError, RetryRequestError, extractStackTraceUptoLastSubstringMatch } from '../util/utils'; +import { + RespStatusError, + RetryRequestError, + extractStackTraceUptoLastSubstringMatch, +} from '../util/utils'; import { getMetadata, isNonFuncObject } from '../v0/util'; import { SUPPORTED_FUNC_NAMES } from '../util/ivmFactory'; import logger from '../logger'; import stats from '../util/stats'; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import { CatchErr, FixMe } from '../util/types'; export default class UserTransformService { public static async transformRoutine( events: ProcessorTransformationRequest[], ): Promise { - - const startTime = new Date(); let retryStatus = 200; - const groupedEvents: Object = groupBy( + const groupedEvents: NonNullable = groupBy( events, (event: ProcessorTransformationRequest) => `${event.metadata.destinationId}_${event.metadata.sourceId}`, @@ -29,14 +33,14 @@ export default class UserTransformService { stats.counter('user_transform_function_group_size', Object.entries(groupedEvents).length, {}); stats.histogram('user_transform_input_events', events.length, {}); - const transformedEvents: any[] = []; - let librariesVersionIDs: any[] = []; + const transformedEvents: FixMe[] = []; + let librariesVersionIDs: FixMe[] = []; if (events[0].libraries) { librariesVersionIDs = events[0].libraries.map( (library: UserTransformationLibrary) => library.VersionID, ); } - const responses = await Promise.all( + const responses = await Promise.all( Object.entries(groupedEvents).map(async ([dest, destEvents]) => { logger.debug(`dest: ${dest}`); const eventsToProcess = destEvents as ProcessorTransformationRequest[]; @@ -83,7 +87,7 @@ export default class UserTransformService { statusCode: 400, error: ev.error, metadata: isEmpty(ev.metadata) ? commonMetadata : ev.metadata, - } as ProcessorTransformationResponse; + } as unknown as ProcessorTransformationResponse; } if (!isNonFuncObject(ev.transformedEvent)) { return { @@ -101,7 +105,7 @@ export default class UserTransformService { } as ProcessorTransformationResponse; }), ); - } catch (error: any) { + } catch (error: CatchErr) { logger.error(error); let status = 400; const errorString = error.toString(); @@ -150,7 +154,7 @@ export default class UserTransformService { } public static async testTransformRoutine(events, trRevCode, libraryVersionIDs) { - const response: any = {}; + const response: FixMe = {}; try { if (!trRevCode || !trRevCode.code || !trRevCode.codeVersion) { throw new Error('Invalid Request. Missing parameters in transformation code block'); @@ -160,6 +164,7 @@ export default class UserTransformService { } logger.debug(`[CT] Test Input Events: ${JSON.stringify(events)}`); + // eslint-disable-next-line no-param-reassign trRevCode.versionId = 'testVersionId'; response.body = await userTransformHandler()( events, @@ -170,9 +175,11 @@ export default class UserTransformService { ); logger.debug(`[CT] Test Output Events: ${JSON.stringify(response.body.transformedEvents)}`); response.status = 200; - } catch (error: any) { + } catch (error: CatchErr) { response.status = 400; - response.body = { error: extractStackTraceUptoLastSubstringMatch(error.stack, SUPPORTED_FUNC_NAMES) }; + response.body = { + error: extractStackTraceUptoLastSubstringMatch(error.stack, SUPPORTED_FUNC_NAMES), + }; } return response; } diff --git a/src/testRouter.js b/src/testRouter.js index 5c9d56e78d..6080816663 100644 --- a/src/testRouter.js +++ b/src/testRouter.js @@ -28,8 +28,8 @@ const isSupportedContentType = (contentType) => { const testRouter = new Router({ prefix: '/test-router' }); -const getDestHandler = (version, destination) => - require(`./${version}/destinations/${destination}/transform`); +const getDestHandler = (ver, destination) => + require(`./${ver}/destinations/${destination}/transform`); const getDestinations = () => fs.readdirSync(path.resolve(__dirname, version, 'destinations')); diff --git a/src/types/index.ts b/src/types/index.ts index 38ce52f017..ff0c1f88b9 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,3 +1,6 @@ +import { CatchErr, FixMe } from '../util/types'; + +/* eslint-disable @typescript-eslint/no-explicit-any */ type ProcessorTransformationOutput = { version: string; type: string; @@ -25,8 +28,8 @@ type Metadata = { sourceCategory: string; trackingPlanId: string; trackingPlanVersion: number; - sourceTpConfig: Object; - mergedTpConfig: Object; + sourceTpConfig: object; + mergedTpConfig: object; destinationId: string; jobRunId: string; jobId: number; @@ -35,7 +38,7 @@ type Metadata = { sourceJobRunId: string; sourceTaskId: string; sourceTaskRunId: string; - recordId: Object; + recordId: object; destinationType: string; messageId: string; oauthAccessToken: string; @@ -52,21 +55,21 @@ type Metadata = { type UserTransformationInput = { VersionID: string; ID: string; - Config: Object; + Config: object; }; type DestinationDefinition = { ID: string; Name: string; DisplayName: string; - Config: Object; + Config: FixMe; }; type Destination = { ID: string; Name: string; DestinationDefinition: DestinationDefinition; - Config: Object; + Config: FixMe; Enabled: boolean; WorkspaceID: string; Transformations: UserTransformationInput[]; @@ -78,16 +81,16 @@ type UserTransformationLibrary = { }; type ProcessorTransformationRequest = { - request?: Object; - message: Object; + request?: object; + message: object; metadata: Metadata; destination: Destination; libraries: UserTransformationLibrary[]; }; type RouterTransformationRequestData = { - request?: Object; - message: Object; + request?: object; + message: object; metadata: Metadata; destination: Destination; }; @@ -102,7 +105,7 @@ type ProcessorTransformationResponse = { metadata: Metadata; statusCode: number; error?: string; - statTags: Object; + statTags: object; }; type RouterTransformationResponse = { @@ -112,7 +115,7 @@ type RouterTransformationResponse = { batched: boolean; statusCode: number; error: string; - statTags: Object; + statTags: object; }; type SourceTransformationOutput = { @@ -121,17 +124,17 @@ type SourceTransformationOutput = { type SourceTransformationResponse = { output: SourceTransformationOutput; - error: Object; + error: CatchErr; statusCode: number; - outputToSource: Object; - statTags: Object; + outputToSource: object; + statTags: object; }; type DeliveryResponse = { status: number; message: string; - destinationResponse: Object; - statTags: Object; + destinationResponse: object; + statTags: object; authErrorCategory?: string; }; @@ -150,15 +153,15 @@ type RudderMessage = { anonymousId: string; type: MessageType; channel: string; - context: Object; + context: object; originalTimestamp: Date; sentAt: Date; timestamp: Date; event?: string; - integrations?: Object; + integrations?: object; messageId: string; - properties?: Object; - traits?: Object; + properties?: object; + traits?: object; }; type ErrorDetailer = { @@ -187,7 +190,7 @@ type MetaTransferObject = { type UserTransformationResponse = { transformedEvent: RudderMessage; metadata: Metadata; - error: Object; + error: CatchErr; }; type UserTransformationServiceResponse = { @@ -196,8 +199,8 @@ type UserTransformationServiceResponse = { }; type UserDeletionRequest = { - userAttributes: any[]; - config: Object; + userAttributes: FixMe[]; + config: object; destType: string; jobId: string; }; @@ -206,15 +209,15 @@ type UserDeletionResponse = { statusCode: number; error?: string; status?: string; - authErrorCategory: any; - statTags: Object; + authErrorCategory: FixMe; + statTags: object; }; type ComparatorInput = { events: ProcessorTransformationRequest[] | RouterTransformationRequestData[]; destination: string; version: string; - requestMetadata: Object; + requestMetadata: object; feature: string; }; diff --git a/src/util/dynamicConfigParser.ts b/src/util/dynamicConfigParser.ts index fc4a02bc84..73ad85a0d2 100644 --- a/src/util/dynamicConfigParser.ts +++ b/src/util/dynamicConfigParser.ts @@ -1,14 +1,15 @@ import cloneDeep from 'lodash/cloneDeep'; import { ProcessorTransformationRequest, RouterTransformationRequestData } from '../types/index'; +import { FixMe } from './types'; /* eslint-disable no-param-reassign */ const get = require('get-value'); const unset = require('unset-value'); -export class DynamicConfigParser { +export default class DynamicConfigParser { private static getDynamicConfigValue( event: ProcessorTransformationRequest | RouterTransformationRequestData, - value: any, + value: FixMe, ) { // this regex checks for pattern "only spaces {{ path || defaultvalue }} only spaces" . // " {{message.traits.key || \"email\" }} " @@ -38,7 +39,7 @@ export class DynamicConfigParser { } private static configureVal( - value: any, + value: FixMe, event: ProcessorTransformationRequest | RouterTransformationRequestData, ) { if (value) { diff --git a/src/util/fetch.js b/src/util/fetch.js index efadc3c884..95856dd7fd 100644 --- a/src/util/fetch.js +++ b/src/util/fetch.js @@ -1,6 +1,7 @@ +/* eslint-disable @typescript-eslint/return-await */ const fetch = require('node-fetch'); const HttpsProxyAgent = require('https-proxy-agent'); -const _ = require('lodash'); +const lodash = require('lodash'); const { RetryRequestError } = require('./utils'); const fetchWithProxy = async (url, options = {}) => { @@ -13,7 +14,7 @@ const fetchWithProxy = async (url, options = {}) => { instanceOptions.agent = new HttpsProxyAgent(process.env.HTTPS_PROXY); } - if (_.isEmpty(instanceOptions)) { + if (lodash.isEmpty(instanceOptions)) { return await fetch(url); } return await fetch(url, instanceOptions); diff --git a/src/util/types.ts b/src/util/types.ts new file mode 100644 index 0000000000..579c35579c --- /dev/null +++ b/src/util/types.ts @@ -0,0 +1,25 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +export type FixMe = any; + +export type CatchErr = any; + +export interface Config { + cdkEnabled?: boolean; + cdkV2Enabled?: boolean; + comparisonTestEnabeld?: boolean; + comparisonService?: string; + camparisonTestThreshold?: number; +} + +export interface IDestDefinition { + id: string; + name: string; + displayName: string; + config: Config; + options: { + isBeta?: boolean; + hidden?: boolean; + } | null; + isPopular: boolean; + uiConfig: FixMe; +} diff --git a/src/util/utils.js b/src/util/utils.js index 160bbae3c9..0ba6008368 100644 --- a/src/util/utils.js +++ b/src/util/utils.js @@ -1,4 +1,4 @@ -/* eslint-disable max-classes-per-file */ +/* eslint-disable max-classes-per-file, @typescript-eslint/return-await */ const http = require('http'); const https = require('https'); const { Resolver } = require('dns').promises; @@ -36,6 +36,7 @@ const staticLookup = (transformerVersionId) => async (hostname, _, cb) => { return; } + // eslint-disable-next-line no-restricted-syntax for (const ip of ips) { if (ip.startsWith(LOCALHOST_OCTET)) { cb(null, `cannot use ${ip} as IP address`, RECORD_TYPE_A); diff --git a/src/v0/destinations/active_campaign/transform.js b/src/v0/destinations/active_campaign/transform.js index f995254730..905a8e897f 100644 --- a/src/v0/destinations/active_campaign/transform.js +++ b/src/v0/destinations/active_campaign/transform.js @@ -283,7 +283,7 @@ const customFieldProcessor = async (message, category, destination) => { const storedFields = Object.keys(fieldMap); const filteredFieldKeys = []; - fieldKeys.map((fieldKey) => { + fieldKeys.forEach((fieldKey) => { // If the field is present in fieldMap push it to filteredFieldKeys else ignore if (storedFields.includes(fieldKey)) { filteredFieldKeys.push(fieldKey); @@ -297,7 +297,7 @@ const customFieldProcessor = async (message, category, destination) => { // Creating a field array list conating field id and field value which will be merged to the contact // Ref: https://developers.activecampaign.com/reference/sync-a-contacts-data const fieldsArrValues = []; - filteredFieldKeys.map((key) => { + filteredFieldKeys.forEach((key) => { let fPayload; if (Array.isArray(fieldInfo[key])) { fPayload = '||'; @@ -327,7 +327,7 @@ const customListProcessor = async (message, category, destination, contactId) => // The list info is pushed into a list object array const listArr = []; if (Array.isArray(listInfo)) { - listInfo.map((list) => { + listInfo.forEach((list) => { listArr.push(list); }); } else { @@ -337,7 +337,8 @@ const customListProcessor = async (message, category, destination, contactId) => // status information // Ref: https://developers.activecampaign.com/reference/update-list-status-for-contact/ const promises = []; - listArr.map(async (li) => { + // eslint-disable-next-line no-restricted-syntax + for (const li of listArr) { if (li.status === 'subscribe' || li.status === 'unsubscribe') { const endpoint = `${destination.Config.apiUrl}${category.mergeListWithContactUrl}`; const requestData = { @@ -356,7 +357,7 @@ const customListProcessor = async (message, category, destination, contactId) => }); promises.push(res); } - }); + } const responses = await Promise.all(promises); responses.forEach((respItem) => { if (respItem.success === false) { diff --git a/src/v0/destinations/adobe_analytics/transform.js b/src/v0/destinations/adobe_analytics/transform.js index c477b4c93c..54806bf578 100644 --- a/src/v0/destinations/adobe_analytics/transform.js +++ b/src/v0/destinations/adobe_analytics/transform.js @@ -36,7 +36,13 @@ const responseBuilderSimple = async (message, destinationConfig, basicPayload) = const { event, context, properties } = message; // set default value of properties.overridePageView to false if not provided properties.overridePageView = properties.overridePageView ?? false; - const { overrideEvars, overrideHiers, overrideLists, overrideCustomProperties } = properties; + const { + overrideEvars, + overrideHiers, + overrideLists, + overrideCustomProperties, + overridePageView, + } = properties; // handle contextData payload = handleContextData(payload, destinationConfig, message); @@ -60,7 +66,7 @@ const responseBuilderSimple = async (message, destinationConfig, basicPayload) = // handle link values // default linktype to 'o', linkName to event name, linkURL to ctx.page.url if not passed in integrations object const adobeIntegrationsObject = getIntegrationsObj(message, 'adobe_analytics'); - if (!properties?.overridePageView) { + if (!overridePageView) { payload.linkType = adobeIntegrationsObject?.linkType || 'o'; payload.linkName = adobeIntegrationsObject?.linkName || event; // setting linkname to page view for page calls @@ -86,7 +92,7 @@ const responseBuilderSimple = async (message, destinationConfig, basicPayload) = // handle pageName, pageUrl const contextPageUrl = context?.page?.url; - if (properties?.overridePageView) { + if (overridePageView) { const propertiesPageUrl = properties?.pageUrl; const pageUrl = contextPageUrl || propertiesPageUrl; if (isDefinedAndNotNullAndNotEmpty(pageUrl)) { @@ -337,7 +343,7 @@ const processTrackEvent = (message, adobeEventName, destinationConfig, extras = const handleTrack = (message, destinationConfig) => { const ORDER_ID_KEY = 'properties.order_id'; - const { event: rawEvent } = message; + const { event: rawEvent, properties } = message; let payload = null; // handle ecommerce events separately // generic events should go to the default @@ -378,12 +384,8 @@ const handleTrack = (message, destinationConfig) => { destinationConfig.rudderEventsToAdobeEvents[event]?.trim(), destinationConfig, ); - } else if (message?.properties?.overrideEventName) { - payload = processTrackEvent( - message, - message?.properties?.overrideEventName, - destinationConfig, - ); + } else if (properties?.overrideEventName) { + payload = processTrackEvent(message, properties.overrideEventName, destinationConfig); } else { throw new ConfigurationError( 'The event is not a supported ECOM event or a mapped custom event. Aborting.', diff --git a/src/v0/destinations/bqstream/transform.js b/src/v0/destinations/bqstream/transform.js index 0674f5e679..55679b08a8 100644 --- a/src/v0/destinations/bqstream/transform.js +++ b/src/v0/destinations/bqstream/transform.js @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -const _ = require('lodash'); +const lodash = require('lodash'); const { EventType } = require('../../../constants'); const { defaultBatchRequestConfig, @@ -56,7 +56,7 @@ const batchEachUserSuccessEvents = (eventsChunk) => { const batchedResponseList = []; // arrayChunks = [[e1,e2, ..batchSize], [e1,e2, ..batchSize], ...] - const arrayChunks = _.chunk(eventsChunk, MAX_ROWS_PER_REQUEST); + const arrayChunks = lodash.chunk(eventsChunk, MAX_ROWS_PER_REQUEST); // list of chunks [ [..], [..] ] arrayChunks.forEach((chunk) => { diff --git a/src/v0/destinations/bqstream/util.js b/src/v0/destinations/bqstream/util.js index 06b7403c87..4fa926e54e 100644 --- a/src/v0/destinations/bqstream/util.js +++ b/src/v0/destinations/bqstream/util.js @@ -39,6 +39,7 @@ const formatCompositeResponse = (errorEvents) => { const resultArray = []; const errorMap = new Map(); + // eslint-disable-next-line no-restricted-syntax for (const item of errorEvents) { if (isDefinedAndNotNull(item.error)) { optimizeErrorResponse(item, errorMap, resultArray); diff --git a/src/v0/destinations/bqstream/util.test.js b/src/v0/destinations/bqstream/util.test.js index 1e99a4f20e..c7635772ac 100644 --- a/src/v0/destinations/bqstream/util.test.js +++ b/src/v0/destinations/bqstream/util.test.js @@ -64,19 +64,19 @@ describe('getRearrangedEvents', () => { ], }, ], - [ - { - batched: false, - destination: {}, - error: "Invalid payload for the destination", - metadata: [ - { - jobId: 5, - userId: "user12345", - }, - ], - }, - ], + [ + { + batched: false, + destination: {}, + error: 'Invalid payload for the destination', + metadata: [ + { + jobId: 5, + userId: 'user12345', + }, + ], + }, + ], ]; const result = getRearrangedEvents(eachUserSuccessEventslist, eachUserErrorEventsList); expect(result).toEqual(expected); @@ -106,7 +106,7 @@ describe('getRearrangedEvents', () => { [ { message: { type: 'track' }, metadata: [{ jobId: 1 }] }, { message: { type: 'track' }, metadata: [{ jobId: 3 }] }, - { message: { type: 'track' }, metadata: [{ jobId: 5 }] } + { message: { type: 'track' }, metadata: [{ jobId: 5 }] }, ], [ { @@ -147,54 +147,54 @@ describe('getRearrangedEvents', () => { const expected = [ [ { - "message": { - "type": "track" + message: { + type: 'track', }, - "metadata": [ + metadata: [ { - "jobId": 1 - } - ] + jobId: 1, + }, + ], }, { - "message": { - "type": "track" + message: { + type: 'track', }, - "metadata": [ + metadata: [ { - "jobId": 2 - } - ] + jobId: 2, + }, + ], }, { - "message": { - "type": "track" + message: { + type: 'track', }, - "metadata": [ + metadata: [ { - "jobId": 5 - } - ] - } + jobId: 5, + }, + ], + }, ], [ { - "batched": false, - "destination": {}, - "error": "Invalid payload for the destination", - "metadata": [ + batched: false, + destination: {}, + error: 'Invalid payload for the destination', + metadata: [ { - "jobId": 3, - "userId": "user12345" + jobId: 3, + userId: 'user12345', }, { - "jobId": 4, - "userId": "user12345" - } - ] - } - ] - ] + jobId: 4, + userId: 'user12345', + }, + ], + }, + ], + ]; const result = getRearrangedEvents(successEventslist, errorEventsList); console.log(JSON.stringify(result)); expect(result).toEqual(expected); @@ -222,48 +222,46 @@ describe('getRearrangedEvents', () => { const expected = [ [ { - "message": { - "type": "track" + message: { + type: 'track', }, - "metadata": [ + metadata: [ { - "jobId": 2 - } - ] + jobId: 2, + }, + ], }, { - "message": { - "type": "track" + message: { + type: 'track', }, - "metadata": [ + metadata: [ { - "jobId": 3 - } - ] - } + jobId: 3, + }, + ], + }, ], [ { - "batched": false, - "destination": {}, - "error": "Invalid payload for the destination", - "metadata": [ + batched: false, + destination: {}, + error: 'Invalid payload for the destination', + metadata: [ { - "jobId": 1, - "userId": "user12345" + jobId: 1, + userId: 'user12345', }, { - "jobId": 4, - "userId": "user12345" - } - ] - } - ] - ] + jobId: 4, + userId: 'user12345', + }, + ], + }, + ], + ]; const result = getRearrangedEvents(successEventslist, errorEventsList); console.log(JSON.stringify(result)); expect(result).toEqual(expected); }); - }); - diff --git a/src/v0/destinations/branch/transform.js b/src/v0/destinations/branch/transform.js index 362f6cc840..0d47fbd791 100644 --- a/src/v0/destinations/branch/transform.js +++ b/src/v0/destinations/branch/transform.js @@ -44,7 +44,7 @@ function getCategoryAndName(rudderEventName) { for (const category of categoriesList) { let requiredName = null; let requiredCategory = null; - // eslint-disable-next-line array-callback-return + // eslint-disable-next-line array-callback-return, sonarjs/no-ignored-return Object.keys(category.name).find((branchKey) => { if ( typeof branchKey === 'string' && @@ -53,7 +53,9 @@ function getCategoryAndName(rudderEventName) { ) { requiredName = category.name[branchKey]; requiredCategory = category; + return true; } + return false; }); if (requiredName != null && requiredCategory != null) { return { evName: requiredName, category: requiredCategory }; @@ -112,6 +114,7 @@ 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) => { if (branchMappingProperty === rudderProperty) { const tmpKeyName = category.content_items[branchMappingProperty]; @@ -168,7 +171,7 @@ function getCommonPayload(message, category, evName) { productObj = {}; for (let i = 0; i < rudderPropertiesObj.products.length; i += 1) { const product = rudderPropertiesObj.products[i]; - // eslint-disable-next-line no-loop-func + // eslint-disable-next-line @typescript-eslint/no-loop-func Object.keys(product).forEach((productProp) => { const { contentItemsObj, eventDataObj, customDataObj } = mapPayload( category, diff --git a/src/v0/destinations/braze/networkHandler.js b/src/v0/destinations/braze/networkHandler.js index 48034af487..cf6d36c2b4 100644 --- a/src/v0/destinations/braze/networkHandler.js +++ b/src/v0/destinations/braze/networkHandler.js @@ -10,6 +10,7 @@ const { NetworkError } = require('../../util/errorTypes'); const tags = require('../../util/tags'); const stats = require('../../../util/stats'); +// eslint-disable-next-line @typescript-eslint/no-unused-vars const responseHandler = (destinationResponse, _dest) => { const message = `Request for ${DESTINATION} Processed Successfully`; const { response, status } = destinationResponse; diff --git a/src/v0/destinations/braze/transform.js b/src/v0/destinations/braze/transform.js index 7650f03b8f..5f651041ea 100644 --- a/src/v0/destinations/braze/transform.js +++ b/src/v0/destinations/braze/transform.js @@ -1,5 +1,5 @@ /* eslint-disable no-nested-ternary,no-param-reassign */ -const _ = require('lodash'); +const lodash = require('lodash'); const get = require('get-value'); const { BrazeDedupUtility, @@ -80,7 +80,7 @@ function getIdentifyPayload(message) { let payload = {}; payload = setAliasObjectWithAnonId(payload, message); payload = setExternalId(payload, message); - return { aliases_to_identify: [payload], merge_behavior: "merge" }; + return { aliases_to_identify: [payload], merge_behavior: 'merge' }; } function populateCustomAttributesWithOperation( @@ -379,6 +379,7 @@ function processGroup(message, destination) { } else if (email) { subscriptionGroup.emails = [email]; } + // eslint-disable-next-line @typescript-eslint/naming-convention const subscription_groups = [subscriptionGroup]; const response = defaultRequestConfig(); response.endpoint = getSubscriptionGroupEndPoint(getEndpointFromConfig(destination)); @@ -518,7 +519,7 @@ const processRouterDest = async (inputs, reqMetadata) => { BrazeDedupUtility.updateUserStore(userStore, lookedUpUsers, destination.ID); } // group events by userId or anonymousId and then call process - const groupedInputs = _.groupBy( + const groupedInputs = lodash.groupBy( inputs, (input) => input.message.userId || input.message.anonymousId, ); @@ -537,7 +538,7 @@ const processRouterDest = async (inputs, reqMetadata) => { const output = await Promise.all(allResps); - const allTransfomredEvents = _.flatMap(output); + const allTransfomredEvents = lodash.flatMap(output); return processBatch(allTransfomredEvents); }; diff --git a/src/v0/destinations/braze/util.js b/src/v0/destinations/braze/util.js index d772503b58..0793ca5891 100644 --- a/src/v0/destinations/braze/util.js +++ b/src/v0/destinations/braze/util.js @@ -1,4 +1,4 @@ -/* eslint-disable camelcase */ +/* eslint-disable */ const _ = require('lodash'); const get = require('get-value'); const stats = require('../../../util/stats'); diff --git a/src/v0/destinations/clevertap/networkHandler.js b/src/v0/destinations/clevertap/networkHandler.js index aafe77e792..35c972e502 100644 --- a/src/v0/destinations/clevertap/networkHandler.js +++ b/src/v0/destinations/clevertap/networkHandler.js @@ -43,6 +43,7 @@ const responseHandler = (destinationResponse) => { }; }; +// eslint-disable-next-line @typescript-eslint/naming-convention class networkHandler { constructor() { this.responseHandler = responseHandler; diff --git a/src/v0/destinations/criteo_audience/networkHandler.js b/src/v0/destinations/criteo_audience/networkHandler.js index 5bf29f63c5..83cde5028f 100644 --- a/src/v0/destinations/criteo_audience/networkHandler.js +++ b/src/v0/destinations/criteo_audience/networkHandler.js @@ -81,6 +81,7 @@ const responseHandler = (destinationResponse) => { }; }; +// eslint-disable-next-line @typescript-eslint/naming-convention class networkHandler { constructor() { this.responseHandler = responseHandler; diff --git a/src/v0/destinations/criteo_audience/util.js b/src/v0/destinations/criteo_audience/util.js index ab58560fb1..a7541f7911 100644 --- a/src/v0/destinations/criteo_audience/util.js +++ b/src/v0/destinations/criteo_audience/util.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const { isDefinedAndNotNullAndNotEmpty } = require('../../util'); const { ConfigurationError, InstrumentationError } = require('../../util/errorTypes'); const { MAX_IDENTIFIERS } = require('./config'); @@ -14,7 +14,7 @@ const populateIdentifiers = (audienceList, audienceType) => { } identifiers.push(userTraits[audienceType]); }); - const identifierChunks = _.chunk(identifiers, MAX_IDENTIFIERS); + const identifierChunks = lodash.chunk(identifiers, MAX_IDENTIFIERS); return identifierChunks; }; diff --git a/src/v0/destinations/customerio/util.js b/src/v0/destinations/customerio/util.js index dec16b355e..735b6a73d9 100644 --- a/src/v0/destinations/customerio/util.js +++ b/src/v0/destinations/customerio/util.js @@ -102,7 +102,7 @@ const isdeviceRelatedEventName = (eventName, destination) => const identifyResponseBuilder = (userId, message) => { const rawPayload = {}; // if userId is not there simply drop the payload - const id = userId || getFieldValueFromMessage(message, "email"); + const id = userId || getFieldValueFromMessage(message, 'email'); if (!id) { throw new InstrumentationError('userId or email is not present'); } @@ -177,6 +177,7 @@ const aliasResponseBuilder = (message, userId) => { if (validateEmail(userId)) { cioProperty = 'email'; } + // eslint-disable-next-line @typescript-eslint/naming-convention let prev_cioProperty = 'id'; if (validateEmail(message.previousId)) { prev_cioProperty = 'email'; @@ -229,12 +230,11 @@ const defaultResponseBuilder = (message, evName, userId, evType, destination, me let requestConfig = defaultPostRequestConfig; // any other event type except identify const token = get(message, 'context.device.token'); - const id = userId || getFieldValueFromMessage(message, "email"); + const id = userId || getFieldValueFromMessage(message, 'email'); // use this if only top level keys are to be sent // DEVICE DELETE from CustomerIO const isDeviceDeleteEvent = deviceDeleteRelatedEventName === evName; if (isDeviceDeleteEvent) { - if (!id || !token) { throw new InstrumentationError('userId/email or device_token not present'); } @@ -253,7 +253,7 @@ const defaultResponseBuilder = (message, evName, userId, evType, destination, me last_used: Math.floor(new Date(timestamp).getTime() / 1000), }; const deviceType = get(message, 'context.device.type'); - if (deviceType && typeof deviceType === "string") { + if (deviceType && typeof deviceType === 'string') { // Ref - https://www.customer.io/docs/api/#operation/add_device // supported platform are "ios", "android" devProps.platform = isAppleFamily(deviceType) ? 'ios' : deviceType.toLowerCase(); @@ -306,9 +306,9 @@ const defaultResponseBuilder = (message, evName, userId, evType, destination, me return { rawPayload, endpoint, requestConfig }; }; -const validateConfigFields = destination => { +const validateConfigFields = (destination) => { const { Config } = destination; - configFieldsToCheck.forEach(configProperty => { + configFieldsToCheck.forEach((configProperty) => { if (!Config[configProperty]) { throw new ConfigurationError(`${configProperty} not found in Configs`); } @@ -323,5 +323,5 @@ module.exports = { defaultResponseBuilder, populateSpecedTraits, isdeviceRelatedEventName, - validateConfigFields + validateConfigFields, }; diff --git a/src/v0/destinations/fb/networkHandler.js b/src/v0/destinations/fb/networkHandler.js index b79b2ab493..06235fab40 100644 --- a/src/v0/destinations/fb/networkHandler.js +++ b/src/v0/destinations/fb/networkHandler.js @@ -11,6 +11,7 @@ const destResponseHandler = (destinationResponse) => { }; }; +// eslint-disable-next-line @typescript-eslint/naming-convention class networkHandler { constructor() { this.prepareProxyRequest = prepareProxyRequest; diff --git a/src/v0/destinations/fb_custom_audience/transform.js b/src/v0/destinations/fb_custom_audience/transform.js index 64125ffc3b..f31a3dd42e 100644 --- a/src/v0/destinations/fb_custom_audience/transform.js +++ b/src/v0/destinations/fb_custom_audience/transform.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const get = require('get-value'); const { defaultRequestConfig, @@ -62,7 +62,7 @@ const preparePayload = ( disableFormat, destinationId, ) => { - const prepareFinalPayload = _.cloneDeep(paramsPayload); + const prepareFinalPayload = lodash.cloneDeep(paramsPayload); if (Array.isArray(userSchema)) { prepareFinalPayload.schema = userSchema; } else { diff --git a/src/v0/destinations/fb_custom_audience/util.js b/src/v0/destinations/fb_custom_audience/util.js index 8ec15fe670..9e7198e393 100644 --- a/src/v0/destinations/fb_custom_audience/util.js +++ b/src/v0/destinations/fb_custom_audience/util.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const sha256 = require('sha256'); const get = require('get-value'); const jsonSize = require('json-size'); @@ -31,7 +31,7 @@ const batchingWithPayloadSize = (payload) => { const revisedPayloadArray = []; const noOfBatches = Math.ceil(payloadSize / maxPayloadSize); const revisedRecordsPerPayload = Math.floor(payload.data.length / noOfBatches); - const revisedDataArray = _.chunk(payload.data, revisedRecordsPerPayload); + const revisedDataArray = lodash.chunk(payload.data, revisedRecordsPerPayload); revisedDataArray.forEach((data) => { revisedPayloadArray.push({ ...payload, data }); }); diff --git a/src/v0/destinations/ga/transform.js b/src/v0/destinations/ga/transform.js index 0c2a0f8a49..c10697c4e1 100644 --- a/src/v0/destinations/ga/transform.js +++ b/src/v0/destinations/ga/transform.js @@ -443,7 +443,7 @@ function processRefundEvent(message, destination) { let { enhancedEcommerce } = destination.Config; enhancedEcommerce = enhancedEcommerce || false; - // eslint-disable-next-line camelcase + // eslint-disable-next-line @typescript-eslint/naming-convention const { products, order_id } = message.properties; if (products && products.length > 0) { const productParams = setProductLevelProperties( @@ -598,7 +598,7 @@ function processProductEvent(message, destination) { const customParamKeys = getCustomParamKeys(destination.Config); Object.assign(parameters, getProductLevelCustomParams(message.properties, 1, customParamKeys)); } - // eslint-disable-next-line camelcase + // eslint-disable-next-line @typescript-eslint/naming-convention const { sku, product_id } = message.properties; // eslint-disable-next-line camelcase const productId = product_id; diff --git a/src/v0/destinations/ga360/transform.js b/src/v0/destinations/ga360/transform.js index a9d4f6b210..c60ea47551 100644 --- a/src/v0/destinations/ga360/transform.js +++ b/src/v0/destinations/ga360/transform.js @@ -401,7 +401,7 @@ function processRefundEvent(message, destination) { let { enhancedEcommerce } = destination.Config; enhancedEcommerce = enhancedEcommerce || false; - // eslint-disable-next-line camelcase + // eslint-disable-next-line @typescript-eslint/naming-convention const { products, order_id } = message.properties; if (products && products.length > 0) { const productParams = setProductLevelProperties( @@ -545,7 +545,7 @@ function processProductEvent(message, destination) { const customParamKeys = getCustomParamKeys(destination.Config); Object.assign(parameters, getProductLevelCustomParams(message.properties, 1, customParamKeys)); } - // eslint-disable-next-line camelcase + // eslint-disable-next-line @typescript-eslint/naming-convention const { sku, product_id } = message.properties; // eslint-disable-next-line camelcase const productId = product_id; diff --git a/src/v0/destinations/ga4/utils.js b/src/v0/destinations/ga4/utils.js index b86d14ef1b..4bb35e3fdd 100644 --- a/src/v0/destinations/ga4/utils.js +++ b/src/v0/destinations/ga4/utils.js @@ -410,9 +410,9 @@ const prepareUserProperties = (message) => { const validatedUserProperties = Object.entries(userProperties) .filter(([key, value]) => isValidUserProperty(key, value)) .reduce((acc, [key, value]) => { - const userProperties = acc; - userProperties[key] = { value }; - return userProperties; + const userPropertiesObj = acc; + userPropertiesObj[key] = { value }; + return userPropertiesObj; }, {}); return validatedUserProperties; diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js b/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js index 9fa0e9a3a4..1f59eb9e40 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js @@ -18,6 +18,8 @@ const { BASE_ENDPOINT } = require('./config'); const { NetworkError, NetworkInstrumentationError } = require('../../util/errorTypes'); const tags = require('../../util/tags'); +const ERROR_MSG_PATH = 'response[0].error.message'; + /** * This function is used for collecting the conversionActionId using the conversion name * @param {*} method @@ -49,8 +51,8 @@ const getConversionActionId = async (method, headers, params) => { if (!isHttpStatusSuccess(gaecConversionActionIdResponse.status)) { throw new NetworkError( `"${JSON.stringify( - get(gaecConversionActionIdResponse, 'response[0].error.message', '') - ? get(gaecConversionActionIdResponse, 'response[0].error.message', '') + get(gaecConversionActionIdResponse, ERROR_MSG_PATH, '') + ? get(gaecConversionActionIdResponse, ERROR_MSG_PATH, '') : gaecConversionActionIdResponse.response, )} during Google_adwords_enhanced_conversions response transformation"`, gaecConversionActionIdResponse.status, @@ -60,7 +62,7 @@ const getConversionActionId = async (method, headers, params) => { gaecConversionActionIdResponse.response, getAuthErrCategoryFromErrDetailsAndStCode( get(gaecConversionActionIdResponse, 'status'), - get(gaecConversionActionIdResponse, 'response[0].error.message'), + get(gaecConversionActionIdResponse, ERROR_MSG_PATH), ), ); } @@ -144,6 +146,7 @@ const responseHandler = (destinationResponse) => { ); }; +// eslint-disable-next-line func-names, @typescript-eslint/naming-convention class networkHandler { constructor() { this.proxy = ProxyRequest; diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/transform.js b/src/v0/destinations/google_adwords_enhanced_conversions/transform.js index 24993a3006..898c3f95b0 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/transform.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/transform.js @@ -11,10 +11,7 @@ const { getAccessToken, } = require('../../util'); -const { - InstrumentationError, - ConfigurationError, -} = require('../../util/errorTypes'); +const { InstrumentationError, ConfigurationError } = require('../../util/errorTypes'); const { trackMapping, BASE_ENDPOINT } = require('./config'); const { JSON_MIME_TYPE } = require('../../util/constant'); diff --git a/src/v0/destinations/google_adwords_offline_conversions/transform.js b/src/v0/destinations/google_adwords_offline_conversions/transform.js index db87d2488e..93b4592c33 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/transform.js +++ b/src/v0/destinations/google_adwords_offline_conversions/transform.js @@ -139,6 +139,7 @@ const process = async (event) => { const getEventChunks = (event, storeSalesEvents, clickCallEvents) => { const { message, metadata, destination } = event; + // eslint-disable-next-line @typescript-eslint/no-shadow message.forEach((message) => { if (message.body.JSON?.isStoreConversion) { storeSalesEvents.push({ message, metadata, destination }); @@ -166,7 +167,7 @@ const batchEvents = (storeSalesEvents) => { if (index === 0) { return; } - batchEventResponse.batchedRequest?.body?.JSON['addConversionPayload']?.operations?.push( + batchEventResponse.batchedRequest?.body?.JSON.addConversionPayload?.operations?.push( storeSalesEvent.message?.body?.JSON?.addConversionPayload?.operations, ); batchEventResponse.metadatas.push(storeSalesEvent.metadata); diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.js b/src/v0/destinations/google_adwords_offline_conversions/utils.js index 37f17c9fd0..6bdedcc0d4 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.js @@ -25,11 +25,7 @@ const { } = require('./config'); const { processAxiosResponse } = require('../../../adapters/utils/networkUtils'); const Cache = require('../../util/cache'); -const { - AbortedError, - ConfigurationError, - InstrumentationError, -} = require('../../util/errorTypes'); +const { AbortedError, ConfigurationError, InstrumentationError } = require('../../util/errorTypes'); const conversionActionIdCache = new Cache(CONVERSION_ACTION_ID_CACHE_TTL); diff --git a/src/v0/destinations/google_cloud_function/transform.js b/src/v0/destinations/google_cloud_function/transform.js index e74d539e3f..b218615b44 100644 --- a/src/v0/destinations/google_cloud_function/transform.js +++ b/src/v0/destinations/google_cloud_function/transform.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const { getSuccessRespEvents, checkInvalidRtTfEvents, @@ -22,7 +22,7 @@ function batchEvents(successRespList, maxBatchSize = 10) { const batchedResponseList = []; // arrayChunks = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] - const arrayChunks = _.chunk(successRespList, maxBatchSize); + const arrayChunks = lodash.chunk(successRespList, maxBatchSize); arrayChunks.forEach((chunk) => { const batchEventResponse = generateBatchedPayload(chunk); batchedResponseList.push( diff --git a/src/v0/destinations/hs/HSTransform-v1.js b/src/v0/destinations/hs/HSTransform-v1.js index 13eeabbc45..387ecbf63f 100644 --- a/src/v0/destinations/hs/HSTransform-v1.js +++ b/src/v0/destinations/hs/HSTransform-v1.js @@ -1,5 +1,5 @@ const get = require('get-value'); -const _ = require('lodash'); +const lodash = require('lodash'); const { MappedToDestinationKey, GENERIC_TRUE_VALUES } = require('../../../constants'); const { defaultGetRequestConfig, @@ -286,9 +286,9 @@ const legacyBatchEvents = (destEvents) => { eventsChunk.push(event); } }); - const arrayChunksIdentifyCreateObjects = _.chunk(createAllObjectsEventChunk, maxBatchSize); + const arrayChunksIdentifyCreateObjects = lodash.chunk(createAllObjectsEventChunk, maxBatchSize); - const arrayChunksIdentifyUpdateObjects = _.chunk(updateAllObjectsEventChunk, maxBatchSize); + const arrayChunksIdentifyUpdateObjects = lodash.chunk(updateAllObjectsEventChunk, maxBatchSize); // batching up 'create' all objects endpoint chunks if (arrayChunksIdentifyCreateObjects.length > 0) { batchedResponseList = batchIdentifyForrETL( @@ -308,7 +308,7 @@ const legacyBatchEvents = (destEvents) => { } // eventChunks = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] - const arrayChunksIdentify = _.chunk(eventsChunk, MAX_BATCH_SIZE); + const arrayChunksIdentify = lodash.chunk(eventsChunk, MAX_BATCH_SIZE); // list of chunks [ [..], [..] ] arrayChunksIdentify.forEach((chunk) => { diff --git a/src/v0/destinations/hs/HSTransform-v2.js b/src/v0/destinations/hs/HSTransform-v2.js index 8cea4611e5..75696b4e96 100644 --- a/src/v0/destinations/hs/HSTransform-v2.js +++ b/src/v0/destinations/hs/HSTransform-v2.js @@ -1,5 +1,5 @@ const get = require('get-value'); -const _ = require('lodash'); +const lodash = require('lodash'); const { MappedToDestinationKey, GENERIC_TRUE_VALUES } = require('../../../constants'); const { defaultPostRequestConfig, @@ -417,23 +417,23 @@ const batchEvents = (destEvents) => { } }); - const arrayChunksIdentifyCreateObjects = _.chunk(createAllObjectsEventChunk, maxBatchSize); + const arrayChunksIdentifyCreateObjects = lodash.chunk(createAllObjectsEventChunk, maxBatchSize); - const arrayChunksIdentifyUpdateObjects = _.chunk(updateAllObjectsEventChunk, maxBatchSize); + const arrayChunksIdentifyUpdateObjects = lodash.chunk(updateAllObjectsEventChunk, maxBatchSize); // eventChunks = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] // CRM create contact endpoint chunks - const arrayChunksIdentifyCreateContact = _.chunk( + const arrayChunksIdentifyCreateContact = lodash.chunk( createContactEventsChunk, MAX_BATCH_SIZE_CRM_CONTACT, ); // CRM update contact endpoint chunks - const arrayChunksIdentifyUpdateContact = _.chunk( + const arrayChunksIdentifyUpdateContact = lodash.chunk( updateContactEventsChunk, MAX_BATCH_SIZE_CRM_CONTACT, ); - const arrayChunksIdentifyCreateAssociations = _.chunk( + const arrayChunksIdentifyCreateAssociations = lodash.chunk( associationObjectsEventChunk, MAX_BATCH_SIZE_CRM_OBJECT, ); diff --git a/src/v0/destinations/intercom/networkHandler.js b/src/v0/destinations/intercom/networkHandler.js index 4133fbe4dc..33f78e8cf6 100644 --- a/src/v0/destinations/intercom/networkHandler.js +++ b/src/v0/destinations/intercom/networkHandler.js @@ -23,6 +23,7 @@ const destResponseHandler = (destinationResponse, dest) => { }; }; +// eslint-disable-next-line @typescript-eslint/naming-convention class networkHandler { constructor() { this.responseHandler = destResponseHandler; diff --git a/src/v0/destinations/intercom/transform.js b/src/v0/destinations/intercom/transform.js index aa088ee5db..552c80527c 100644 --- a/src/v0/destinations/intercom/transform.js +++ b/src/v0/destinations/intercom/transform.js @@ -94,16 +94,17 @@ function validateTrack(payload) { } const checkIfEmailOrUserIdPresent = (message, Config) => { - let user_id = message.userId; - if (Config.sendAnonymousId && !user_id) { - user_id = message.anonymousId; + const { context, anonymousId } = message; + let { userId } = message; + if (Config.sendAnonymousId && !userId) { + userId = anonymousId; } - return !!(user_id || message.context?.traits?.email); + return !!(userId || context.traits?.email); }; function attachUserAndCompany(message, Config) { const email = message.context?.traits?.email; - const { userId, anonymousId } = message; + const { userId, anonymousId, traits, groupId } = message; const requestBody = {}; if (userId) { requestBody.user_id = userId; @@ -115,10 +116,10 @@ function attachUserAndCompany(message, Config) { requestBody.email = email; } const companyObj = { - company_id: message.groupId, + company_id: groupId, }; - if (message.traits?.name) { - companyObj.name = message.traits.name; + if (traits?.name) { + companyObj.name = traits.name; } requestBody.companies = [companyObj]; const response = defaultRequestConfig(); diff --git a/src/v0/destinations/iterable/transform.js b/src/v0/destinations/iterable/transform.js index af666044d3..c54b579a52 100644 --- a/src/v0/destinations/iterable/transform.js +++ b/src/v0/destinations/iterable/transform.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const get = require('get-value'); const { getCatalogEndpoint, @@ -213,10 +213,10 @@ const processRouterDest = async (inputs, reqMetadata) => { * ] */ - const responses = process(event); - const transformedPayloads = Array.isArray(responses) ? responses : [responses]; - return transformedPayloads.map((response) => ({ - message: response, + const responsesFn = process(event); + const transformedPayloadsArr = Array.isArray(responsesFn) ? responsesFn : [responsesFn]; + return transformedPayloadsArr.map((res) => ({ + message: res, metadata: event.metadata, destination: event.destination, })); @@ -230,13 +230,13 @@ const processRouterDest = async (inputs, reqMetadata) => { * Before flat map : transformedPayloads = [{e1}, {e2}, [{e3}, {e4}, {e5}], {e6}] * After flat map : transformedPayloads = [{e1}, {e2}, {e3}, {e4}, {e5}, {e6}] */ - transformedPayloads = _.flatMap(transformedPayloads); + transformedPayloads = lodash.flatMap(transformedPayloads); return filterEventsAndPrepareBatchRequests(transformedPayloads); }), ); // Flatten the response array containing batched events from multiple groups - const allBatchedEvents = _.flatMap(response); + const allBatchedEvents = lodash.flatMap(response); return allBatchedEvents; }; diff --git a/src/v0/destinations/iterable/util.js b/src/v0/destinations/iterable/util.js index 3fe793d561..0b7e402f01 100644 --- a/src/v0/destinations/iterable/util.js +++ b/src/v0/destinations/iterable/util.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const get = require('get-value'); const jsonSize = require('json-size'); const { @@ -22,6 +22,8 @@ const { JSON_MIME_TYPE } = require('../../util/constant'); const { EventType, MappedToDestinationKey } = require('../../../constants'); const { InstrumentationError, ConfigurationError } = require('../../util/errorTypes'); +const MESSAGE_JSON_PATH = 'message.body.JSON'; + /** * Returns preferUserId param * @param {*} config @@ -168,7 +170,8 @@ const pageOrScreenEventPayloadBuilder = (message, destination, category) => { let rawPayload = {}; const eventType = message.type.toLowerCase(); - const { trackAllPages, trackCategorisedPages, trackNamedPages } = destination.Config; + const { trackAllPages, trackCategorisedPages, trackNamedPages, mapToSingleEvent } = + destination.Config; if (trackAllPages) { rawPayload = constructPayload(message, mappingConfig[category.name]); } else if (trackCategorisedPages && (message.properties?.category || message.category)) { @@ -185,7 +188,7 @@ const pageOrScreenEventPayloadBuilder = (message, destination, category) => { rawPayload.campaignId = rawPayload.campaignId ? parseInt(rawPayload.campaignId, 10) : undefined; rawPayload.templateId = rawPayload.templateId ? parseInt(rawPayload.templateId, 10) : undefined; rawPayload.eventName = - destination.Config.mapToSingleEvent === true + mapToSingleEvent === true ? `Loaded a ${eventType.charAt(0).toUpperCase()}${eventType.slice(1)}` : `${rawPayload.eventName} ${eventType}`; @@ -368,7 +371,7 @@ const prepareAndSplitUpdateUserBatchesBasedOnPayloadSize = ( let nonBatchedRequests = []; chunk.forEach((event) => { - size += jsonSize(get(event, 'message.body.JSON')); + size += jsonSize(get(event, `${MESSAGE_JSON_PATH}`)); if (size > IDENTIFY_MAX_BODY_SIZE_IN_BYTES) { batches.push({ users: usersChunk, @@ -380,7 +383,7 @@ const prepareAndSplitUpdateUserBatchesBasedOnPayloadSize = ( usersChunk = []; metadataChunk = []; nonBatchedRequests = []; - size = jsonSize(get(event, 'message.body.JSON')); + size = jsonSize(get(event, `${MESSAGE_JSON_PATH}`)); } if (registerDeviceOrBrowserTokenEvents[event.metadata.jobId]) { @@ -389,7 +392,7 @@ const prepareAndSplitUpdateUserBatchesBasedOnPayloadSize = ( } metadataChunk.push(event.metadata); - usersChunk.push(get(event, 'message.body.JSON')); + usersChunk.push(get(event, `${MESSAGE_JSON_PATH}`)); }); if (usersChunk.length > 0) { @@ -467,7 +470,7 @@ const processUpdateUserBatch = (chunk, registerDeviceOrBrowserTokenEvents) => { const batchUpdateUserEvents = (updateUserEvents, registerDeviceOrBrowserTokenEvents) => { // Batching update user events // arrayChunks = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] - const updateUserEventsChunks = _.chunk(updateUserEvents, IDENTIFY_MAX_BATCH_SIZE); + const updateUserEventsChunks = lodash.chunk(updateUserEvents, IDENTIFY_MAX_BATCH_SIZE); return updateUserEventsChunks.reduce((batchedResponseList, chunk) => { const batchedResponse = processUpdateUserBatch(chunk, registerDeviceOrBrowserTokenEvents); return batchedResponseList.concat(batchedResponse); @@ -532,7 +535,7 @@ const processCatalogBatch = (chunk) => { const batchCatalogEvents = (catalogEvents) => { // Batching catalog events // arrayChunks = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] - const catalogEventsChunks = _.chunk(catalogEvents, IDENTIFY_MAX_BATCH_SIZE); + const catalogEventsChunks = lodash.chunk(catalogEvents, IDENTIFY_MAX_BATCH_SIZE); return catalogEventsChunks.reduce((batchedResponseList, chunk) => { const batchedResponse = processCatalogBatch(chunk); return batchedResponseList.concat(batchedResponse); @@ -553,7 +556,7 @@ const processTrackBatch = (chunk) => { chunk.forEach((event) => { metadata.push(event.metadata); - events.push(get(event, 'message.body.JSON')); + events.push(get(event, `${MESSAGE_JSON_PATH}`)); }); const batchEventResponse = defaultBatchRequestConfig(); @@ -579,7 +582,7 @@ const processTrackBatch = (chunk) => { const batchTrackEvents = (trackEvents) => { // Batching track events // arrayChunks = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] - const trackEventsChunks = _.chunk(trackEvents, TRACK_MAX_BATCH_SIZE); + const trackEventsChunks = lodash.chunk(trackEvents, TRACK_MAX_BATCH_SIZE); return trackEventsChunks.reduce((batchedResponseList, chunk) => { const batchedResponse = processTrackBatch(chunk); return batchedResponseList.concat(batchedResponse); @@ -649,9 +652,9 @@ const mapRegisterDeviceOrBrowserTokenEventsWithJobId = (events) => { * @returns */ const categorizeEvent = (event) => { - const { message, metadata, destination } = event; + const { message, metadata, destination, error } = event; - if (event?.error) { + if (error) { return { type: 'error', data: event }; } diff --git a/src/v0/destinations/klaviyo/transform.js b/src/v0/destinations/klaviyo/transform.js index bb19c5f8fd..86d5880e4c 100644 --- a/src/v0/destinations/klaviyo/transform.js +++ b/src/v0/destinations/klaviyo/transform.js @@ -53,7 +53,7 @@ const { JSON_MIME_TYPE } = require('../../util/constant'); */ const identifyRequestHandler = async (message, category, destination) => { // If listId property is present try to subscribe/member user in list - const { privateApiKey, enforceEmailAsPrimary, flattenProperties } = destination.Config; + const { privateApiKey, enforceEmailAsPrimary, listId, flattenProperties } = destination.Config; const mappedToDestination = get(message, MappedToDestinationKey); if (mappedToDestination) { addExternalIdToTraits(message); @@ -111,10 +111,7 @@ const identifyRequestHandler = async (message, category, destination) => { const responseArray = [profileUpdateResponseBuilder(payload, profileId, category, privateApiKey)]; // check if user wants to subscribe profile or not and listId is present or not - if ( - traitsInfo?.properties?.subscribe && - (traitsInfo.properties?.listId || destination.Config?.listId) - ) { + if (traitsInfo?.properties?.subscribe && (traitsInfo.properties?.listId || listId)) { responseArray.push(subscribeUserToList(message, traitsInfo, destination)); return responseArray; } diff --git a/src/v0/destinations/klaviyo/util.js b/src/v0/destinations/klaviyo/util.js index 3c4882b834..21a492739b 100644 --- a/src/v0/destinations/klaviyo/util.js +++ b/src/v0/destinations/klaviyo/util.js @@ -1,5 +1,5 @@ const { defaultRequestConfig } = require('rudder-transformer-cdk/build/utils'); -const _ = require('lodash'); +const lodash = require('lodash'); const { WhiteListedTraits } = require('../../../constants'); const { @@ -21,6 +21,8 @@ const tags = require('../../util/tags'); const { handleHttpRequest } = require('../../../adapters/network'); const { client: errNotificationClient } = require('../../../util/errorNotifier'); +const REVISION_CONSTANT = '2023-02-22'; + /** * 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 @@ -88,7 +90,7 @@ const profileUpdateResponseBuilder = (payload, profileId, category, privateApiKe Authorization: `Klaviyo-API-Key ${privateApiKey}`, 'Content-Type': JSON_MIME_TYPE, Accept: JSON_MIME_TYPE, - revision: '2023-02-22', + revision: REVISION_CONSTANT, }; identifyResponse.body.JSON = removeUndefinedAndNullValues(payload); return identifyResponse; @@ -148,7 +150,7 @@ const subscribeUserToList = (message, traitsInfo, destination) => { Authorization: `Klaviyo-API-Key ${privateApiKey}`, 'Content-Type': JSON_MIME_TYPE, Accept: JSON_MIME_TYPE, - revision: '2023-02-22', + revision: REVISION_CONSTANT, }; response.body.JSON = removeUndefinedAndNullValues(payload); @@ -220,7 +222,7 @@ const generateBatchedPaylaodForArray = (events) => { Authorization: `Klaviyo-API-Key ${destination.Config.privateApiKey}`, 'Content-Type': JSON_MIME_TYPE, Accept: JSON_MIME_TYPE, - revision: '2023-02-22', + revision: REVISION_CONSTANT, }; batchEventResponse = { @@ -237,7 +239,7 @@ const generateBatchedPaylaodForArray = (events) => { * @returns */ const groupSubsribeResponsesUsingListId = (subscribeResponseList) => { - const subscribeEventGroups = _.groupBy( + const subscribeEventGroups = lodash.groupBy( subscribeResponseList, (event) => event.message.body.JSON.data.attributes.list_id, ); @@ -248,7 +250,7 @@ const getBatchedResponseList = (subscribeEventGroups, identifyResponseList) => { let batchedResponseList = []; Object.keys(subscribeEventGroups).forEach((listId) => { // eventChunks = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] - const eventChunks = _.chunk(subscribeEventGroups[listId], MAX_BATCH_SIZE); + const eventChunks = lodash.chunk(subscribeEventGroups[listId], MAX_BATCH_SIZE); const batchedResponse = eventChunks.map((chunk) => { const batchEventResponse = generateBatchedPaylaodForArray(chunk); return getSuccessRespEvents( diff --git a/src/v0/destinations/kustomer/util.js b/src/v0/destinations/kustomer/util.js index dd89f8ed5d..31157b2738 100644 --- a/src/v0/destinations/kustomer/util.js +++ b/src/v0/destinations/kustomer/util.js @@ -1,5 +1,5 @@ /* eslint-disable eqeqeq */ -const _ = require('lodash'); +const lodash = require('lodash'); const set = require('set-value'); const get = require('get-value'); const myAxios = require('../../../util/myAxios'); @@ -26,7 +26,7 @@ const ISO_8601 = /^\d{4}(-\d\d(-\d\d(t\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)| const transformNumberField = (fieldName) => { const typeDelim = ''; const transformedFieldName = fieldName.trim().replace(/\s+/g, '-'); - if (_.endsWith(transformedFieldName, 'Num')) { + if (lodash.endsWith(transformedFieldName, 'Num')) { return transformedFieldName; } return `${transformedFieldName}${typeDelim}Num`; @@ -35,7 +35,7 @@ const transformNumberField = (fieldName) => { const transformDateField = (fieldName) => { const typeDelim = ''; const transformedFieldName = fieldName.trim().replace(/\s+/g, '-'); - if (_.endsWith(transformedFieldName, 'At')) { + if (lodash.endsWith(transformedFieldName, 'At')) { return transformedFieldName; } return `${transformedFieldName}${typeDelim}At`; @@ -62,7 +62,7 @@ const transformField = (fieldName) => { }; const handleAdvancedtransformations = (event) => { - let cloneEvent = _.cloneDeep(event); + let cloneEvent = lodash.cloneDeep(event); const transformedMeta = {}; let eventName = get(cloneEvent, 'name'); const { meta } = cloneEvent; diff --git a/src/v0/destinations/mailchimp/transform.js b/src/v0/destinations/mailchimp/transform.js index 3ceb669da1..70b37200f4 100644 --- a/src/v0/destinations/mailchimp/transform.js +++ b/src/v0/destinations/mailchimp/transform.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const { defaultPutRequestConfig, handleRtTfSingleEventError, @@ -130,10 +130,10 @@ const batchEvents = (successRespList) => { // audienceId1: [...events] // audienceId2: [...events] // } - const audienceEventGroups = _.groupBy(successRespList, (event) => event.message.audienceId); + const audienceEventGroups = lodash.groupBy(successRespList, (event) => event.message.audienceId); Object.keys(audienceEventGroups).forEach((audienceId) => { // eventChunks = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] - const eventChunks = _.chunk(audienceEventGroups[audienceId], MAX_BATCH_SIZE); + const eventChunks = lodash.chunk(audienceEventGroups[audienceId], MAX_BATCH_SIZE); eventChunks.forEach((chunk) => { const batchEventResponse = generateBatchedPaylaodForArray(audienceId, chunk); batchedResponseList.push( diff --git a/src/v0/destinations/mailjet/transform.js b/src/v0/destinations/mailjet/transform.js index fa87b3ed2a..3e3cfe5c81 100644 --- a/src/v0/destinations/mailjet/transform.js +++ b/src/v0/destinations/mailjet/transform.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const { getErrorRespEvents, getSuccessRespEvents, @@ -98,12 +98,12 @@ const batchEvents = (successRespList) => { "listId2&&Action2": [{message : {}, metadata : {}, destination: {}}], "listId2&&Action1": [{message : {}, metadata : {}, destination: {}}] */ - const eventGroups = _.groupBy(successRespList, (event) => { + const eventGroups = lodash.groupBy(successRespList, (event) => { const { listId, action } = event.message; return `${listId}&&${action}`; }); Object.keys(eventGroups).forEach((combination) => { - const eventChunks = _.chunk(eventGroups[combination], MAX_BATCH_SIZE); + const eventChunks = lodash.chunk(eventGroups[combination], MAX_BATCH_SIZE); // eventChunks = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] eventChunks.forEach((chunk) => { const batchEventResponse = generateBatchedPaylaodForArray(chunk, combination); diff --git a/src/v0/destinations/mailmodo/transform.js b/src/v0/destinations/mailmodo/transform.js index 4f1a3d7e8c..39783c864f 100644 --- a/src/v0/destinations/mailmodo/transform.js +++ b/src/v0/destinations/mailmodo/transform.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const get = require('get-value'); const { isEmpty } = require('lodash'); const { EventType } = require('../../../constants'); @@ -112,7 +112,7 @@ const process = (event) => processEvent(event.message, event.destination); function batchEvents(eventsChunk) { const batchedResponseList = []; - const arrayChunks = _.chunk(eventsChunk, IDENTIFY_MAX_BATCH_SIZE); + const arrayChunks = lodash.chunk(eventsChunk, IDENTIFY_MAX_BATCH_SIZE); // list of chunks [ [..], [..] ] arrayChunks.forEach((chunk) => { diff --git a/src/v0/destinations/marketo/networkHandler.js b/src/v0/destinations/marketo/networkHandler.js index c25a7a246c..7abcc65c02 100644 --- a/src/v0/destinations/marketo/networkHandler.js +++ b/src/v0/destinations/marketo/networkHandler.js @@ -3,7 +3,6 @@ const { marketoResponseHandler } = require('./util'); const { proxyRequest, prepareProxyRequest } = require('../../../adapters/network'); const { processAxiosResponse } = require('../../../adapters/utils/networkUtils'); -// eslint-disable-next-line no-unused-vars const responseHandler = (destinationResponse, destType) => { const message = 'Request Processed Successfully'; const { status, rudderJobMetadata } = destinationResponse; diff --git a/src/v0/destinations/marketo_bulk_upload/util.js b/src/v0/destinations/marketo_bulk_upload/util.js index 0b4eb1e48a..a60f57e50b 100644 --- a/src/v0/destinations/marketo_bulk_upload/util.js +++ b/src/v0/destinations/marketo_bulk_upload/util.js @@ -410,8 +410,9 @@ const getFieldSchemaMap = async (accessToken, munchkinId) => { const checkEventStatusViaSchemaMatching = (event, fieldMap) => { const mismatchedFields = {}; const events = event.input; - events.forEach((event) => { - const { message, metadata } = event; + events.forEach((ev) => { + const { message, metadata } = ev; + // eslint-disable-next-line @typescript-eslint/naming-convention const { job_id } = metadata; Object.entries(message).forEach(([paramName, paramValue]) => { diff --git a/src/v0/destinations/marketo_static_list/networkHandler.js b/src/v0/destinations/marketo_static_list/networkHandler.js index 5a783086b8..30b053b9d3 100644 --- a/src/v0/destinations/marketo_static_list/networkHandler.js +++ b/src/v0/destinations/marketo_static_list/networkHandler.js @@ -4,7 +4,6 @@ const v0Utils = require('../../util'); const { processAxiosResponse } = require('../../../adapters/utils/networkUtils'); const { DESTINATION } = require('./config'); -// eslint-disable-next-line no-unused-vars const responseHandler = (destinationResponse, destType) => { const message = 'Request Processed Successfully'; const { status, rudderJobMetadata } = destinationResponse; @@ -25,6 +24,7 @@ const responseHandler = (destinationResponse, destType) => { }; }; +// eslint-disable-next-line @typescript-eslint/naming-convention class networkHandler { constructor() { this.responseHandler = responseHandler; diff --git a/src/v0/destinations/marketo_static_list/transform.js b/src/v0/destinations/marketo_static_list/transform.js index 7175b5241f..156e26270b 100644 --- a/src/v0/destinations/marketo_static_list/transform.js +++ b/src/v0/destinations/marketo_static_list/transform.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const cloneDeep = require('lodash/cloneDeep'); const { defaultPostRequestConfig, @@ -50,7 +50,7 @@ const batchResponseBuilder = (message, Config, token, leadIds, operation) => { throw new InstrumentationError('No static listId is provided'); } const response = []; - const leadIdsChunks = _.chunk(leadIds, MAX_LEAD_IDS_SIZE); + const leadIdsChunks = lodash.chunk(leadIds, MAX_LEAD_IDS_SIZE); leadIdsChunks.forEach((ids) => { response.push(responseBuilder(endpoint, ids, operation, token)); }); diff --git a/src/v0/destinations/mp/deleteUsers.js b/src/v0/destinations/mp/deleteUsers.js index 52be45f230..5b86cae6ae 100644 --- a/src/v0/destinations/mp/deleteUsers.js +++ b/src/v0/destinations/mp/deleteUsers.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const { handleHttpRequest } = require('../../../adapters/network'); const { isHttpStatusSuccess } = require('../../util'); const { @@ -37,7 +37,7 @@ const deleteProfile = async (userAttributes, config) => { // batchEvents = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] // ref : https://developer.mixpanel.com/reference/delete-profile - const batchEvents = _.chunk(data, DEL_MAX_BATCH_SIZE); + const batchEvents = lodash.chunk(data, DEL_MAX_BATCH_SIZE); await Promise.all( batchEvents.map(async (batchEvent) => { const { processedResponse: handledDelResponse } = await handleHttpRequest( @@ -70,7 +70,7 @@ const deleteProfile = async (userAttributes, config) => { }; const createDeletionTask = async (userAttributes, config) => { - const { token, gdprApiToken } = config; + const { token, gdprApiToken, dataResidency } = config; if (!gdprApiToken) { throw new ConfigurationError( @@ -84,7 +84,7 @@ const createDeletionTask = async (userAttributes, config) => { 'Content-Type': JSON_MIME_TYPE, Authorization: `Bearer ${gdprApiToken}`, }; - const complianceType = config?.dataResidency === 'eu' ? 'GDPR' : 'CCPA'; + const complianceType = dataResidency === 'eu' ? 'GDPR' : 'CCPA'; // batchEvents = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] // ref : https://developer.mixpanel.com/docs/privacy-security#create-a-deletion-task diff --git a/src/v0/destinations/mp/transform.js b/src/v0/destinations/mp/transform.js index 7839b9f123..bdae00e1c2 100644 --- a/src/v0/destinations/mp/transform.js +++ b/src/v0/destinations/mp/transform.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const get = require('get-value'); const { EventType } = require('../../../constants'); const { @@ -440,8 +440,8 @@ const processRouterDest = async (inputs, reqMetadata) => { let processedEvents = await process(event); processedEvents = CommonUtils.toArray(processedEvents); - return processedEvents.map((response) => ({ - message: response, + return processedEvents.map((res) => ({ + message: res, metadata: event.metadata, destination: event.destination, })); @@ -451,7 +451,7 @@ const processRouterDest = async (inputs, reqMetadata) => { }), ); - transformedPayloads = _.flatMap(transformedPayloads); + transformedPayloads = lodash.flatMap(transformedPayloads); const { engageEvents, groupsEvents, trackEvents, importEvents, batchErrorRespList } = groupEventsByEndpoint(transformedPayloads); @@ -471,7 +471,7 @@ const processRouterDest = async (inputs, reqMetadata) => { ); // Flatten the response array containing batched events from multiple groups - const allBatchedEvents = _.flatMap(response); + const allBatchedEvents = lodash.flatMap(response); return combineBatchRequestsWithSameJobIds(allBatchedEvents); }; diff --git a/src/v0/destinations/mp/util.js b/src/v0/destinations/mp/util.js index c5fc7e04be..35c530855e 100644 --- a/src/v0/destinations/mp/util.js +++ b/src/v0/destinations/mp/util.js @@ -143,6 +143,7 @@ const isImportAuthCredentialsAvailable = (destination) => const findExistingBatch = (batch, metadataMap) => { let existingBatch = null; + // eslint-disable-next-line no-restricted-syntax for (const metadataItem of batch.metadata) { if (metadataMap.has(metadataItem.jobId)) { existingBatch = metadataMap.get(metadataItem.jobId); @@ -158,8 +159,9 @@ const findExistingBatch = (batch, metadataMap) => { * @param {*} mergedBatches An array of merged batch objects. */ const removeDuplicateMetadata = (mergedBatches) => { - for (const batch of mergedBatches) { + mergedBatches.forEach((batch) => { const metadataSet = new Set(); + // eslint-disable-next-line no-param-reassign batch.metadata = batch.metadata.filter((metadataItem) => { if (!metadataSet.has(metadataItem.jobId)) { metadataSet.add(metadataItem.jobId); @@ -167,7 +169,7 @@ const removeDuplicateMetadata = (mergedBatches) => { } return false; }); - } + }); }; /** diff --git a/src/v0/destinations/ometria/transform.js b/src/v0/destinations/ometria/transform.js index d3a4d71753..6d3c2ab174 100644 --- a/src/v0/destinations/ometria/transform.js +++ b/src/v0/destinations/ometria/transform.js @@ -1,4 +1,4 @@ -/* eslint-disable one-var */ +/* eslint-disable one-var, @typescript-eslint/naming-convention */ /* eslint-disable camelcase */ const { EventType } = require('../../../constants'); const { ConfigurationError, InstrumentationError } = require('../../util/errorTypes'); diff --git a/src/v0/destinations/pardot/transform.js b/src/v0/destinations/pardot/transform.js index b9f78a6c34..bfc7386ef9 100644 --- a/src/v0/destinations/pardot/transform.js +++ b/src/v0/destinations/pardot/transform.js @@ -48,10 +48,7 @@ const { getAccessToken, } = require('../../util'); const { CONFIG_CATEGORIES } = require('./config'); -const { - ConfigurationError, - InstrumentationError, -} = require('../../util/errorTypes'); +const { ConfigurationError, InstrumentationError } = require('../../util/errorTypes'); const buildResponse = (payload, url, destination, token) => { const responseBody = removeUndefinedValues(payload); diff --git a/src/v0/destinations/personalize/scripts/create-trackingid.js b/src/v0/destinations/personalize/scripts/create-trackingid.js index 0f4553baac..efd8eaa2f9 100644 --- a/src/v0/destinations/personalize/scripts/create-trackingid.js +++ b/src/v0/destinations/personalize/scripts/create-trackingid.js @@ -11,7 +11,7 @@ const { fromEnv } = require('@aws-sdk/credential-providers'); const readline = require('readline'); -require('dotenv').config() +require('dotenv').config(); async function promtForInput(rl, questionText) { return new Promise((resolve) => { @@ -33,7 +33,8 @@ async function collectInputs(rl) { await checkEnvAndpromtForInput(rl, 'AWS Secret Access Key: ', 'AWS_SECRET_ACCESS_KEY'); await checkEnvAndpromtForInput(rl, 'AWS REGION: ', 'AWS_REGION'); await checkEnvAndpromtForInput(rl, 'Name of Dataset Group: ', 'DATASET_GROUP_NAME'); - await checkEnvAndpromtForInput(rl, + await checkEnvAndpromtForInput( + rl, 'Number of fields in Schema in addition to USER_ID, TIMESTAMP, ITEM_ID: ', 'NUMBER_OF_FIELDS', ); @@ -55,14 +56,12 @@ async function collectFileds(rl) { for (let i = 4; i <= noOfFields + 3; i += 1) { const fieldName = await promtForInput(rl, `Name of field no. ${i}: `); - const typeName = await promtForInput(rl, `Type of field ${fieldName}: `) + const typeName = await promtForInput(rl, `Type of field ${fieldName}: `); schema.fields.push({ name: fieldName, type: typeName }); - } return schema; } - (async function () { let rl = readline.createInterface(process.stdin, process.stdout); await collectInputs(rl); diff --git a/src/v0/destinations/personalize/transform.js b/src/v0/destinations/personalize/transform.js index c8eca2af2f..bb547f7b28 100644 --- a/src/v0/destinations/personalize/transform.js +++ b/src/v0/destinations/personalize/transform.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const { KEY_CHECK_LIST, MANDATORY_PROPERTIES } = require('./config'); const { EventType } = require('../../../constants'); const { @@ -42,28 +42,28 @@ const putEventsHandler = (message, destination) => { throw new InstrumentationError(`Mapped property ${keyMap[key]} not found`); } if (isDefined(disableStringify) && disableStringify) { - outputEvent.properties[_.camelCase(key)] = value; + outputEvent.properties[lodash.camelCase(key)] = value; } else { // users using old config will have stringified property by default - outputEvent.properties[_.camelCase(key)] = String(value); + outputEvent.properties[lodash.camelCase(key)] = String(value); } } else if (!MANDATORY_PROPERTIES.includes(key.toUpperCase())) { if ((!isDefinedAndNotNull(value) || isBlank(value)) && key.toUpperCase() !== 'ITEM_ID') { throw new InstrumentationError(`Null values cannot be sent for ${keyMap[key]} `); } if (!(key.toUpperCase() === 'IMPRESSION' || key.toUpperCase() === 'EVENT_VALUE')) - outputEvent[_.camelCase(key)] = String(value); + outputEvent[lodash.camelCase(key)] = String(value); else if (key.toUpperCase() === 'IMPRESSION') { - outputEvent[_.camelCase(key)] = Array.isArray(value) ? value.map(String) : [String(value)]; - outputEvent[_.camelCase(key)] = _.without( - outputEvent[_.camelCase(key)], + outputEvent[lodash.camelCase(key)] = Array.isArray(value) ? value.map(String) : [String(value)]; + outputEvent[lodash.camelCase(key)] = lodash.without( + outputEvent[lodash.camelCase(key)], undefined, null, '', ); } else if (!Number.isNaN(parseFloat(value))) { // for eventValue - outputEvent[_.camelCase(key)] = parseFloat(value); + outputEvent[lodash.camelCase(key)] = parseFloat(value); } else throw new InstrumentationError('EVENT_VALUE should be a float value'); } }); @@ -115,7 +115,7 @@ const putItemsHandler = (message, destination) => { // eslint-disable-next-line no-lonely-if if (!isDefinedAndNotNull(value) || isBlank(value)) { // itemId cannot be null - value = String(_.get(message, keyMap[key])); + value = String(lodash.get(message, keyMap[key])); } } if (!isDefined(value)) { @@ -123,7 +123,7 @@ const putItemsHandler = (message, destination) => { } if (key.toUpperCase() !== 'ITEM_ID') { // itemId is not allowed inside properties - outputItem.properties[_.camelCase(key)] = value; + outputItem.properties[lodash.camelCase(key)] = value; } else { outputItem.itemId = String(value); } @@ -185,7 +185,7 @@ const identifyRequestHandler = (message, destination, eventOperation) => { } if (key.toUpperCase() !== 'USER_ID') { // userId is not allowed inside properties - outputUser.properties[_.camelCase(key)] = value; + outputUser.properties[lodash.camelCase(key)] = value; } }); if (!outputUser.userId) { diff --git a/src/v0/destinations/redis/transform.js b/src/v0/destinations/redis/transform.js index 124569c8e8..e9442d8487 100644 --- a/src/v0/destinations/redis/transform.js +++ b/src/v0/destinations/redis/transform.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const flatten = require('flat'); const { isEmpty, isObject } = require('../../util'); @@ -17,7 +17,7 @@ const processValues = (obj) => { } const val = obj[key]; // eslint-disable-next-line no-param-reassign - obj[key] = _.isArray(val) ? JSON.stringify(val) : _.toString(val); + obj[key] = lodash.isArray(val) ? JSON.stringify(val) : lodash.toString(val); }); }; @@ -68,7 +68,7 @@ const process = (event) => { } const hmap = { - key: `${keyPrefix}user:${_.toString(message.userId)}`, + key: `${keyPrefix}user:${lodash.toString(message.userId)}`, fields: {}, }; diff --git a/src/v0/destinations/sendgrid/transform.js b/src/v0/destinations/sendgrid/transform.js index 0f944e5f28..4e68b34c7d 100644 --- a/src/v0/destinations/sendgrid/transform.js +++ b/src/v0/destinations/sendgrid/transform.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const { EventType } = require('../../../constants'); const { ErrorMessage, @@ -211,10 +211,10 @@ const batchEvents = (successRespList) => { "contactListIds3": [{message : {}, metadata : {}, destination: {}}], "contactListIds4": [{message : {}, metadata : {}, destination: {}}] */ - const eventGroups = _.groupBy(identifyCalls, (event) => event.message.body.JSON.contactListIds); + const eventGroups = lodash.groupBy(identifyCalls, (event) => event.message.body.JSON.contactListIds); Object.keys(eventGroups).forEach((combination) => { - const eventChunks = _.chunk(eventGroups[combination], MAX_BATCH_SIZE); + const eventChunks = lodash.chunk(eventGroups[combination], MAX_BATCH_SIZE); // eventChunks = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] eventChunks.forEach((chunk) => { const batchEventResponse = generateBatchedPaylaodForArray(chunk, combination); diff --git a/src/v0/destinations/sendinblue/transform.js b/src/v0/destinations/sendinblue/transform.js index 8e8645f32f..151304db22 100644 --- a/src/v0/destinations/sendinblue/transform.js +++ b/src/v0/destinations/sendinblue/transform.js @@ -1,4 +1,5 @@ /* eslint-disable camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ const { EventType } = require('../../../constants'); const { defaultRequestConfig, diff --git a/src/v0/destinations/singular/util.js b/src/v0/destinations/singular/util.js index c2a88a9c46..542b049a2e 100644 --- a/src/v0/destinations/singular/util.js +++ b/src/v0/destinations/singular/util.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); const { CONFIG_CATEGORIES, MAPPING_CONFIG, @@ -75,7 +75,7 @@ const exclusionList = { * @param {*} eventName */ const isSessionEvent = (Config, eventName) => { - const mappedSessionEvents = _.map(Config.sessionEventList, 'sessionEventName'); + const mappedSessionEvents = lodash.map(Config.sessionEventList, 'sessionEventName'); return mappedSessionEvents.includes(eventName) || SESSIONEVENTS.includes(eventName.toLowerCase()); }; diff --git a/src/v0/destinations/slack/transform.js b/src/v0/destinations/slack/transform.js index c913f3103e..8db934d71f 100644 --- a/src/v0/destinations/slack/transform.js +++ b/src/v0/destinations/slack/transform.js @@ -1,5 +1,4 @@ -/* eslint-disable no-nested-ternary */ -/* eslint-disable no-prototype-builtins */ +/* eslint-disable no-nested-ternary, no-restricted-syntax, no-prototype-builtins */ const Handlebars = require('handlebars'); const { EventType } = require('../../../constants'); const { diff --git a/src/v0/destinations/snapchat_custom_audience/networkHandler.js b/src/v0/destinations/snapchat_custom_audience/networkHandler.js index 49ea452550..196f9a87fb 100644 --- a/src/v0/destinations/snapchat_custom_audience/networkHandler.js +++ b/src/v0/destinations/snapchat_custom_audience/networkHandler.js @@ -1,9 +1,7 @@ const { removeUndefinedValues, getAuthErrCategoryFromErrDetailsAndStCode } = require('../../util'); const { prepareProxyRequest, getPayloadData, httpSend } = require('../../../adapters/network'); const { isHttpStatusSuccess } = require('../../util/index'); -const { - REFRESH_TOKEN, -} = require('../../../adapters/networkhandler/authConstants'); +const { REFRESH_TOKEN } = require('../../../adapters/networkhandler/authConstants'); const tags = require('../../util/tags'); const { getDynamicErrorType, diff --git a/src/v0/destinations/tiktok_ads/networkHandler.js b/src/v0/destinations/tiktok_ads/networkHandler.js index ade33e5133..1ec31e982a 100644 --- a/src/v0/destinations/tiktok_ads/networkHandler.js +++ b/src/v0/destinations/tiktok_ads/networkHandler.js @@ -40,6 +40,7 @@ const responseHandler = (destinationResponse) => { ); }; +// eslint-disable-next-line @typescript-eslint/naming-convention class networkHandler { constructor() { this.responseHandler = responseHandler; diff --git a/src/v0/destinations/tiktok_ads/transform.js b/src/v0/destinations/tiktok_ads/transform.js index 6bf9cd7270..4e99d83575 100644 --- a/src/v0/destinations/tiktok_ads/transform.js +++ b/src/v0/destinations/tiktok_ads/transform.js @@ -1,4 +1,5 @@ /* eslint-disable camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ const _ = require('lodash'); const { SHA256 } = require('crypto-js'); const get = require('get-value'); diff --git a/src/v0/destinations/tiktok_ads/util.js b/src/v0/destinations/tiktok_ads/util.js index 98acb794a5..4050a9fe34 100644 --- a/src/v0/destinations/tiktok_ads/util.js +++ b/src/v0/destinations/tiktok_ads/util.js @@ -8,6 +8,7 @@ const { removeUndefinedAndNullValues } = require('../../util'); const getContents = (message) => { const contents = []; const { properties } = message; + // eslint-disable-next-line @typescript-eslint/naming-convention const { products, content_type, contentType } = properties; if (products && Array.isArray(products) && products.length > 0) { products.forEach((product) => { diff --git a/src/v0/destinations/tiktok_ads_offline_events/transform.js b/src/v0/destinations/tiktok_ads_offline_events/transform.js index 0ade5bbfbb..3539c856a3 100644 --- a/src/v0/destinations/tiktok_ads_offline_events/transform.js +++ b/src/v0/destinations/tiktok_ads_offline_events/transform.js @@ -1,6 +1,6 @@ const { SHA256 } = require('crypto-js'); const set = require('set-value'); -const _ = require('lodash'); +const lodash = require('lodash'); const { EventType } = require('../../../constants'); const { constructPayload, @@ -191,7 +191,7 @@ const batchEvents = (eventChunksArray) => { // event_set_id1: [...events] // event_set_id2: [...events] // } - const groupedEventChunks = _.groupBy(eventChunksArray, ({ message }) => { + const groupedEventChunks = lodash.groupBy(eventChunksArray, ({ message }) => { if (Array.isArray(message)) return message[0].event_set_id; return message.event_set_id; }); diff --git a/src/v0/sources/auth0/transform.js b/src/v0/sources/auth0/transform.js index 8a0013036b..d2721780d8 100644 --- a/src/v0/sources/auth0/transform.js +++ b/src/v0/sources/auth0/transform.js @@ -41,6 +41,7 @@ function processEvents(eventList) { eventList.forEach((event) => { let response = {}; // eslint-disable-next-line camelcase + // 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) { diff --git a/src/v0/sources/shopify/transform.js b/src/v0/sources/shopify/transform.js index 5c26bfd844..7bbb928fd8 100644 --- a/src/v0/sources/shopify/transform.js +++ b/src/v0/sources/shopify/transform.js @@ -1,4 +1,5 @@ -const _ = require('lodash'); +/* eslint-disable @typescript-eslint/naming-convention */ +const lodash = require('lodash'); const get = require('get-value'); const stats = require('../../../util/stats'); const { @@ -125,8 +126,8 @@ const trackPayloadBuilder = (event, shopifyTopic) => { const processEvent = async (inputEvent, metricMetadata) => { let message; + const event = lodash.cloneDeep(inputEvent); let redisData; - const event = _.cloneDeep(inputEvent); const shopifyTopic = getShopifyTopic(event); delete event.query_parameters; switch (shopifyTopic) { diff --git a/src/v0/sources/shopify/util.js b/src/v0/sources/shopify/util.js index 76cc255f38..0d81ddc185 100644 --- a/src/v0/sources/shopify/util.js +++ b/src/v0/sources/shopify/util.js @@ -1,8 +1,15 @@ /* eslint-disable camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ const { v5 } = require('uuid'); const sha256 = require('sha256'); const stats = require('../../../util/stats'); -const { constructPayload, extractCustomFields, flattenJson, generateUUID, isDefinedAndNotNull, } = require('../../util'); +const { + constructPayload, + extractCustomFields, + flattenJson, + generateUUID, + isDefinedAndNotNull, +} = require('../../util'); const { RedisDB } = require('../../../util/redis/redisConnector'); const logger = require('../../../logger'); const { @@ -13,11 +20,10 @@ const { SHOPIFY_TRACK_MAP, SHOPIFY_ADMIN_ONLY_EVENTS, useRedisDatabase, - maxTimeToIdentifyRSGeneratedCall + maxTimeToIdentifyRSGeneratedCall, } = require('./config'); const { TransformationError } = require('../../util/errorTypes'); - const getDataFromRedis = async (key, metricMetadata) => { try { stats.increment('shopify_redis_calls', { @@ -32,8 +38,7 @@ const getDataFromRedis = async (key, metricMetadata) => { }); } return redisData; - } - catch (e) { + } catch (e) { logger.debug(`{{SHOPIFY::}} Get call Failed due redis error ${e}`); stats.increment('shopify_redis_failures', { type: 'get', @@ -112,11 +117,11 @@ const extractEmailFromPayload = (event) => { }; const getCartToken = (message) => { - const { event } = message; + const { event, properties } = message; if (event === SHOPIFY_TRACK_MAP.carts_update) { - return message.properties?.id || message.properties?.token; + return properties?.id || properties?.token; } - return message.properties?.cart_token || null; + return properties?.cart_token || null; }; /** @@ -141,9 +146,9 @@ const getRudderIdFromNoteAtrributes = (noteAttributes, field) => { * -> if true we return `null`; * -> else we don't have any identifer (very edge case) we return `random anonymousId` * No Random SessionId is generated as its not a required field - * @param {*} message - * @param {*} metricMetadata - * @returns + * @param {*} message + * @param {*} metricMetadata + * @returns */ const getAnonymousIdAndSessionId = async (message, metricMetadata, redisData = null) => { let anonymousId; @@ -151,8 +156,8 @@ const getAnonymousIdAndSessionId = async (message, metricMetadata, redisData = n const noteAttributes = message.properties?.note_attributes; // Giving Priority to note_attributes to fetch rudderAnonymousId over Redis due to better efficiency if (isDefinedAndNotNull(noteAttributes)) { - anonymousId = getRudderIdFromNoteAtrributes(noteAttributes, "rudderAnonymousId"); - sessionId = getRudderIdFromNoteAtrributes(noteAttributes, "rudderSessionId"); + anonymousId = getRudderIdFromNoteAtrributes(noteAttributes, 'rudderAnonymousId'); + sessionId = getRudderIdFromNoteAtrributes(noteAttributes, 'rudderSessionId'); } // falling back to cartToken mapping or its hash in case no rudderAnonymousId or rudderSessionId is found if (isDefinedAndNotNull(anonymousId) && isDefinedAndNotNull(sessionId)) { @@ -163,7 +168,10 @@ const getAnonymousIdAndSessionId = async (message, metricMetadata, redisData = n if (SHOPIFY_ADMIN_ONLY_EVENTS.includes(message.event)) { return { anonymousId, sessionId }; } - return { anonymousId: isDefinedAndNotNull(anonymousId) ? anonymousId : generateUUID(), sessionId }; + return { + anonymousId: isDefinedAndNotNull(anonymousId) ? anonymousId : generateUUID(), + sessionId, + }; } if (useRedisDatabase) { if (!isDefinedAndNotNull(redisData)) { @@ -196,8 +204,7 @@ const updateCartItemsInRedis = async (cartToken, newCartItemsHash, metricMetadat ...metricMetadata, }); await RedisDB.setVal(`${cartToken}`, value); - } - catch (e) { + } catch (e) { logger.debug(`{{SHOPIFY::}} itemsHash set call Failed due redis error ${e}`); stats.increment('shopify_redis_failures', { type: 'set', @@ -228,10 +235,10 @@ const checkAndUpdateCartItems = async (inputEvent, redisData, metricMetadata) => } await updateCartItemsInRedis(cartToken, newCartItemsHash, metricMetadata); } else { - const { created_at, updated_at } = inputEvent; + const { created_at, updated_at, line_items } = inputEvent; const timeDifference = Date.parse(updated_at) - Date.parse(created_at); const isTimeWithinThreshold = timeDifference < maxTimeToIdentifyRSGeneratedCall; - const isLineItemsEmpty = inputEvent?.line_items?.length === 0; + const isLineItemsEmpty = line_items?.length === 0; if (isTimeWithinThreshold && isLineItemsEmpty) { return false; diff --git a/src/v0/util/deleteUserUtils.js b/src/v0/util/deleteUserUtils.js index 81607aeb3d..6cf16d7f9e 100644 --- a/src/v0/util/deleteUserUtils.js +++ b/src/v0/util/deleteUserUtils.js @@ -1,4 +1,4 @@ -const _ = require('lodash'); +const lodash = require('lodash'); /** * Takes the userAttributes array fetches userIds at root level of each element * and make batches of Ids accoring to MAX_BATCH_SIZE @@ -14,7 +14,7 @@ const getUserIdBatches = (userAttributes, MAX_BATCH_SIZE) => { userIds.push(userAttribute.userId); } }); - const userIdBatches = _.chunk(userIds, MAX_BATCH_SIZE); + const userIdBatches = lodash.chunk(userIds, MAX_BATCH_SIZE); return userIdBatches; }; diff --git a/src/v0/util/index.js b/src/v0/util/index.js index 00f98cafaf..42a4100510 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -9,7 +9,7 @@ const Handlebars = require('handlebars'); const fs = require('fs'); const path = require('path'); -const _ = require('lodash'); +const lodash = require('lodash'); const set = require('set-value'); const get = require('get-value'); const uaParser = require('ua-parser-js'); @@ -36,17 +36,18 @@ const { // INLINERS // ======================================================================== -const isDefined = (x) => !_.isUndefined(x); -const isNotEmpty = (x) => !_.isEmpty(x); +const isDefined = (x) => !lodash.isUndefined(x); +const isNotEmpty = (x) => !lodash.isEmpty(x); const isNotNull = (x) => x != null; const isDefinedAndNotNull = (x) => isDefined(x) && isNotNull(x); const isDefinedAndNotNullAndNotEmpty = (x) => isDefined(x) && isNotNull(x) && isNotEmpty(x); -const removeUndefinedValues = (obj) => _.pickBy(obj, isDefined); -const removeNullValues = (obj) => _.pickBy(obj, isNotNull); -const removeUndefinedAndNullValues = (obj) => _.pickBy(obj, isDefinedAndNotNull); -const removeUndefinedAndNullAndEmptyValues = (obj) => _.pickBy(obj, isDefinedAndNotNullAndNotEmpty); -const isBlank = (value) => _.isEmpty(_.toString(value)); -const flattenMap = (collection) => _.flatMap(collection, (x) => x); +const removeUndefinedValues = (obj) => lodash.pickBy(obj, isDefined); +const removeNullValues = (obj) => lodash.pickBy(obj, isNotNull); +const removeUndefinedAndNullValues = (obj) => lodash.pickBy(obj, isDefinedAndNotNull); +const removeUndefinedAndNullAndEmptyValues = (obj) => + lodash.pickBy(obj, isDefinedAndNotNullAndNotEmpty); +const isBlank = (value) => lodash.isEmpty(lodash.toString(value)); +const flattenMap = (collection) => lodash.flatMap(collection, (x) => x); // ======================================================================== // GENERIC UTLITY // ======================================================================== @@ -108,7 +109,7 @@ const isObject = (value) => { }; function isEmpty(input) { - return _.isEmpty(_.toString(input).trim()); + return lodash.isEmpty(lodash.toString(input).trim()); } /** @@ -126,8 +127,8 @@ function isEmptyObject(obj) { /** * Function to check if value is Defined, Not null and Not Empty. - * Create this function, Because existing isDefinedAndNotNullAndNotEmpty(123) is returning false due to lodash _.isEmpty function. - * _.isEmpty is used to detect empty collections/objects and it will return true for Integer, Boolean values. + * Create this function, Because existing isDefinedAndNotNullAndNotEmpty(123) is returning false due to lodash lodash.isEmpty function. + * lodash.isEmpty is used to detect empty collections/objects and it will return true for Integer, Boolean values. * ref: https://github.com/lodash/lodash/issues/496 * @param {*} value 123 * @returns yes @@ -141,7 +142,7 @@ const isDefinedNotNullNotEmpty = (value) => (typeof value === 'string' && value.trim().length === 0) ); -const removeUndefinedNullEmptyExclBoolInt = (obj) => _.pickBy(obj, isDefinedNotNullNotEmpty); +const removeUndefinedNullEmptyExclBoolInt = (obj) => lodash.pickBy(obj, isDefinedNotNullNotEmpty); /** * Recursively removes undefined, null, empty objects, and empty arrays from the given object at all levels. @@ -149,6 +150,7 @@ const removeUndefinedNullEmptyExclBoolInt = (obj) => _.pickBy(obj, isDefinedNotN * @returns */ const removeUndefinedNullValuesAndEmptyObjectArray = (obj) => { + // eslint-disable-next-line @typescript-eslint/no-shadow function recursive(obj) { if (Array.isArray(obj)) { const cleanedArray = obj @@ -239,11 +241,11 @@ const getHashFromArrayWithValueAsObject = (arrays, fromKey = 'from', isLowerCase const getValueFromPropertiesOrTraits = ({ message, key }) => { const keySet = ['properties', 'traits', 'context.traits']; - const val = _.find( - _.map(keySet, (k) => get(message, `${k}.${key}`)), - (v) => !_.isNil(v), + const val = lodash.find( + lodash.map(keySet, (k) => get(message, `${k}.${key}`)), + (v) => !lodash.isNil(v), ); - return !_.isNil(val) ? val : null; + return !lodash.isNil(val) ? val : null; }; /** @@ -263,6 +265,7 @@ const hasCircularReference = (obj, seen = []) => { } seen.push(obj); + // eslint-disable-next-line no-restricted-syntax for (const value of Object.values(obj)) { if (hasCircularReference(value, seen)) { return true; @@ -556,7 +559,7 @@ const handleSourceKeysOperation = ({ message, operationObject }) => { // quick sanity check for the undefined values in the list. // if there is any undefined values, return null // without going further for operations - const isAllDefined = _.every(argValues, (v) => !_.isNil(v)); + const isAllDefined = lodash.every(argValues, (v) => !lodash.isNil(v)); if (!isAllDefined) { return null; } @@ -568,9 +571,9 @@ const handleSourceKeysOperation = ({ message, operationObject }) => { result = 1; // eslint-disable-next-line no-restricted-syntax for (const v of argValues) { - if (_.isNumber(v)) { + if (lodash.isNumber(v)) { result *= v; - } else if (_.isString(v) && /^[+-]?(\d+(\.\d*)?|\.\d+)([Ee][+-]?\d+)?$/.test(v)) { + } else if (lodash.isString(v) && /^[+-]?(\d+(\.\d*)?|\.\d+)([Ee][+-]?\d+)?$/.test(v)) { result *= parseFloat(v); } else { // if there is a non number argument simply return null @@ -583,7 +586,7 @@ const handleSourceKeysOperation = ({ message, operationObject }) => { result = 0; // eslint-disable-next-line no-restricted-syntax for (const v of argValues) { - if (_.isNumber(v)) { + if (lodash.isNumber(v)) { result += v; } else { // if there is a non number argument simply return null @@ -1051,7 +1054,7 @@ const constructPayload = (message, mappingJson, destinationName = null) => { if (value || value === 0 || value === false) { if (destKey) { // set the value only if correct - _.set(payload, destKey, value); + lodash.set(payload, destKey, value); } else { // to set to root and flatten later payload[''] = value; @@ -1428,12 +1431,12 @@ const errorStatusCodeKeys = ['response.status', 'code', 'status']; const getErrorStatusCode = (error, defaultStatusCode = HTTP_STATUS_CODES.INTERNAL_SERVER_ERROR) => { try { let defaultStCode = defaultStatusCode; - if (!_.isNumber(defaultStatusCode)) { + if (!lodash.isNumber(defaultStatusCode)) { defaultStCode = HTTP_STATUS_CODES.INTERNAL_SERVER_ERROR; } const errStCode = errorStatusCodeKeys .map((statusKey) => get(error, statusKey)) - .find((stCode) => _.isNumber(stCode)); + .find((stCode) => lodash.isNumber(stCode)); return errStCode || defaultStCode; } catch (err) { logger.error('Failed in getErrorStatusCode', err); @@ -1931,7 +1934,7 @@ const batchMultiplexedEvents = (transformedEventsList, maxBatchSize) => { } if (batchedEvents.length === 0 || eventsNotBatched) { if (transformedMessage.length > maxBatchSize) { - transformedMessage = _.chunk(transformedMessage, maxBatchSize); + transformedMessage = lodash.chunk(transformedMessage, maxBatchSize); } batchedEvents.push({ events: transformedMessage, diff --git a/test/__mocks__/data/marketo_static_list/proxy_response.json b/test/__mocks__/data/marketo_static_list/proxy_response.json index 2a58d99da2..290a4f5fbf 100644 --- a/test/__mocks__/data/marketo_static_list/proxy_response.json +++ b/test/__mocks__/data/marketo_static_list/proxy_response.json @@ -96,4 +96,4 @@ }, "status": 200 } -} \ No newline at end of file +} diff --git a/test/__tests__/data/customerio_input.json b/test/__tests__/data/customerio_input.json index ea89411524..e2d987fc5a 100644 --- a/test/__tests__/data/customerio_input.json +++ b/test/__tests__/data/customerio_input.json @@ -2584,21 +2584,11 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU" - ], - "web": [ - "useNativeSDK" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU"], + "web": ["useNativeSDK"] }, "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU" - ], + "includeKeys": ["apiKey", "siteID", "datacenterEU"], "saveDestinationResponse": true, "secretKeys": [], "supportedSourceTypes": [ @@ -2674,21 +2664,11 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU" - ], - "web": [ - "useNativeSDK" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU"], + "web": ["useNativeSDK"] }, "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU" - ], + "includeKeys": ["apiKey", "siteID", "datacenterEU"], "saveDestinationResponse": true, "secretKeys": [], "supportedSourceTypes": [ @@ -2804,17 +2784,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -2826,12 +2797,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -2945,17 +2911,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -2967,12 +2924,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -3085,17 +3037,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -3107,12 +3050,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -3225,17 +3163,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -3247,12 +3176,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -3362,17 +3286,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -3384,12 +3299,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -3503,17 +3413,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -3525,12 +3426,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -3644,17 +3540,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -3666,12 +3553,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -3785,17 +3667,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -3807,12 +3680,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -3925,17 +3793,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -3947,12 +3806,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -4062,17 +3916,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -4084,12 +3929,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -4203,17 +4043,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -4225,12 +4056,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -4308,17 +4134,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -4330,12 +4147,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -4413,17 +4225,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -4435,12 +4238,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -4521,17 +4319,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -4543,12 +4332,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -4629,17 +4413,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -4651,12 +4426,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -4738,17 +4508,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -4760,12 +4521,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -4847,17 +4603,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -4869,12 +4616,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -4956,17 +4698,8 @@ "DisplayName": "Customer IO", "Config": { "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] + "defaultConfig": ["apiKey", "siteID", "datacenterEU", "deviceTokenEventName"], + "web": ["useNativeSDK", "blackListedEvents", "whiteListedEvents"] }, "excludeKeys": [], "includeKeys": [ @@ -4978,12 +4711,7 @@ ], "saveDestinationResponse": true, "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], + "supportedMessageTypes": ["identify", "page", "screen", "track"], "supportedSourceTypes": [ "android", "ios", @@ -5167,4 +4895,4 @@ } } } -] \ No newline at end of file +] diff --git a/test/__tests__/data/google_adwords_enhanced_conversions_proxy_input.json b/test/__tests__/data/google_adwords_enhanced_conversions_proxy_input.json index 612efeb99a..430cfbd05f 100644 --- a/test/__tests__/data/google_adwords_enhanced_conversions_proxy_input.json +++ b/test/__tests__/data/google_adwords_enhanced_conversions_proxy_input.json @@ -158,4 +158,4 @@ }, "files": {} } -] \ No newline at end of file +] diff --git a/test/__tests__/data/google_adwords_offline_conversions.json b/test/__tests__/data/google_adwords_offline_conversions.json index 9bdb5cda45..3c7b54ac4c 100644 --- a/test/__tests__/data/google_adwords_offline_conversions.json +++ b/test/__tests__/data/google_adwords_offline_conversions.json @@ -4600,4 +4600,4 @@ } ] } -] \ No newline at end of file +] diff --git a/test/__tests__/data/google_adwords_remarketing_lists_proxy_input.json b/test/__tests__/data/google_adwords_remarketing_lists_proxy_input.json index 3cd282ec2a..ff74720bc3 100644 --- a/test/__tests__/data/google_adwords_remarketing_lists_proxy_input.json +++ b/test/__tests__/data/google_adwords_remarketing_lists_proxy_input.json @@ -135,4 +135,4 @@ }, "files": {} } -] \ No newline at end of file +] diff --git a/test/__tests__/data/marketo_static_list_proxy_output.json b/test/__tests__/data/marketo_static_list_proxy_output.json index 8ac482b5be..ec52d0c37c 100644 --- a/test/__tests__/data/marketo_static_list_proxy_output.json +++ b/test/__tests__/data/marketo_static_list_proxy_output.json @@ -126,4 +126,4 @@ } } } -] \ No newline at end of file +] diff --git a/test/__tests__/data/slack_input.json b/test/__tests__/data/slack_input.json index f9a0b49841..e29624490c 100644 --- a/test/__tests__/data/slack_input.json +++ b/test/__tests__/data/slack_input.json @@ -1412,4 +1412,4 @@ "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" } } -] \ No newline at end of file +] diff --git a/test/__tests__/data/slack_output.json b/test/__tests__/data/slack_output.json index 63d7934a00..c772aa3b19 100644 --- a/test/__tests__/data/slack_output.json +++ b/test/__tests__/data/slack_output.json @@ -161,4 +161,4 @@ { "error": "Event is denied. Please check configuration." } -] \ No newline at end of file +] diff --git a/test/integrations/destinations/bqstream/router/data.ts b/test/integrations/destinations/bqstream/router/data.ts index 4fac9047cc..e44ce4af15 100644 --- a/test/integrations/destinations/bqstream/router/data.ts +++ b/test/integrations/destinations/bqstream/router/data.ts @@ -418,27 +418,27 @@ export const data = [ Name: 'bqstream test', }, - error: "Message Type not supported: identify", + error: 'Message Type not supported: identify', metadata: [ { jobId: 3, - userId: "user12345" + userId: 'user12345', }, { jobId: 9, - userId: "user125" - } + userId: 'user125', + }, ], statTags: { - destType: "BQSTREAM", - errorCategory: "dataValidation", - errorType: "instrumentation", - feature: "router", - implementation: "native", - module: "destination" + destType: 'BQSTREAM', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', }, - statusCode: 400 - } + statusCode: 400, + }, ], }, }, From b7848004e2679ec7278c8381560cb1a77da6c642 Mon Sep 17 00:00:00 2001 From: Sankeerth Date: Fri, 29 Sep 2023 11:03:51 +0530 Subject: [PATCH 5/8] fix: add auth status inactive category handling to GA in userDeletion flow (#2669) --- src/v0/destinations/ga/networkHandler.js | 17 +++++++- .../destinations/ga/deleteUsers/data.ts | 42 +++++++++++++++++++ test/integrations/destinations/ga/network.ts | 34 +++++++++++++++ 3 files changed, 92 insertions(+), 1 deletion(-) diff --git a/src/v0/destinations/ga/networkHandler.js b/src/v0/destinations/ga/networkHandler.js index ac244fb4a7..a12f9594cd 100644 --- a/src/v0/destinations/ga/networkHandler.js +++ b/src/v0/destinations/ga/networkHandler.js @@ -1,4 +1,7 @@ -const { REFRESH_TOKEN } = require('../../../adapters/networkhandler/authConstants'); +const { + REFRESH_TOKEN, + AUTH_STATUS_INACTIVE, +} = require('../../../adapters/networkhandler/authConstants'); const { processAxiosResponse, getDynamicErrorType, @@ -29,6 +32,18 @@ const gaResponseHandler = (gaResponse) => { if (isInvalidCredsError || response?.error?.status === 'UNAUTHENTICATED') { throw new InvalidAuthTokenError('invalid credentials', 500, response, REFRESH_TOKEN); } + const isInvalidGrantError = + response?.error.code === 403 && + response.error?.errors?.some((errObj) => errObj.reason === 'insufficientPermissions'); + if (isInvalidGrantError) { + throw new InvalidAuthTokenError( + response?.error?.message || 'insufficent permissions', + 400, + response, + AUTH_STATUS_INACTIVE, + ); + } + throw new NetworkError( `Error occurred while completing deletion request: ${response.error?.message}`, status, diff --git a/test/integrations/destinations/ga/deleteUsers/data.ts b/test/integrations/destinations/ga/deleteUsers/data.ts index d11881e8fe..6cbc5d5cfe 100644 --- a/test/integrations/destinations/ga/deleteUsers/data.ts +++ b/test/integrations/destinations/ga/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { AUTH_STATUS_INACTIVE } from '../../../../../src/adapters/networkhandler/authConstants'; + export const data = [ { name: 'ga', @@ -136,4 +138,44 @@ export const data = [ }, }, }, + { + name: 'ga', + description: 'Test 3', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + headers: { + 'x-rudder-dest-info': '{"secret": { "access_token": "no_permissions_token" }}', + }, + body: [ + { + destType: 'GA', + userAttributes: [ + { + userId: 'test_user_20', + }, + ], + config: { + trackingID: 'UA-123456789-7', + useNativeSDK: false, + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + authErrorCategory: AUTH_STATUS_INACTIVE, + error: 'User does not have sufficient permissions', + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/ga/network.ts b/test/integrations/destinations/ga/network.ts index bef0b7a047..acfe5db430 100644 --- a/test/integrations/destinations/ga/network.ts +++ b/test/integrations/destinations/ga/network.ts @@ -289,5 +289,39 @@ const deleteNwData = [ statusText: 'OK', }, }, + { + httpReq: { + method: 'post', + url: 'https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert', + data: { + kind: 'analytics#userDeletionRequest', + id: { + type: 'USER_ID', + userId: 'test_user_20', + }, + webPropertyId: 'UA-123456789-7', + }, + headers: { + Authorization: 'Bearer no_permissions_token', + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + }, + httpRes: { + data: { + error: { + errors: [ + { + reason: 'insufficientPermissions', + }, + ], + code: 403, + message: 'User does not have sufficient permissions', + }, + }, + status: 200, + statusText: 'OK', + }, + }, ]; export const networkCallsData = [...deleteNwData]; From f63b4932d5ba467a82a36d3e8b80578f81f729cf Mon Sep 17 00:00:00 2001 From: Anant Jain <62471433+anantjain45823@users.noreply.github.com> Date: Fri, 29 Sep 2023 12:05:40 +0530 Subject: [PATCH 6/8] fix: refactor adjust using optional chaining (#2671) fix: refactor adj using opitonal chaining --- src/v0/destinations/adj/transform.js | 16 ++- .../destinations/adj/processor/data.ts | 115 +++++++++++++++--- 2 files changed, 108 insertions(+), 23 deletions(-) diff --git a/src/v0/destinations/adj/transform.js b/src/v0/destinations/adj/transform.js index 1862012bb1..695654e58a 100644 --- a/src/v0/destinations/adj/transform.js +++ b/src/v0/destinations/adj/transform.js @@ -21,7 +21,12 @@ const rejectParams = ['revenue', 'currency']; function responseBuilderSimple(message, category, destination) { const payload = constructPayload(message, MAPPING_CONFIG[category.name]); - const { appToken, customMappings, environment } = destination.Config; + const { appToken, customMappings, environment, partnerParamsKeys } = destination.Config; + if (!appToken) { + throw new ConfigurationError( + 'App Token is not present. Please configure your app token from config dashbaord', + ); + } const platform = get(message, 'context.device.type'); const id = get(message, 'context.device.id'); if (typeof platform !== 'string' || !platform || !id) { @@ -37,7 +42,7 @@ function responseBuilderSimple(message, category, destination) { throw new InstrumentationError('Device type not valid'); } if (payload.revenue) { - payload.currency = message.properties.currency || 'USD'; + payload.currency = message?.properties?.currency || 'USD'; } const hashMap = getHashFromArray(customMappings, 'from', 'to', false); if (payload && message.event && hashMap[message.event]) { @@ -46,11 +51,11 @@ function responseBuilderSimple(message, category, destination) { Accept: '*/*', }; - const partnerParamsKeysMap = getHashFromArray(destination?.Config?.partnerParamsKeys); + const partnerParamsKeysMap = getHashFromArray(partnerParamsKeys); if (partnerParamsKeysMap) { payload.partner_params = {}; Object.keys(partnerParamsKeysMap).forEach((key) => { - if (message.properties[key]) { + if (message?.properties?.[key]) { payload.partner_params[partnerParamsKeysMap[key]] = message.properties[key].toString(); } }); @@ -81,9 +86,8 @@ function responseBuilderSimple(message, category, destination) { // fail-safety for developer error if (!message.event || !hashMap[message.event]) { throw new ConfigurationError('No event token mapped for this event'); - } else { - throw new TransformationError('Payload could not be constructed'); } + throw new TransformationError('Payload could not be constructed'); } const processEvent = (message, destination) => { diff --git a/test/integrations/destinations/adj/processor/data.ts b/test/integrations/destinations/adj/processor/data.ts index 97fc3554f2..2c208d0d08 100644 --- a/test/integrations/destinations/adj/processor/data.ts +++ b/test/integrations/destinations/adj/processor/data.ts @@ -2084,7 +2084,7 @@ export const data = [ }, { name: 'adj', - description: 'Test 17', + description: 'Test 18 -> No adverstisingId present', feature: 'processor', module: 'destination', version: 'v0', @@ -2104,7 +2104,6 @@ export const data = [ }, device: { adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', manufacturer: 'Google', model: 'AOSP on IA Emulator', @@ -2160,12 +2159,101 @@ export const data = [ }, }, Config: { - appToken: 'testAppToken', customMappings: [ { from: 'Application Installed', to: '3fdmll' }, { from: 'First Investment', to: 'testEventToken' }, ], - partnerParamsKeys: [], + environment: true, + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'App Token is not present. Please configure your app token from config dashbaord', + statTags: { + destType: 'ADJ', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'adj', + description: 'Test 19 -> No properties object in message body', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + "type": "track", + "event": "Application Installed", + "sentAt": "2022-09-28T20:14:44.995Z", + "userId": "sample_user_id", + "context": { + "device": { + "id": "sample_device_id", + "type": "android", + "advertisingId": "_sample" + }, + "traits": { + "userId": "_sample_uid", + "anonymousId": "_sample_anonid" + } + }, + "timestamp": "2022-09-28T20:14:43.314Z", + "request_ip": "71.189.106.156", + "originalTimestamp": "2022-09-28T20:14:44.995Z" + }, + destination: { + ID: '1i3Em7GMU9xVEiDlZUN8c88BMS9', + Name: 'ADJ', + DestinationDefinition: { + ID: '1i3DeZo6eSUKrS3KzDUqjbBPCDJ', + Name: 'ADJ', + DisplayName: 'Adjust', + Config: { + destConfig: { + android: ['useNativeSDK'], + defaultConfig: ['appToken', 'customMappings', 'delay', 'environment'], + ios: ['useNativeSDK'], + reactnative: ['useNativeSDK'], + }, + excludeKeys: [], + includeKeys: ['appToken', 'customMappings', 'delay'], + supportedSourceTypes: ['android', 'ios', 'reactnative', 'cloud'], + }, + }, + Config: { + appToken: 'testAppToken', + customMappings: [ + { from: 'Application Installed', to: '3fdmll' }], + partnerParamsKeys: [ + { from: 'key1', to: 'partnerParamKey-1' }, + { from: 'key2', to: 'partnerParamKey-2' }, + { from: 'revenue', to: 'price' }, + { from: 'novalue', to: 'check' }, + { from: 'Custom_Val_NA', to: 'Custom_dest' }, + ], environment: true, }, Enabled: true, @@ -2189,28 +2277,21 @@ 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"}', - revenue: 20.38, - android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - att_status: 3, - tracking_enabled: true, - currency: 'EUR', - ip_address: '[::1]', + event_token: "3fdmll", + ip_address: "71.189.106.156", + android_id: 'sample_device_id', + gps_adid: "_sample", s2s: 1, app_token: 'testAppToken', - event_token: 'testEventToken', environment: 'production', }, body: { JSON: {}, XML: {}, JSON_ARRAY: {}, FORM: {} }, files: {}, - userId: '21e13f4bc7ceddad', + userId: '', }, statusCode: 200, }, ], }, }, - }, -]; + },]; From 5dade9ae0e886263380c65a096bcbad259851a10 Mon Sep 17 00:00:00 2001 From: devops-github-rudderstack <88187154+devops-github-rudderstack@users.noreply.github.com> Date: Fri, 29 Sep 2023 04:41:40 -0500 Subject: [PATCH 7/8] chore(release): pull main into develop post release v1.43.1 (#2662) * fix(dm): updated the stats definition for the tracking plan service * fix(iterable): event id mapping (#2659) * chore(release): 1.43.1 * chore: update release owners (#2661) chore: update release stakeholder --------- Co-authored-by: Abhimanyu Babbar Co-authored-by: Mihir Bhalala <77438541+mihir-4116@users.noreply.github.com> Co-authored-by: GitHub Actions Co-authored-by: Anant Jain <62471433+anantjain45823@users.noreply.github.com> Co-authored-by: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> --- .github/workflows/create-hotfix-branch.yml | 2 +- .github/workflows/draft-new-release.yml | 2 +- CHANGELOG.md | 8 ++++++++ package-lock.json | 4 ++-- package.json | 2 +- src/util/prometheus.js | 16 ++-------------- .../iterable/data/IterableTrackConfig.json | 7 +++++-- .../data/IterableTrackPurchaseConfig.json | 12 +++++------- test/__tests__/data/iterable.json | 1 - 9 files changed, 25 insertions(+), 29 deletions(-) diff --git a/.github/workflows/create-hotfix-branch.yml b/.github/workflows/create-hotfix-branch.yml index db6f4118e4..aa928b4646 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 == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507') + if: github.ref == 'refs/heads/main' && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823') 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 5df37bd6cb..044885316d 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 == 'shrouti1507') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507') + 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 == 'shrouti1507' || github.actor == 'anantjain45823') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823') steps: - name: Checkout uses: actions/checkout@v3.5.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index d98085db13..509ddabe0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ 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.43.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.43.0...v1.43.1) (2023-09-26) + + +### Bug Fixes + +* **dm:** updated the stats definition for the tracking plan service ([eb2724f](https://github.com/rudderlabs/rudder-transformer/commit/eb2724f135d2c3c2a1fb8a88051cfb0f2720b5ed)) +* **iterable:** event id mapping ([#2659](https://github.com/rudderlabs/rudder-transformer/issues/2659)) ([84083aa](https://github.com/rudderlabs/rudder-transformer/commit/84083aa671312e3934414b5534489fba87d9b29f)) + ## [1.43.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.42.0...v1.43.0) (2023-09-25) diff --git a/package-lock.json b/package-lock.json index 0ebcb14c71..944b00860c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.43.0", + "version": "1.43.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.43.0", + "version": "1.43.1", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "^0.7.24", diff --git a/package.json b/package.json index ed08c7a7cd..ddb20fe411 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.43.0", + "version": "1.43.1", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { diff --git a/src/util/prometheus.js b/src/util/prometheus.js index 2d781fb862..0899590cd5 100644 --- a/src/util/prometheus.js +++ b/src/util/prometheus.js @@ -229,7 +229,7 @@ class Prometheus { name: 'tp_errors', help: 'tp_errors', type: 'counter', - labelNames: ['sourceType', 'destinationType', 'k8_namespace', 'workspaceId', 'transformationId'], + labelNames: ['sourceType', 'destinationType', 'k8_namespace', 'workspaceId', 'trackingPlanId'], }, { name: 'tp_events_count', @@ -575,7 +575,7 @@ class Prometheus { name: 'tp_request_latency', help: 'tp_request_latency', type: 'histogram', - labelNames: ['sourceType', 'destinationType', 'k8_namespace', 'workspaceId', 'transformationId'], + labelNames: ['sourceType', 'destinationType', 'k8_namespace', 'workspaceId', 'trackingPlanId'], }, { name: 'cdk_events_latency', @@ -614,18 +614,6 @@ class Prometheus { 'k8_namespace', ], }, - { - name: 'user_transform_function_latency', - help: 'user_transform_function_latency', - type: 'histogram', - labelNames: [ - 'transformationVersionId', - 'processSessions', - 'sourceType', - 'destinationType', - 'k8_namespace', - ], - }, { name: 'source_transform_request_latency', help: 'source_transform_request_latency', diff --git a/src/v0/destinations/iterable/data/IterableTrackConfig.json b/src/v0/destinations/iterable/data/IterableTrackConfig.json index 28fdcaecc7..5de4856b33 100644 --- a/src/v0/destinations/iterable/data/IterableTrackConfig.json +++ b/src/v0/destinations/iterable/data/IterableTrackConfig.json @@ -23,8 +23,11 @@ }, { "destKey": "id", - "sourceKeys": ["properties.id", "properties.event_id"], - "required": false + "sourceKeys": "properties.event_id", + "required": false, + "metadata": { + "type": "toString" + } }, { "destKey": "eventName", diff --git a/src/v0/destinations/iterable/data/IterableTrackPurchaseConfig.json b/src/v0/destinations/iterable/data/IterableTrackPurchaseConfig.json index 00e83d0125..aa15d76a70 100644 --- a/src/v0/destinations/iterable/data/IterableTrackPurchaseConfig.json +++ b/src/v0/destinations/iterable/data/IterableTrackPurchaseConfig.json @@ -6,13 +6,11 @@ }, { "destKey": "id", - "sourceKeys": [ - "properties.order_id", - "properties.orderId", - "properties.id", - "properties.event_id" - ], - "required": false + "sourceKeys": ["properties.order_id", "properties.orderId", "properties.event_id"], + "required": false, + "metadata": { + "type": "toString" + } }, { "destKey": "createdAt", diff --git a/test/__tests__/data/iterable.json b/test/__tests__/data/iterable.json index 08e83a47a5..f8147c7402 100644 --- a/test/__tests__/data/iterable.json +++ b/test/__tests__/data/iterable.json @@ -3103,7 +3103,6 @@ "JSON_ARRAY": {}, "FORM": {}, "JSON": { - "id": "event1234", "userId": "abcdeeeeeeeexxxx102", "createdAt": 1598631966468, "dataFields": { From 56c80f2c47ca0aa8411a1cc16462b98dfecb4a79 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:20:38 +0530 Subject: [PATCH 8/8] chore: update error messages of GAOC (#2655) --- .../google_adwords_offline_conversions/transform.js | 4 +++- .../google_adwords_offline_conversions/utils.js | 6 ++++-- test/__tests__/data/google_adwords_offline_conversions.json | 4 ++-- .../google_adwords_offline_conversions_router_output.json | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/v0/destinations/google_adwords_offline_conversions/transform.js b/src/v0/destinations/google_adwords_offline_conversions/transform.js index 93b4592c33..a4bd218673 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/transform.js +++ b/src/v0/destinations/google_adwords_offline_conversions/transform.js @@ -100,7 +100,9 @@ const trackResponseBuilder = (message, metadata, destination) => { const responseList = []; if (!eventsToConversionsNamesMapping[event] || !eventsToOfflineConversionsTypeMapping[event]) { - throw new ConfigurationError(`Event name '${event}' is not valid`); + throw new ConfigurationError( + `Event name '${event}' is not present in the mapping provided in the dashboard.`, + ); } const conversionTypes = Array.from(eventsToOfflineConversionsTypeMapping[event]); conversionTypes.forEach((conversionType) => { diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.js b/src/v0/destinations/google_adwords_offline_conversions/utils.js index 6bdedcc0d4..a39c984788 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.js @@ -76,7 +76,9 @@ const getConversionActionId = async (headers, params) => { 'response.0.results.0.conversionAction.resourceName', ); if (!conversionAction) { - throw new AbortedError(`Unable to find conversionActionId for conversion:${params.event}`); + throw new AbortedError( + `Unable to find conversionActionId for conversion:${params.event}. Most probably the conversion name in Google dashboard and Rudderstack dashboard are not same.`, + ); } return conversionAction; }); @@ -172,7 +174,7 @@ const requestBuilder = ( const filteredLoginCustomerId = removeHyphens(loginCustomerId); response.headers['login-customer-id'] = filteredLoginCustomerId; } else { - throw new ConfigurationError(`loginCustomerId is required as subAccount is enabled`); + throw new ConfigurationError(`"Login Customer ID" is required as "Sub Account" is enabled`); } } return response; diff --git a/test/__tests__/data/google_adwords_offline_conversions.json b/test/__tests__/data/google_adwords_offline_conversions.json index 3c7b54ac4c..36eab5ac22 100644 --- a/test/__tests__/data/google_adwords_offline_conversions.json +++ b/test/__tests__/data/google_adwords_offline_conversions.json @@ -1622,7 +1622,7 @@ } }, "statusCode": 400, - "error": "Event name 'purchase' is not valid", + "error": "Event name 'purchase' is not present in the mapping provided in the dashboard.", "statTags": { "destination": "google_adwords_offline_conversions", "stage": "transform", @@ -2948,7 +2948,7 @@ "secret": null }, "statusCode": 400, - "error": "loginCustomerId is required as subAccount is enabled", + "error": "\"Login Customer ID\" is required as \"Sub Account\" is enabled", "statTags": { "destination": "google_adwords_offline_conversions", "stage": "transform", diff --git a/test/__tests__/data/google_adwords_offline_conversions_router_output.json b/test/__tests__/data/google_adwords_offline_conversions_router_output.json index 16b07233e3..2424e51002 100644 --- a/test/__tests__/data/google_adwords_offline_conversions_router_output.json +++ b/test/__tests__/data/google_adwords_offline_conversions_router_output.json @@ -472,7 +472,7 @@ ], "batched": false, "statusCode": 400, - "error": "Event name 'order completed' is not valid", + "error": "Event name 'order completed' is not present in the mapping provided in the dashboard.", "statTags": { "errorCategory": "dataValidation", "errorType": "configuration" }, "destination": { "Config": {